RED-4416: Ignored hints color

This commit is contained in:
Adina Țeudan 2022-07-04 14:23:54 +03:00
parent 7ee0dde7d8
commit 4acab8a05b
6 changed files with 25 additions and 15 deletions

View File

@ -88,7 +88,7 @@ export class AnnotationWrapper implements IListable, Record<string, unknown> {
}
get isSuperTypeBasedColor() {
return this.isSuggestion || this.isDeclinedSuggestion || this.isIgnoredHint;
return this.isSuggestion || this.isDeclinedSuggestion;
}
get isSkipped() {

View File

@ -13,7 +13,7 @@
<div class="row mt-14">
<div *ngFor="let color of colors" class="iqser-input-group required">
<label [translate]="color.label"></label>
<label [translateParams]="color.labelParams()" [translate]="color.label"></label>
<input
[formControlName]="color.controlName"
[name]="color.controlName"

View File

@ -24,7 +24,13 @@ export class AddEditEntityComponent extends BaseFormComponent implements OnInit
technicalName$: Observable<string>;
colors: { label: string; placeholder: string; controlName: string; hasColor$: Observable<boolean> }[];
colors: {
label: string;
placeholder: string;
controlName: string;
hasColor$: Observable<boolean>;
labelParams: () => Record<string, string>;
}[];
constructor(
private readonly _dictionariesMapService: DictionariesMapService,
@ -46,6 +52,10 @@ export class AddEditEntityComponent extends BaseFormComponent implements OnInit
return { value: !!this.entity?.addToDictionaryAction, disabled: this.#isSystemManaged };
}
get #isHint(): boolean {
return this.form.get('hint').value;
}
revert(): void {
this.form.patchValue(this.initialFormValue);
}
@ -81,19 +91,22 @@ export class AddEditEntityComponent extends BaseFormComponent implements OnInit
this.colors = [
{
label: _('add-edit-entity.form.color'),
labelParams: () => ({ type: this.#isHint ? 'hint' : 'redaction' }),
placeholder: _('add-edit-entity.form.color-placeholder'),
controlName: 'hexColor',
hasColor$: this._colorEmpty$(form, 'hexColor'),
},
{
label: _('add-edit-entity.form.recommendation-color'),
placeholder: _('add-edit-entity.form.recommendation-color-placeholder'),
label: _('add-edit-entity.form.color'),
labelParams: () => ({ type: 'recommendation' }),
placeholder: _('add-edit-entity.form.color-placeholder'),
controlName: 'recommendationHexColor',
hasColor$: this._colorEmpty$(form, 'recommendationHexColor'),
},
{
label: _('add-edit-entity.form.skipped-color'),
placeholder: _('add-edit-entity.form.skipped-color-placeholder'),
label: _('add-edit-entity.form.color'),
labelParams: () => ({ type: this.#isHint ? 'ignored' : 'skipped' }),
placeholder: _('add-edit-entity.form.color-placeholder'),
controlName: 'skippedHexColor',
hasColor$: this._colorEmpty$(form, 'skippedHexColor'),
},
@ -192,7 +205,7 @@ export class AddEditEntityComponent extends BaseFormComponent implements OnInit
hexColor: this.form.get('hexColor').value,
recommendationHexColor: this.form.get('recommendationHexColor').value,
skippedHexColor: this.form.get('skippedHexColor').value,
hint: this.form.get('hint').value,
hint: this.#isHint,
rank: this.form.get('rank').value,
dossierTemplateId: this.dossierTemplateId,
caseInsensitive: !this.form.get('caseSensitive').value,

View File

@ -35,8 +35,8 @@ export class TypeAnnotationIconComponent implements OnChanges {
this.color = this._dictionariesMapService.getDictionaryColor(
type,
this._dossierTemplateId,
this.annotation.isRecommendation,
this.annotation.isSkipped,
isRecommendation,
isSkipped || isIgnoredHint,
);
}

View File

@ -75,6 +75,7 @@ export class AnnotationDrawService {
color = this._dictionariesMapService.getDictionaryColor(dictionary, dossierTemplateId, true);
break;
case SuperTypes.Skipped:
case SuperTypes.IgnoredHint:
color = this._dictionariesMapService.getDictionaryColor(dictionary, dossierTemplateId, false, true);
break;
default:

View File

@ -86,7 +86,7 @@
"form": {
"add-to-dictionary-action": "Enable 'Add to dictionary'",
"case-sensitive": "Case Sensitive",
"color": "Hex Color",
"color": "{type, select, redaction{Redaction} hint{Hint} recommendation{Recommendation} skipped{Skipped Redaction} ignored{Ignored Hint} other{}} Color",
"color-placeholder": "#",
"default-reason": "Default Reason",
"default-reason-placeholder": "No Default Reason",
@ -98,11 +98,7 @@
"name-placeholder": "Enter Name",
"rank": "Rank",
"rank-placeholder": "1000",
"recommendation-color": "Recommendation Hex Color",
"recommendation-color-placeholder": "#",
"redaction": "Redaction",
"skipped-color": "Skipped Hex Color",
"skipped-color-placeholder": "#",
"technical-name": "Technical Name",
"technical-name-hint": "{type, select, edit{Autogenerated based on the initial display name.} create{Autogenerates based on the display name and cannot be edited after saving.} other{}}"
},