diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts index 22a2b8d8b..55a0ad55a 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts @@ -143,7 +143,7 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { this._dictionariesMapService.get(this.#compareDictionary.dossierTemplateId, this.#compareDictionary.type).getEntries(this.type); if (entries.length) { - this.diffEditorText = this.#toString([...entries]); + this.diffEditorText = entries.join('\n'); this.showDiffEditor = true; return; } @@ -152,7 +152,7 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { .getForType(this.#compareDictionary.dossierTemplateId, this.#compareDictionary.type) .then(values => { 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._changeRef.markForCheck(); this._loadingService.stop(); @@ -296,10 +296,6 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { : this.activeEntryType === DictionaryEntryTypes.FALSE_POSITIVE ? [...dictionary.falsePositiveEntries] : [...dictionary.falseRecommendationEntries]; - return this.#toString(activeEntries); - } - - #toString(entries: string[]): string { - return entries.sort((a, b) => a.localeCompare(b)).join('\n'); + return activeEntries.join('\n'); } }