Skip to content

Commit

Permalink
ELEMENTS-1772: fix error wih saved search using deleted authors
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshkumar1019 committed Dec 4, 2024
1 parent 9968929 commit b82e736
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions ui/widgets/nuxeo-selectivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -6811,11 +6811,6 @@ typedArrayTags[weakMapTag] = false;
type: Object,
value: null,
},

_backupData: {
type: Array,
value: [],
}
};
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b82e736

Please sign in to comment.