Hides DMP properties that shouldn't be visible on "DMP overview" view.
This commit is contained in:
parent
bc0fd36722
commit
6eaff65ea8
|
@ -17,7 +17,7 @@
|
||||||
<button mat-menu-item (click)="viewVersions(dmp.groupId, dmp.label)">
|
<button mat-menu-item (click)="viewVersions(dmp.groupId, dmp.label)">
|
||||||
<mat-icon>library_books</mat-icon>{{'DMP-LISTING.ACTIONS.VIEW-VERSION' | translate}}
|
<mat-icon>library_books</mat-icon>{{'DMP-LISTING.ACTIONS.VIEW-VERSION' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="cloneClicked(dmp)" class="menu-item">
|
<button *ngIf="isAuthenticated()" mat-menu-item (click)="cloneClicked(dmp)" class="menu-item">
|
||||||
<mat-icon>add</mat-icon>{{ 'DMP-LISTING.ACTIONS.CLONE' | translate }}
|
<mat-icon>add</mat-icon>{{ 'DMP-LISTING.ACTIONS.CLONE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item *ngIf="isDraftDmp(dmp) && isUserOwner" (click)="deleteClicked()" class="menu-item">
|
<button mat-menu-item *ngIf="isDraftDmp(dmp) && isUserOwner" (click)="deleteClicked()" class="menu-item">
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
<p>{{ dmp.description }}</p>
|
<p>{{ dmp.description }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 d-flex flex-row flex-wrap ml-3">
|
<div class="col-12 d-flex flex-row flex-wrap ml-3">
|
||||||
<div class="d-flex">
|
<div *ngIf="isUserDMPRelated()" class="d-flex">
|
||||||
<mat-icon matTooltip="{{'DMP-OVERVIEW.TOOLTIP.LEVEL-OF-ACCESS' | translate}}" class="gray-icon pt-2">settings</mat-icon>
|
<mat-icon matTooltip="{{'DMP-OVERVIEW.TOOLTIP.LEVEL-OF-ACCESS' | translate}}" class="gray-icon pt-2">settings</mat-icon>
|
||||||
<p class="mt-2 ml-1 mr-3 p-1">{{ roleDisplayFromList(dmp.users) }}</p>
|
<p class="mt-2 ml-1 mr-3 p-1">{{ roleDisplayFromList(dmp.users) }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -238,6 +238,19 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isUserDMPRelated() {
|
||||||
|
const principal: Principal = this.authentication.current();
|
||||||
|
let isRelated: boolean = false;
|
||||||
|
if (this.dmp && principal) {
|
||||||
|
this.dmp.users.forEach(element => {
|
||||||
|
if (element.id === principal.id) {
|
||||||
|
isRelated = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return isRelated;
|
||||||
|
}
|
||||||
|
|
||||||
roleDisplay(value: UserInfoListingModel) {
|
roleDisplay(value: UserInfoListingModel) {
|
||||||
if (value.role === Role.Member) {
|
if (value.role === Role.Member) {
|
||||||
return this.translate.instant('DMP-LISTING.MEMBER');
|
return this.translate.instant('DMP-LISTING.MEMBER');
|
||||||
|
@ -374,6 +387,10 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } });
|
this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isAuthenticated(): boolean {
|
||||||
|
return !(!this.authentication.current());
|
||||||
|
}
|
||||||
|
|
||||||
// advancedClicked() {
|
// advancedClicked() {
|
||||||
// const dialogRef = this.dialog.open(ExportMethodDialogComponent, {
|
// const dialogRef = this.dialog.open(ExportMethodDialogComponent, {
|
||||||
// maxWidth: '500px',
|
// maxWidth: '500px',
|
||||||
|
|
Loading…
Reference in New Issue