From c2d61f1c01a12024d8ff682c9f5153aa29c75a8d Mon Sep 17 00:00:00 2001 From: Louis Delbosc Date: Wed, 16 Nov 2022 11:36:15 +0100 Subject: [PATCH 1/3] add normalizetext to filter search --- app/client/models/ColumnFilterMenuModel.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/client/models/ColumnFilterMenuModel.ts b/app/client/models/ColumnFilterMenuModel.ts index e6193b61..734d04ec 100644 --- a/app/client/models/ColumnFilterMenuModel.ts +++ b/app/client/models/ColumnFilterMenuModel.ts @@ -1,5 +1,6 @@ import { ColumnFilter } from "app/client/models/ColumnFilter"; import { CellValue } from "app/plugin/GristData"; +import { normalizeText } from "app/client/lib/ACIndex"; import { Computed, Disposable, Observable } from "grainjs"; import escapeRegExp = require("lodash/escapeRegExp"); import isNull = require("lodash/isNull"); @@ -31,11 +32,11 @@ export class ColumnFilterMenuModel extends Disposable { // computes a set of all keys that matches the search text. 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); return new Set( this._valueCount - .filter(([_, {label, count}]) => (showAllOptions ? true : count) && searchRegex.test(label)) + .filter(([_, {label, count}]) => (showAllOptions ? true : count) && searchRegex.test(normalizeText(label))) .map(([key]) => key) ); }); From 0cf5e4025e2c5daee6fc1015be87c482e3b41943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Sadzi=C5=84ski?= Date: Wed, 16 Nov 2022 18:59:06 +0100 Subject: [PATCH 2/3] Fixing type in translation files --- static/locales/en.client.json | 2 +- static/locales/fr.client.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/locales/en.client.json b/static/locales/en.client.json index 3d0ba848..cf610d23 100644 --- a/static/locales/en.client.json +++ b/static/locales/en.client.json @@ -659,7 +659,7 @@ }, "CodeEditorPanel": { "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": { "RawDataTables":"Raw Data Tables", diff --git a/static/locales/fr.client.json b/static/locales/fr.client.json index 23d0e9ae..8ff225e5 100644 --- a/static/locales/fr.client.json +++ b/static/locales/fr.client.json @@ -657,7 +657,7 @@ }, "CodeEditorPanel": { "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": { "RawDataTables": "Données sources", From 619cd91dea5cc8a21003a1ead62d1a036d2cda6e Mon Sep 17 00:00:00 2001 From: Louis Delbosc Date: Thu, 17 Nov 2022 16:06:53 +0100 Subject: [PATCH 3/3] Display table name instead of table Ids on select column reference (#353) --- app/client/widgets/FieldBuilder.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/client/widgets/FieldBuilder.ts b/app/client/widgets/FieldBuilder.ts index dca47244..4baf8111 100644 --- a/app/client/widgets/FieldBuilder.ts +++ b/app/client/widgets/FieldBuilder.ts @@ -336,9 +336,9 @@ export class FieldBuilder extends Disposable { // Builds the reference type table selector. Built when the column is type reference. public _buildRefTableSelect() { const allTables = Computed.create(null, (use) => - use(this._docModel.visibleTableIds.getObservable()).map(tableId => ({ - value: tableId, - label: tableId, + use(this._docModel.visibleTables.getObservable()).map(tableRec => ({ + value: use(tableRec.tableId), + label: use(tableRec.tableNameDef), icon: 'FieldTable' as const })) );