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() { get isSuperTypeBasedColor() {
return this.isSuggestion || this.isDeclinedSuggestion || this.isIgnoredHint; return this.isSuggestion || this.isDeclinedSuggestion;
} }
get isSkipped() { get isSkipped() {

View File

@ -13,7 +13,7 @@
<div class="row mt-14"> <div class="row mt-14">
<div *ngFor="let color of colors" class="iqser-input-group required"> <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 <input
[formControlName]="color.controlName" [formControlName]="color.controlName"
[name]="color.controlName" [name]="color.controlName"

View File

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

View File

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

View File

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

View File

@ -86,7 +86,7 @@
"form": { "form": {
"add-to-dictionary-action": "Enable 'Add to dictionary'", "add-to-dictionary-action": "Enable 'Add to dictionary'",
"case-sensitive": "Case Sensitive", "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": "#", "color-placeholder": "#",
"default-reason": "Default Reason", "default-reason": "Default Reason",
"default-reason-placeholder": "No Default Reason", "default-reason-placeholder": "No Default Reason",
@ -98,11 +98,7 @@
"name-placeholder": "Enter Name", "name-placeholder": "Enter Name",
"rank": "Rank", "rank": "Rank",
"rank-placeholder": "1000", "rank-placeholder": "1000",
"recommendation-color": "Recommendation Hex Color",
"recommendation-color-placeholder": "#",
"redaction": "Redaction", "redaction": "Redaction",
"skipped-color": "Skipped Hex Color",
"skipped-color-placeholder": "#",
"technical-name": "Technical Name", "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{}}" "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{}}"
}, },