RED-7790: Added tooltip and a fix

This commit is contained in:
Adina Țeudan 2023-10-19 22:27:16 +03:00
parent 3356cbe4e0
commit c7e284e649
2 changed files with 8 additions and 5 deletions

View File

@ -6,7 +6,7 @@
class="file-attribute"
>
<div [ngClass]="{ 'workflow-value': mode === 'workflow' }" class="value">
<mat-icon *ngIf="!fileAttribute.editable" svgIcon="red:read-only"></mat-icon>
<mat-icon *ngIf="!fileAttribute.editable" [matTooltip]="'readonly' | translate" svgIcon="red:read-only"></mat-icon>
<div>
<b *ngIf="mode === 'workflow' && !isInEditMode"> {{ fileAttribute.label }}: </b>
<span

View File

@ -22,9 +22,10 @@ import { Debounce } from '@iqser/common-ui/lib/utils';
import { AsyncPipe, DatePipe, NgClass, NgIf, NgTemplateOutlet } from '@angular/common';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatIconModule } from '@angular/material/icon';
import { TranslateModule } from '@ngx-translate/core';
@Component({
selector: 'redaction-file-attribute [fileAttribute] [file] [dossier]',
selector: 'redaction-file-attribute',
templateUrl: './file-attribute.component.html',
styleUrls: ['./file-attribute.component.scss'],
standalone: true,
@ -40,14 +41,15 @@ import { MatIconModule } from '@angular/material/icon';
DynamicInputComponent,
CircleButtonComponent,
NgTemplateOutlet,
TranslateModule,
],
})
export class FileAttributeComponent extends BaseFormComponent implements OnDestroy {
isInEditMode = false;
closedDatepicker = true;
@Input() fileAttribute!: IFileAttributeConfig;
@Input() file!: File;
@Input() dossier!: Dossier;
@Input({ required: true }) fileAttribute!: IFileAttributeConfig;
@Input({ required: true }) file!: File;
@Input({ required: true }) dossier!: Dossier;
@Input() fileNameColumn = false;
readonlyAttrs: string[] = [];
readonly #subscriptions = new Subscription();
@ -133,6 +135,7 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
if (
!this.file.isInitialProcessing &&
this.permissionsService.canEditFileAttributes(this.file, this.dossier) &&
this.fileAttribute.editable &&
!this.isInEditMode
) {
$event.stopPropagation();