Removed unused role creator
This commit is contained in:
parent
95d1da10bb
commit
d9b53f6056
|
@ -65,7 +65,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.dmp = data;
|
||||
this.setIsUserOwnerOrCreator();
|
||||
this.setIsUserOwner();
|
||||
const breadCrumbs = [];
|
||||
breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DMPS'), url: "/plans" });
|
||||
breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/overview/' + this.dmp.id });
|
||||
|
@ -84,7 +84,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.dmp = data;
|
||||
this.setIsUserOwnerOrCreator();
|
||||
this.setIsUserOwner();
|
||||
const breadCrumbs = [];
|
||||
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 });
|
||||
|
@ -103,10 +103,10 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
this.router.navigate([redirectRoot]);
|
||||
}
|
||||
|
||||
setIsUserOwnerOrCreator() {
|
||||
setIsUserOwner() {
|
||||
if (this.dmp) {
|
||||
const principal: Principal = this.authentication.current();
|
||||
if (principal) this.isUserOwner = principal.id === this.dmp.users.find(x => x.role === Role.Owner || x.role === Role.Creator).id;
|
||||
if (principal) this.isUserOwner = principal.id === this.dmp.users.find(x => x.role === Role.Owner).id;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -244,15 +244,12 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
}
|
||||
});
|
||||
}
|
||||
switch (role) {
|
||||
case Role.Creator:
|
||||
return this.translate.instant('DMP-LISTING.CREATOR');
|
||||
case Role.Owner:
|
||||
return this.translate.instant('DMP-LISTING.OWNER');
|
||||
case Role.Member:
|
||||
return this.translate.instant('DMP-LISTING.MEMBER');
|
||||
default:
|
||||
return this.translate.instant('DMP-LISTING.OWNER');
|
||||
if (role === Role.Owner) {
|
||||
return this.translate.instant('DMP-LISTING.OWNER');
|
||||
} else if (role === Role.Member) {
|
||||
return this.translate.instant('DMP-LISTING.MEMBER');
|
||||
} else {
|
||||
return this.translate.instant('DMP-LISTING.OWNER');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,15 +267,12 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
}
|
||||
|
||||
roleDisplay(value: UserInfoListingModel) {
|
||||
switch (value.role) {
|
||||
case Role.Creator:
|
||||
return this.translate.instant('DMP-LISTING.CREATOR');
|
||||
case Role.Owner:
|
||||
return this.translate.instant('DMP-LISTING.OWNER');
|
||||
case Role.Member:
|
||||
return this.translate.instant('DMP-LISTING.MEMBER');
|
||||
default:
|
||||
return this.translate.instant('DMP-LISTING.OWNER');
|
||||
if (value.role === Role.Owner) {
|
||||
return this.translate.instant('DMP-LISTING.OWNER');
|
||||
} else if (value.role === Role.Member) {
|
||||
return this.translate.instant('DMP-LISTING.MEMBER');
|
||||
} else {
|
||||
return this.translate.instant('DMP-LISTING.OWNER');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue