Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
client/text editor/tables: update icons
Adorian Dorande3f93d2df7c
diff --git a/apps/client/src/menus/table_context_menu.spec.ts b/apps/client/src/menus/table_context_menu.spec.tsindex 7053e344e3..ae3b33d16c 100644--- a/apps/client/src/menus/table_context_menu.spec.ts+++ b/apps/client/src/menus/table_context_menu.spec.ts@@ -49,6 +49,10 @@ describe("buildTableMenuSections", () => {expect(titles(sections?.delete ?? [])).toEqual(DELETE_TITLES);expect(titles(sections ? [sections.sort] : [])).toEqual(["table_context_menu.sort"]);expect(titles(sortSubmenu(sections))).toEqual(SORT_TITLES);+ const sortRow = sections?.sort as MenuCommandItem<any> | undefined;+ expect(sortRow?.uiIcon).toBe("bx bx-sort-alt-2");+ expect(sortSubmenu(sections).map((item) => (item as MenuCommandItem<any>).uiIcon))+ .toEqual(["bx bx-sort-up", "bx bx-sort-down"]);const splitRow = findItem(sections?.main ?? [], "table_context_menu.split_cells");const submenu = splitRow?.items ?? [];diff --git a/apps/client/src/menus/table_context_menu.ts b/apps/client/src/menus/table_context_menu.tsindex 15aee4bff8..1e5fabfe8a 100644--- a/apps/client/src/menus/table_context_menu.ts+++ b/apps/client/src/menus/table_context_menu.ts@@ -54,9 +54,9 @@ export function buildTableMenuSections(const unmergeItem = commandItem(t("table_context_menu.split_reset"), "bx bx-reset","triliumResetTableCellSpans");const sortItems = [- commandItem(t("table_context_menu.sort_ascending"), "bx bx-sort-a-z",+ commandItem(t("table_context_menu.sort_ascending"), "bx bx-sort-up","triliumSortTableRowsAscending"),- commandItem(t("table_context_menu.sort_descending"), "bx bx-sort-z-a",+ commandItem(t("table_context_menu.sort_descending"), "bx bx-sort-down","triliumSortTableRowsDescending")];@@ -85,7 +85,7 @@ export function buildTableMenuSections(],sort: {title: t("table_context_menu.sort"),- uiIcon: "bx bx-sort",+ uiIcon: "bx bx-sort-alt-2",enabled: sortItems.some((item) => item.enabled),items: sortItems},diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Tables.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Tables.htmlindex c664112f7f..00f8971bc8 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Tables.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Tables.html@@ -151,7 +151,7 @@ src="3_Tables_image.png" width="384" height="100"><li>To sort all the rows, place the cursor in any cell of the column to sortby, then select <em>Sort</em> → <em>Ascending</em> or <em>Descending</em> fromthe <a href="#context-menu">context menu</a>. The same items are in the <span- class="tn-icon bx bx-sort"></span> button of the formatting toolbar.</li>+ class="tn-icon bx bx-sort-alt-2"></span> button of the formatting toolbar.</li><li>To sort only some of the rows, select their cells in the column to sortby, then sort the same way. Sorting is not available while the selectionspans more than one column.</li>diff --git a/docs/User Guide/User Guide/Note Types/Text/Tables.md b/docs/User Guide/User Guide/Note Types/Text/Tables.mdindex b2d9c5125e..6160ffda79 100644--- a/docs/User Guide/User Guide/Note Types/Text/Tables.md+++ b/docs/User Guide/User Guide/Note Types/Text/Tables.md@@ -83,7 +83,7 @@ Outside of tables, <kbd>Alt</kbd>+<kbd>Left</kbd> and <kbd>Alt</kbd>+<kbd>Right<Since v0.107.0, the rows of a table can be sorted by the values of one column:-* To sort all the rows, place the cursor in any cell of the column to sort by, then select _Sort_ → _Ascending_ or _Descending_ from the [context menu](#context-menu). The same items are in the <span class="tn-icon bx bx-sort"></span> button of the formatting toolbar.+* To sort all the rows, place the cursor in any cell of the column to sort by, then select _Sort_ → _Ascending_ or _Descending_ from the [context menu](#context-menu). The same items are in the <span class="tn-icon bx bx-sort-alt-2"></span> button of the formatting toolbar.* To sort only some of the rows, select their cells in the column to sort by, then sort the same way. Sorting is not available while the selection spans more than one column.Header rows always stay at the top of the table and are never sorted. A sort can be undone with <kbd>Ctrl</kbd>+<kbd>Z</kbd>.diff --git a/packages/ckeditor5/src/plugins/table_toolbar_dropdowns.spec.ts b/packages/ckeditor5/src/plugins/table_toolbar_dropdowns.spec.tsindex 1dd91b9ee9..1a076eb597 100644--- a/packages/ckeditor5/src/plugins/table_toolbar_dropdowns.spec.ts+++ b/packages/ckeditor5/src/plugins/table_toolbar_dropdowns.spec.ts@@ -1,3 +1,4 @@+import bxSortAlt2 from "boxicons/svg/regular/bx-sort-alt-2.svg?raw";import {_getModelData as getModelData,_setModelData as setModelData,@@ -164,7 +165,7 @@ describe("TableToolbarDropdowns", () => {const tableData = () => getModelData(editor.model, { withoutSelection: true });expect(dropdown.buttonView.label).toBe("Sort");- expect(dropdown.buttonView.icon).toContain("<svg");+ expect(dropdown.buttonView.icon).toBe(bxSortAlt2);expect(dropdown.isEnabled).toBe(false);setModelData(editor.model, modelTable([["b[]"], ["c"], ["a"]]));diff --git a/packages/ckeditor5/src/plugins/table_toolbar_dropdowns.ts b/packages/ckeditor5/src/plugins/table_toolbar_dropdowns.tsindex 60c6f2eaaa..7a0ad7edcf 100644--- a/packages/ckeditor5/src/plugins/table_toolbar_dropdowns.ts+++ b/packages/ckeditor5/src/plugins/table_toolbar_dropdowns.ts@@ -1,4 +1,4 @@-import bxSort from "boxicons/svg/regular/bx-sort.svg?raw";+import bxSortAlt2 from "boxicons/svg/regular/bx-sort-alt-2.svg?raw";import {addListToDropdown,Collection,@@ -86,7 +86,7 @@ export default class TableToolbarDropdowns extends Plugin {factory.add("tableSort", (locale) => this.createDropdown(locale, {label: t("Sort"),- icon: bxSort,+ icon: bxSortAlt2,items: [buttonItem("triliumSortTableRowsAscending", t("Ascending")),buttonItem("triliumSortTableRowsDescending", t("Descending"))