diff --git a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts index 8982b0a09..8adfdd502 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts +++ b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts @@ -15,7 +15,6 @@ import { EditDossierSaveResult } from '../edit-dossier-section.interface'; styleUrls: ['./edit-dossier-dictionary.component.scss'], }) export class EditDossierDictionaryComponent implements OnInit { - @ViewChild(DictionaryManagerComponent, { static: false }) private readonly _dictionaryManager: DictionaryManagerComponent; @Input() dossier: Dossier; canEdit = false; dictionaries: Dictionary[]; @@ -23,13 +22,7 @@ export class EditDossierDictionaryComponent implements OnInit { activeEntryType = DictionaryEntryTypes.ENTRY; entriesToDisplay: List = []; readonly entryTypes = DictionaryEntryTypes; - - constructor( - private readonly _dictionaryService: DictionaryService, - private readonly _permissionsService: PermissionsService, - private readonly _loadingService: LoadingService, - private readonly _dialogService: DossiersDialogService, - ) {} + @ViewChild(DictionaryManagerComponent, { static: false }) private readonly _dictionaryManager: DictionaryManagerComponent; get changed(): boolean { return this._dictionaryManager?.editor.hasChanges; @@ -43,6 +36,13 @@ export class EditDossierDictionaryComponent implements OnInit { return this._dictionaryManager?.editor.hasChanges; } + constructor( + private readonly _dictionaryService: DictionaryService, + private readonly _permissionsService: PermissionsService, + private readonly _loadingService: LoadingService, + private readonly _dialogService: DossiersDialogService, + ) {} + async ngOnInit() { this._loadingService.start(); this.canEdit = this._permissionsService.canEditDossierDictionary(this.dossier); @@ -96,8 +96,6 @@ export class EditDossierDictionaryComponent implements OnInit { break; } } - - this.entriesToDisplay = this.#toString([...this.entriesToDisplay]); } async #updateDossierDictionary() { @@ -128,8 +126,4 @@ export class EditDossierDictionaryComponent implements OnInit { this.dictionaries[i] = dictionaryWithType as Dictionary; } } - - #toString(entries: string[]) { - return entries.sort((a, b) => a.localeCompare(b)); - } }