From 9b27e3fd2bde855e3f601087e81c0d21c6173e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Sadzi=C5=84ski?= Date: Tue, 15 Oct 2024 13:20:08 +0200 Subject: [PATCH] Updating other places --- app/client/ui/GridViewMenus.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/client/ui/GridViewMenus.ts b/app/client/ui/GridViewMenus.ts index f816f723..6f7d0d8a 100644 --- a/app/client/ui/GridViewMenus.ts +++ b/app/client/ui/GridViewMenus.ts @@ -2,7 +2,7 @@ import {allCommands} from 'app/client/components/commands'; import {GristDoc} from 'app/client/components/GristDoc'; import GridView from 'app/client/components/GridView'; import {makeT} from 'app/client/lib/localization'; -import {ColumnRec} from "app/client/models/entities/ColumnRec"; +import {ColumnRec, columnsOrder} from "app/client/models/entities/ColumnRec"; import {ViewFieldRec} from 'app/client/models/entities/ViewFieldRec'; import {withInfoTooltip} from 'app/client/ui/tooltips'; import {isNarrowScreen, testId, theme, vars} from 'app/client/ui2018/cssVars'; @@ -293,7 +293,7 @@ function buildDetectDuplicatesMenuItems(gridView: GridView, index?: number) { const {viewSection} = gridView; return menuItemSubmenu( () => searchableMenu( - viewSection.columns().map((col) => { + [...viewSection.columns()].sort(columnsOrder).map((col) => { function buildFormula() { if (isListType(col.type())) { return `any([len(${col.table().tableId()}.lookupRecords(${col.colId()}` + @@ -568,7 +568,9 @@ function buildLookupSection(gridView: GridView, index?: number){ return references.map((ref) => menuItemSubmenu( () => searchableMenu( - ref.refTable()?.visibleColumns().map(buildRefColMenu.bind(null, ref)) ?? [], + (ref.refTable()?.visibleColumns() ?? []) + .sort(columnsOrder) + .map(buildRefColMenu.bind(null, ref)), { searchInputPlaceholder: t('Search columns') }