mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) updates from grist-core
This commit is contained in:
commit
94a7b750a8
@ -1,6 +1,7 @@
|
|||||||
import { ColumnFilter } from "app/client/models/ColumnFilter";
|
import { ColumnFilter } from "app/client/models/ColumnFilter";
|
||||||
import { FilterInfo } from "app/client/models/entities/ViewSectionRec";
|
import { FilterInfo } from "app/client/models/entities/ViewSectionRec";
|
||||||
import { CellValue } from "app/plugin/GristData";
|
import { CellValue } from "app/plugin/GristData";
|
||||||
|
import { normalizeText } from "app/client/lib/ACIndex";
|
||||||
import { Computed, Disposable, Observable } from "grainjs";
|
import { Computed, Disposable, Observable } from "grainjs";
|
||||||
import escapeRegExp = require("lodash/escapeRegExp");
|
import escapeRegExp = require("lodash/escapeRegExp");
|
||||||
import isNull = require("lodash/isNull");
|
import isNull = require("lodash/isNull");
|
||||||
@ -46,11 +47,11 @@ export class ColumnFilterMenuModel extends Disposable {
|
|||||||
|
|
||||||
// computes a set of all keys that matches the search text.
|
// computes a set of all keys that matches the search text.
|
||||||
public readonly filterSet = Computed.create(this, this.searchValue, (_use, searchValue) => {
|
public readonly filterSet = Computed.create(this, this.searchValue, (_use, searchValue) => {
|
||||||
const searchRegex = new RegExp(escapeRegExp(searchValue), 'i');
|
const searchRegex = new RegExp(escapeRegExp(normalizeText(searchValue)), 'i');
|
||||||
const showAllOptions = ['Bool', 'Choice', 'ChoiceList'].includes(this.columnFilter.columnType);
|
const showAllOptions = ['Bool', 'Choice', 'ChoiceList'].includes(this.columnFilter.columnType);
|
||||||
return new Set(
|
return new Set(
|
||||||
this._params.valueCount
|
this._params.valueCount
|
||||||
.filter(([_, {label, count}]) => (showAllOptions ? true : count) && searchRegex.test(label))
|
.filter(([_, {label, count}]) => (showAllOptions ? true : count) && searchRegex.test(normalizeText(label)))
|
||||||
.map(([key]) => key)
|
.map(([key]) => key)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -336,9 +336,9 @@ export class FieldBuilder extends Disposable {
|
|||||||
// Builds the reference type table selector. Built when the column is type reference.
|
// Builds the reference type table selector. Built when the column is type reference.
|
||||||
public _buildRefTableSelect() {
|
public _buildRefTableSelect() {
|
||||||
const allTables = Computed.create(null, (use) =>
|
const allTables = Computed.create(null, (use) =>
|
||||||
use(this._docModel.visibleTableIds.getObservable()).map(tableId => ({
|
use(this._docModel.visibleTables.getObservable()).map(tableRec => ({
|
||||||
value: tableId,
|
value: use(tableRec.tableId),
|
||||||
label: tableId,
|
label: use(tableRec.tableNameDef),
|
||||||
icon: 'FieldTable' as const
|
icon: 'FieldTable' as const
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
|
@ -676,7 +676,7 @@
|
|||||||
},
|
},
|
||||||
"CodeEditorPanel": {
|
"CodeEditorPanel": {
|
||||||
"AccessDenied":"Access denied",
|
"AccessDenied":"Access denied",
|
||||||
"CodeViewOnlyFullAccess.":"Code View is available only when you have full document access."
|
"CodeViewOnlyFullAccess":"Code View is available only when you have full document access."
|
||||||
},
|
},
|
||||||
"DataTables": {
|
"DataTables": {
|
||||||
"RawDataTables":"Raw Data Tables",
|
"RawDataTables":"Raw Data Tables",
|
||||||
|
@ -673,7 +673,7 @@
|
|||||||
},
|
},
|
||||||
"CodeEditorPanel": {
|
"CodeEditorPanel": {
|
||||||
"AccessDenied": "Accès refusé",
|
"AccessDenied": "Accès refusé",
|
||||||
"CodeViewOnlyFullAccess.": "La vue code n’est disponible que lorsque vous avez un accès complet au document."
|
"CodeViewOnlyFullAccess": "La vue code n’est disponible que lorsque vous avez un accès complet au document."
|
||||||
},
|
},
|
||||||
"DataTables": {
|
"DataTables": {
|
||||||
"RawDataTables": "Données sources",
|
"RawDataTables": "Données sources",
|
||||||
|
Loading…
Reference in New Issue
Block a user