Removed unused role creator

This commit is contained in:
George Kalampokis 2020-02-18 18:41:56 +02:00
parent 95d1da10bb
commit d9b53f6056
1 changed files with 16 additions and 22 deletions

View File

@ -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,14 +244,11 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
}
});
}
switch (role) {
case Role.Creator:
return this.translate.instant('DMP-LISTING.CREATOR');
case Role.Owner:
if (role === Role.Owner) {
return this.translate.instant('DMP-LISTING.OWNER');
case Role.Member:
} else if (role === Role.Member) {
return this.translate.instant('DMP-LISTING.MEMBER');
default:
} else {
return this.translate.instant('DMP-LISTING.OWNER');
}
}
@ -270,14 +267,11 @@ 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:
if (value.role === Role.Owner) {
return this.translate.instant('DMP-LISTING.OWNER');
case Role.Member:
} else if (value.role === Role.Member) {
return this.translate.instant('DMP-LISTING.MEMBER');
default:
} else {
return this.translate.instant('DMP-LISTING.OWNER');
}
}