Fixes not showing "New Version" option on DMP overview action menu.
This commit is contained in:
parent
493ab9763e
commit
3da0cc9ad4
|
@ -11,7 +11,7 @@
|
||||||
<mat-icon class="more-horiz">more_horiz</mat-icon>
|
<mat-icon class="more-horiz">more_horiz</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #actionsMenu="matMenu" xPosition="before">
|
<mat-menu #actionsMenu="matMenu" xPosition="before">
|
||||||
<button *ngIf="!this.isPublicView && isUserOwner" mat-menu-item (click)="newVersion(dmp.id, dmp.label)">
|
<button *ngIf="isUserOwner" mat-menu-item (click)="newVersion(dmp.id, dmp.label)">
|
||||||
<mat-icon>queue</mat-icon>{{'DMP-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
<mat-icon>queue</mat-icon>{{'DMP-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="viewVersions(dmp.groupId, dmp.label)">
|
<button mat-menu-item (click)="viewVersions(dmp.groupId, dmp.label)">
|
||||||
|
|
|
@ -79,6 +79,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.dmp = data;
|
this.dmp = data;
|
||||||
|
this.setIsUserOwner();
|
||||||
const breadCrumbs = [];
|
const breadCrumbs = [];
|
||||||
breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC-DMPS'), url: "/explore-plans" });
|
breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC-DMPS'), url: "/explore-plans" });
|
||||||
breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/publicOverview/' + this.dmp.id });
|
breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/publicOverview/' + this.dmp.id });
|
||||||
|
@ -91,7 +92,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
setIsUserOwner() {
|
setIsUserOwner() {
|
||||||
if (this.dmp) {
|
if (this.dmp) {
|
||||||
const principal: Principal = this.authentication.current();
|
const principal: Principal = this.authentication.current();
|
||||||
this.isUserOwner = principal.id === this.dmp.users.find(x => x.role === Role.Owner).id;
|
if (principal) this.isUserOwner = principal.id === this.dmp.users.find(x => x.role === Role.Owner).id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue