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