Read only indicator

This commit is contained in:
Adina Țeudan 2022-03-01 20:41:37 +02:00
parent 6fecb84aa5
commit 0a3e56747e
3 changed files with 26 additions and 3 deletions

View File

@ -17,6 +17,11 @@
{{ activeNavItem.title | translate }}
</div>
<div *ngIf="activeNavItem.readonly" class="read-only all-caps-label primary">
<mat-icon class="mr-8" svgIcon="red:read-only"></mat-icon>
{{ 'readonly' | translate }}
</div>
<redaction-edit-dossier-general-info
*ngIf="activeNav === 'dossierInfo'"
[dossier]="dossier"

View File

@ -41,3 +41,15 @@ redaction-edit-dossier-dictionary {
.stats-subtitle {
margin-top: 6px;
}
.read-only {
display: flex;
position: absolute;
right: 32px;
top: 108px;
mat-icon {
height: 14px;
width: 14px;
}
}

View File

@ -20,13 +20,20 @@ import { dossiersServiceProvider } from '@services/entity-services/dossiers.serv
type Section = 'dossierInfo' | 'downloadPackage' | 'dossierDictionary' | 'members' | 'dossierAttributes' | 'deletedDocuments';
interface NavItem {
key: Section;
title?: string;
sideNavTitle?: string;
readonly?: boolean;
}
@Component({
templateUrl: './edit-dossier-dialog.component.html',
styleUrls: ['./edit-dossier-dialog.component.scss'],
providers: [dossiersServiceProvider],
})
export class EditDossierDialogComponent extends BaseDialogComponent implements AfterViewInit {
navItems: { key: Section; title?: string; sideNavTitle?: string; readonly?: boolean }[] = [];
navItems: NavItem[] = [];
readonly iconButtonTypes = IconButtonTypes;
activeNav: Section;
readonly dossier$: Observable<Dossier>;
@ -65,7 +72,7 @@ export class EditDossierDialogComponent extends BaseDialogComponent implements A
this.activeNav = _data.section || 'dossierInfo';
}
get activeNavItem(): { key: string; title?: string } {
get activeNavItem(): NavItem {
return this.navItems.find(item => item.key === this.activeNav);
}
@ -180,7 +187,6 @@ export class EditDossierDialogComponent extends BaseDialogComponent implements A
{
key: 'deletedDocuments',
sideNavTitle: _('edit-dossier-dialog.nav-items.deleted-documents'),
readonly: !this._permissionsService.canHardDeleteOrRestore(this._dossier),
},
];
}