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

RED-7699 - Hint types in Edit Dossier effective dictionary list

Closes RED-7699

See merge request redactmanager/red-ui!132
This commit is contained in:
Dan Percic 2023-10-09 11:21:28 +02:00
commit e220c1436f
3 changed files with 5 additions and 2 deletions

View File

@ -83,6 +83,7 @@
[withFloatingActions]="false"
[selectedDictionaryType]="selectedDictionary.type"
[activeEntryType]="activeEntryType"
[hint]="selectedDictionary.hint"
></redaction-dictionary-manager>
</div>
</div>

View File

@ -80,8 +80,9 @@ export class EditDossierDictionaryComponent implements OnInit {
selectEntryType(selectedEntryType: DictionaryEntryType) {
this.activeEntryType = selectedEntryType ?? this.activeEntryType;
const entryType = this.selectedDictionary.hint ? DictionaryEntryTypes.ENTRY : this.activeEntryType;
switch (this.activeEntryType) {
switch (entryType) {
case DictionaryEntryTypes.ENTRY: {
this.entriesToDisplay = this.selectedDictionary.entries;
break;

View File

@ -44,6 +44,7 @@ export class DictionaryManagerComponent implements OnChanges {
@Input() canEdit = false;
@Input() canDownload = false;
@Input() isLeavingPage = false;
@Input() hint = false;
@Input() selectedDictionaryType = 'dossier_redaction';
@Input() activeEntryType: DictionaryEntryType = DictionaryEntryTypes.ENTRY;
@Output() readonly saveDictionary = new EventEmitter<string[]>();
@ -247,7 +248,7 @@ export class DictionaryManagerComponent implements OnChanges {
)
)[0];
const activeEntries =
this.activeEntryType === DictionaryEntryTypes.ENTRY
this.activeEntryType === DictionaryEntryTypes.ENTRY || this.hint
? [...dictionary.entries]
: this.activeEntryType === DictionaryEntryTypes.FALSE_POSITIVE
? [...dictionary.falsePositiveEntries]