RED-7887 - UI saves the last saved dictionary in compare and no longer updates itself after selecting another template
This commit is contained in:
parent
bcd9527696
commit
f08500b61b
@ -143,7 +143,7 @@ export class DictionaryManagerComponent implements OnChanges, OnInit {
|
|||||||
this._dictionariesMapService.get(this.#compareDictionary.dossierTemplateId, this.#compareDictionary.type).getEntries(this.type);
|
this._dictionariesMapService.get(this.#compareDictionary.dossierTemplateId, this.#compareDictionary.type).getEntries(this.type);
|
||||||
|
|
||||||
if (entries.length) {
|
if (entries.length) {
|
||||||
this.diffEditorText = this.#toString([...entries]);
|
this.diffEditorText = entries.join('\n');
|
||||||
this.showDiffEditor = true;
|
this.showDiffEditor = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -152,7 +152,7 @@ export class DictionaryManagerComponent implements OnChanges, OnInit {
|
|||||||
.getForType(this.#compareDictionary.dossierTemplateId, this.#compareDictionary.type)
|
.getForType(this.#compareDictionary.dossierTemplateId, this.#compareDictionary.type)
|
||||||
.then(values => {
|
.then(values => {
|
||||||
this.#compareDictionary.setEntries([...values[DICTIONARY_TYPE_KEY_MAP[this.type]]] ?? [], this.type);
|
this.#compareDictionary.setEntries([...values[DICTIONARY_TYPE_KEY_MAP[this.type]]] ?? [], this.type);
|
||||||
this.diffEditorText = this.#toString([...(this.#compareDictionary.getEntries(this.type) as string[])]);
|
this.diffEditorText = [...(this.#compareDictionary.getEntries(this.type) as string[])].join('\n');
|
||||||
this.showDiffEditor = true;
|
this.showDiffEditor = true;
|
||||||
this._changeRef.markForCheck();
|
this._changeRef.markForCheck();
|
||||||
this._loadingService.stop();
|
this._loadingService.stop();
|
||||||
@ -296,10 +296,6 @@ export class DictionaryManagerComponent implements OnChanges, OnInit {
|
|||||||
: this.activeEntryType === DictionaryEntryTypes.FALSE_POSITIVE
|
: this.activeEntryType === DictionaryEntryTypes.FALSE_POSITIVE
|
||||||
? [...dictionary.falsePositiveEntries]
|
? [...dictionary.falsePositiveEntries]
|
||||||
: [...dictionary.falseRecommendationEntries];
|
: [...dictionary.falseRecommendationEntries];
|
||||||
return this.#toString(activeEntries);
|
return activeEntries.join('\n');
|
||||||
}
|
|
||||||
|
|
||||||
#toString(entries: string[]): string {
|
|
||||||
return entries.sort((a, b) => a.localeCompare(b)).join('\n');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user