mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
Adding sort order for filters
This commit is contained in:
@@ -76,12 +76,13 @@ class ColumnPicker extends Disposable {
|
||||
void use(refreshTrigger);
|
||||
|
||||
const columnsAsOptions: IOption<number|null>[] = use(canBeMapped)
|
||||
.sort(labelsOrder)
|
||||
.map((col) => ({
|
||||
value: col.getRowId(),
|
||||
label: col.label.peek() || '',
|
||||
icon: 'FieldColumn',
|
||||
}));
|
||||
icon: 'FieldColumn' as const,
|
||||
}))
|
||||
.sort(labelsOrder);
|
||||
|
||||
|
||||
// For optional mappings, add 'Blank' option but only if the value is set.
|
||||
// This option will allow to clear the selection.
|
||||
|
||||
@@ -4,6 +4,7 @@ import * as kf from 'app/client/lib/koForm';
|
||||
import {makeT} from 'app/client/lib/localization';
|
||||
import {addToSort, updatePositions} from 'app/client/lib/sortUtil';
|
||||
import {ViewSectionRec} from 'app/client/models/DocModel';
|
||||
import {labelsOrder} from 'app/client/models/entities/ColumnRec';
|
||||
import {ObjObservable} from 'app/client/models/modelUtil';
|
||||
import {dropdownWithSearch} from 'app/client/ui/searchDropdown';
|
||||
import {cssIcon, cssRow, cssSortFilterColumn} from 'app/client/ui/RightPanelStyles';
|
||||
@@ -215,7 +216,7 @@ export class SortConfig extends Disposable {
|
||||
const currentSection = this._section;
|
||||
const currentSortSpec = use(currentSection.activeSortSpec);
|
||||
const specRowIds = new Set(currentSortSpec.map(_sortRef => Sort.getColRef(_sortRef)));
|
||||
return use(columns).filter(_col => !specRowIds.has(_col.value));
|
||||
return use(columns).filter(_col => !specRowIds.has(_col.value)).sort(labelsOrder);
|
||||
});
|
||||
const {menuOptions} = this._options;
|
||||
return cssButtonRow(
|
||||
|
||||
Reference in New Issue
Block a user