From 9968929cce14a8f1c657da5123e64bb27a897d52 Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Tue, 3 Dec 2024 10:37:28 +0530 Subject: [PATCH 1/2] ELEMENTS-1772: fix error wih saved search using deleted authors --- ui/widgets/nuxeo-selectivity.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui/widgets/nuxeo-selectivity.js b/ui/widgets/nuxeo-selectivity.js index a1f959d43..930e38a6e 100644 --- a/ui/widgets/nuxeo-selectivity.js +++ b/ui/widgets/nuxeo-selectivity.js @@ -6811,6 +6811,11 @@ typedArrayTags[weakMapTag] = false; type: Object, value: null, }, + + _backupData: { + type: Array, + value: [], + } }; } @@ -7306,6 +7311,12 @@ typedArrayTags[weakMapTag] = false; } _resolveEntry(entry) { + if (this.data && this.data.length > 1) { + this._backupData = this.data; + } + if (this.data && this._backupData && this.data.length < this._backupData.length) { + this.data = this._backupData; + } if (this.data) { for (let i = 0; i < this.data.length; i++) { if (this.idFunction(this.data[i]) === entry) { From b82e7364da97298c2c49a3aec639b7553e11ad4e Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Wed, 4 Dec 2024 11:55:26 +0530 Subject: [PATCH 2/2] ELEMENTS-1772: fix error wih saved search using deleted authors --- ui/widgets/nuxeo-selectivity.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ui/widgets/nuxeo-selectivity.js b/ui/widgets/nuxeo-selectivity.js index 930e38a6e..a86855a8e 100644 --- a/ui/widgets/nuxeo-selectivity.js +++ b/ui/widgets/nuxeo-selectivity.js @@ -6811,11 +6811,6 @@ typedArrayTags[weakMapTag] = false; type: Object, value: null, }, - - _backupData: { - type: Array, - value: [], - } }; } @@ -7311,12 +7306,6 @@ typedArrayTags[weakMapTag] = false; } _resolveEntry(entry) { - if (this.data && this.data.length > 1) { - this._backupData = this.data; - } - if (this.data && this._backupData && this.data.length < this._backupData.length) { - this.data = this._backupData; - } if (this.data) { for (let i = 0; i < this.data.length; i++) { if (this.idFunction(this.data[i]) === entry) { @@ -7358,6 +7347,15 @@ typedArrayTags[weakMapTag] = false; _valueChanged(newValue) { if (this._selectivity && !this._inUpdateSelection) { if (newValue) { + const selectivityItems = this._selectivity.items; + if (Array.isArray(selectivityItems)) { + const filteredItems = selectivityItems.filter(item => + item && newValue.includes(item.id) + ); + if (Array.isArray(filteredItems)) { + this.data = filteredItems; + } + } this._selectivity.setValue(newValue, { triggerChange: false }); } else { const cv = this._selectivity.getValue();