From b9e43535a944a31fb6f2be7deac058159244ad81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 7 Nov 2023 16:27:56 +0200 Subject: [PATCH] RED-7890: Remove dict items sorting from UI --- .../dictionary/dictionary-screen.component.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/entities/screens/dictionary/dictionary-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/entities/screens/dictionary/dictionary-screen.component.ts index c7cbd599b..ecbec474f 100644 --- a/apps/red-ui/src/app/modules/admin/screens/entities/screens/dictionary/dictionary-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/entities/screens/dictionary/dictionary-screen.component.ts @@ -17,15 +17,19 @@ import { getParam, List } from '@iqser/common-ui/lib/utils'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class DictionaryScreenComponent implements OnInit { - readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID); - @ViewChild('dictionaryManager', { static: false }) - private readonly _dictionaryManager: DictionaryManagerComponent; readonly currentUser = getCurrentUser(); readonly roles = Roles; - readonly initialEntries$ = new BehaviorSubject([]); + readonly initialEntries$ = new BehaviorSubject([]); isLeavingPage = false; readonly type: DictionaryType; readonly entityType = getParam(ENTITY_TYPE); + readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID); + @ViewChild('dictionaryManager', { static: false }) + private readonly _dictionaryManager: DictionaryManagerComponent; + + get changed() { + return this._dictionaryManager.editor.hasChanges; + } constructor( route: ActivatedRoute, @@ -38,10 +42,6 @@ export class DictionaryScreenComponent implements OnInit { this.type = route.snapshot.routeConfig.path as DictionaryType; } - get changed() { - return this._dictionaryManager.editor.hasChanges; - } - async ngOnInit() { await this.#loadEntries(); } @@ -72,7 +72,7 @@ export class DictionaryScreenComponent implements OnInit { try { const data = await this._dictionaryService.getForType(this.#dossierTemplateId, this.entityType); const entries: List = data[DICTIONARY_TYPE_KEY_MAP[this.type]]; - this.initialEntries$.next([...entries].sort((str1, str2) => str1.localeCompare(str2, undefined, { sensitivity: 'accent' }))); + this.initialEntries$.next(entries); } catch (e) { this.initialEntries$.next([]); } finally {