RED-5445 - checked user permission to edit a file atribute
This commit is contained in:
parent
8a28cb5129
commit
8ead0c79de
@ -4,6 +4,7 @@
|
||||
<span class="clamp-3"> {{ fileAttributeValue ? (fileAttributeValue | date : 'd MMM yyyy') : '-' }}</span>
|
||||
</ng-template>
|
||||
<iqser-circle-button
|
||||
*ngIf="permissionsService.canEditFileAttributes(file, dossier)"
|
||||
(action)="editFileAttribute($event)"
|
||||
[icon]="'iqser:edit'"
|
||||
[disabled]="!fileAttribute.editable"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { File, FileAttributeConfigTypes, IFileAttributeConfig } from '@red/domain';
|
||||
import { Dossier, File, FileAttributeConfigTypes, IFileAttributeConfig } from '@red/domain';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import {
|
||||
EditFileAttributeValueData,
|
||||
@ -8,9 +8,10 @@ import {
|
||||
import { defaultDialogConfig, Toaster } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-file-attribute [fileAttribute] [file]',
|
||||
selector: 'redaction-file-attribute [fileAttribute] [file] [dossier]',
|
||||
templateUrl: './file-attribute.component.html',
|
||||
styleUrls: ['./file-attribute.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
@ -18,9 +19,11 @@ import { firstValueFrom } from 'rxjs';
|
||||
export class FileAttributeComponent {
|
||||
@Input() fileAttribute!: IFileAttributeConfig;
|
||||
|
||||
@Input() file: File;
|
||||
@Input() file!: File;
|
||||
|
||||
constructor(private readonly _dialog: MatDialog, private readonly _toaster: Toaster) {}
|
||||
@Input() dossier!: Dossier;
|
||||
|
||||
constructor(private readonly _dialog: MatDialog, private readonly _toaster: Toaster, readonly permissionsService: PermissionsService) {}
|
||||
|
||||
get isDate(): boolean {
|
||||
return this.fileAttribute.type === FileAttributeConfigTypes.DATE;
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
</div>
|
||||
|
||||
<div *ngFor="let config of displayedAttributes" class="cell editable">
|
||||
<redaction-file-attribute [file]="file" [fileAttribute]="config"></redaction-file-attribute>
|
||||
<redaction-file-attribute [file]="file" [dossier]="dossier" [fileAttribute]="config"></redaction-file-attribute>
|
||||
</div>
|
||||
|
||||
<!-- always show A for error-->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user