RED-5259 - Mouse cursor should not switch to "pointer" for read-only fields

This commit is contained in:
Valentin Mihai 2022-09-22 15:02:19 +03:00
parent ade884af96
commit f16b85df5b
2 changed files with 15 additions and 8 deletions

View File

@ -24,9 +24,10 @@
<div
(colorPickerChange)="form.get(color.controlName).setValue($event)"
[colorPicker]="form.get(color.controlName).value"
[cpDisabled]="form.get(color.controlName).disabled"
[cpDisabled]="cpDisabled(color)"
[cpOutputFormat]="'hex'"
[style.background]="form.get(color.controlName).value"
[style.cursor]="cpDisabled(color) ? 'default' : 'pointer'"
class="input-icon"
>
<mat-icon *ngIf="color.hasColor$ | async" svgIcon="red:color-picker"></mat-icon>

View File

@ -12,6 +12,14 @@ import { BaseFormComponent, LoadingService, Toaster } from '@iqser/common-ui';
const REDACTION_FIELDS = ['defaultReason'];
interface Color {
label: string;
placeholder: string;
controlName: string;
hasColor$: Observable<boolean>;
labelParams: () => Record<string, string>;
}
@Component({
selector: 'redaction-add-edit-entity [entity] [dossierTemplateId] [readOnly]',
templateUrl: './add-edit-entity.component.html',
@ -26,13 +34,7 @@ export class AddEditEntityComponent extends BaseFormComponent implements OnInit
technicalName$: Observable<string>;
colors: {
label: string;
placeholder: string;
controlName: string;
hasColor$: Observable<boolean>;
labelParams: () => Record<string, string>;
}[];
colors: Color[];
constructor(
private readonly _dictionariesMapService: DictionariesMapService,
@ -46,6 +48,10 @@ export class AddEditEntityComponent extends BaseFormComponent implements OnInit
super();
}
cpDisabled(color: Color) {
return this.form.get(color.controlName).disabled;
}
get #isDossierRedaction(): boolean {
return this.entity?.type === 'dossier_redaction';
}