From baf8b10282d54a5f03cbc2c825887b14fb0197b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Tue, 19 Sep 2023 18:26:46 +0200 Subject: [PATCH] Make record and user fields sortable --- lib/js/src/compose/types/module-field/base.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/js/src/compose/types/module-field/base.ts b/lib/js/src/compose/types/module-field/base.ts index 376f7c0cb..727e8c580 100644 --- a/lib/js/src/compose/types/module-field/base.ts +++ b/lib/js/src/compose/types/module-field/base.ts @@ -4,8 +4,8 @@ import { Apply, CortezaID, NoID } from '../../../cast' export const FieldNameValidator = /^[A-Za-z][0-9A-Za-z_\-.]*[A-Za-z0-9]$/ -const unsortableFieldKinds = ['User', 'Record', 'File', 'Geometry'] -const unsortableSysFields = ['recordID', 'ownedBy', 'createdBy', 'updatedBy', 'deletedBy'] +const unsortableFieldKinds = ['File', 'Geometry'] +const unsortableSysFields = ['recordID'] const unfilterableFieldKinds = ['File', 'Geometry'] @@ -126,16 +126,16 @@ export class ModuleField { ...this.options.description, ...o.description, } - + this.options.description.edit = this.options.description.edit || undefined } - + if (o.hint) { this.options.hint = { ...this.options.hint, ...o.hint, } - + this.options.hint.edit = this.options.hint.edit || undefined } } @@ -177,6 +177,7 @@ export class ModuleField { if (this.isSystem) { this.canUpdateRecordValue = true this.canReadRecordValue = true + if (unsortableSysFields.includes(this.name)) { this.isSortable = false }