Merge branch 'VM/RED-7887' into 'master'

RED-7887 - UI saves the last saved dictionary in compare and no longer updates...

Closes RED-7887

See merge request redactmanager/red-ui!183
This commit is contained in:
Dan Percic 2023-11-13 15:31:23 +01:00
commit 0be1856449
2 changed files with 10 additions and 5 deletions

View File

@ -85,6 +85,7 @@
[activeEntryType]="activeEntryType"
[hint]="selectedDictionary.hint"
[currentDossierId]="dossier.dossierId"
[currentDossierTemplateId]="dossier.dossierTemplateId"
></redaction-dictionary-manager>
</div>
</div>

View File

@ -1,4 +1,4 @@
import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
import { IconButtonTypes, LoadingService } from '@iqser/common-ui';
import {
Dictionary,
@ -34,12 +34,13 @@ const HELP_MODE_KEYS = {
templateUrl: './dictionary-manager.component.html',
styleUrls: ['./dictionary-manager.component.scss'],
})
export class DictionaryManagerComponent implements OnChanges {
export class DictionaryManagerComponent implements OnChanges, OnInit {
private _searchDecorations: string[] = [];
readonly #currentTab = window.location.href.split('/').pop();
@Input() type: DictionaryType = 'dictionary';
@Input() entityType?: string;
@Input() currentDossierId: string;
@Input() currentDossierTemplateId: string;
@Input() withFloatingActions = true;
@Input() filterByDossierTemplate = false;
@Input() initialEntries: List;
@ -72,15 +73,18 @@ export class DictionaryManagerComponent implements OnChanges {
private readonly _dictionariesMapService: DictionariesMapService,
protected readonly _loadingService: LoadingService,
private readonly _changeRef: ChangeDetectorRef,
readonly activeDossiersService: ActiveDossiersService,
private readonly _activeDossiersService: ActiveDossiersService,
readonly dossierTemplatesService: DossierTemplatesService,
) {
this.dossiers = activeDossiersService.all;
this.dossiers = _activeDossiersService.all;
}
ngOnInit() {
const templateDictionary = {
id: 'template',
dossierId: 'template',
dossierName: 'Template Dictionary',
dossierTemplateId: this.dossiers[0]?.dossierTemplateId,
dossierTemplateId: this.currentDossierTemplateId,
} as Dossier;
this.dossiers.push(templateDictionary);
}