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!126
This commit is contained in:
Dan Percic 2023-10-04 22:28:43 +02:00
commit 1eb4e31066
4 changed files with 19 additions and 9 deletions

View File

@ -6,7 +6,11 @@
[class.active]="dictionary.label === selectedDictionary.label"
(click)="selectDictionary(dictionary)"
>
<redaction-annotation-icon [color]="dictionary.hexColor" label="R" type="square"></redaction-annotation-icon>
<redaction-annotation-icon
[color]="dictionary.hexColor"
[label]="dictionary.hint ? 'H' : 'R'"
type="square"
></redaction-annotation-icon>
<div class="details">
<span> {{ dictionary.label }} </span>
<div class="small-label stats-subtitle">
@ -34,25 +38,27 @@
<div>
<mat-icon svgIcon="red:entries"></mat-icon>
<ng-container *ngIf="activeEntryType === entryTypes.ENTRY">
{{ 'edit-dossier-dialog.dictionary.entries' | translate : { length: entriesToDisplay.length } }}
{{
'edit-dossier-dialog.dictionary.entries'
| translate: { length: entriesToDisplay.length, hint: selectedDictionary.hint }
}}
</ng-container>
<ng-container *ngIf="activeEntryType === entryTypes.FALSE_POSITIVE">
{{
'edit-dossier-dialog.dictionary.false-positive-entries'
| translate : { length: entriesToDisplay.length }
'edit-dossier-dialog.dictionary.false-positive-entries' | translate: { length: entriesToDisplay.length }
}}
</ng-container>
<ng-container *ngIf="activeEntryType === entryTypes.FALSE_RECOMMENDATION">
{{
'edit-dossier-dialog.dictionary.false-recommendation-entries'
| translate : { length: entriesToDisplay.length }
| translate: { length: entriesToDisplay.length }
}}
</ng-container>
</div>
</div>
</div>
</div>
<div class="header-right flex" [class.read-only]="!canEdit">
<div class="header-right flex" [class.read-only]="!canEdit" *ngIf="!selectedDictionary.hint">
<iqser-icon-button
[label]="'edit-dossier-dialog.dictionary.to-redact' | translate"
[active]="activeEntryType === entryTypes.ENTRY"

View File

@ -101,13 +101,17 @@ export class EditDossierDictionaryComponent implements OnInit {
async #updateDossierDictionary() {
const { dossierId, dossierTemplateId } = this.dossier;
let dictionaryTypes = this._dictionaryService.getRedactTextDictionaries(dossierTemplateId, true).map(d => d.type);
let dictionaryTypes = [
...this._dictionaryService.getRedactTextDictionaries(dossierTemplateId, true),
...this._dictionaryService.getAddHintDictionaries(dossierTemplateId, false, true),
].map(d => d.type);
dictionaryTypes = [...new Set(dictionaryTypes)];
this.dictionaries = await firstValueFrom(
this._dictionaryService.loadDictionaryEntriesByType(dictionaryTypes, dossierTemplateId, dossierId),
);
//TODO remove this when backend will send also the type
this.#setType(dictionaryTypes);
this.dictionaries = this.dictionaries.sort((a, b) => a.label.localeCompare(b.label));
let dictionaryToSelect = this.dictionaries[0];
if (this.selectedDictionary) {
dictionaryToSelect = this.dictionaries.find(d => d.type === this.selectedDictionary.type);

View File

@ -1187,7 +1187,7 @@
"change-successful": "Dossier {dossierName} was updated.",
"delete-successful": "Dossier {dossierName} was deleted.",
"dictionary": {
"entries": "{length} {length, plural, one{entry} other{entries}} to redact",
"entries": "{length} {length, plural, one{entry} other{entries}} to {hint, select, true{annotate} other{redact}}",
"false-positive-entries": "{length} false positive {length, plural, one{entry} other{entries}}",
"false-positives": "False Positives",
"false-recommendation-entries": "{length} false recommendation {length, plural, one{entry} other{entries}}",

View File

@ -1187,7 +1187,7 @@
"change-successful": "Dossier {dossierName} was updated.",
"delete-successful": "Dossier {dossierName} was deleted.",
"dictionary": {
"entries": "{length} {length, plural, one{entry} other{entries}} to redact",
"entries": "{length} {length, plural, one{entry} other{entries}} to {hint, select, true{annotate} other{redact}}",
"false-positive-entries": "{length} false positive {length, plural, one{entry} other{entries}}",
"false-positives": "False Positives",
"false-recommendation-entries": "{length} false recommendation {length, plural, one{entry} other{entries}}",