fix(console): granted project member actions (create, update, delete) (#438)

* project grant members abst

* ref name from both project types
This commit is contained in:
Max Peintner
2020-07-09 18:02:05 +02:00
committed by GitHub
parent da113ffb95
commit 4fa68ae2ee
10 changed files with 159 additions and 125 deletions

View File

@@ -33,9 +33,9 @@
<mat-tab-group mat-stretch-tabs class="tab-group" disablePagination="true">
<mat-tab label="Details">
<app-project-contributors *ngIf="project"
<app-project-contributors *ngIf="project && grantId"
[disabled]="project?.state !== ProjectState.PROJECTSTATE_ACTIVE"
[projectType]="ProjectType.PROJECTTYPE_GRANTED" [project]="project">
[projectType]="ProjectType.PROJECTTYPE_GRANTED" [project]="project" [grantId]="grantId">
</app-project-contributors>
</mat-tab>
<mat-tab label="{{ 'CHANGES.PROJECT.TITLE' | translate }}" class="flex-col">

View File

@@ -22,7 +22,7 @@ const routes: Routes = [
},
},
{
path: ':projectid/members',
path: ':projectid/grant/:grantid/members',
data: {
type: ProjectType.PROJECTTYPE_GRANTED,
},

View File

@@ -126,19 +126,19 @@ export class ProjectGrantMembersComponent implements AfterViewInit, OnInit {
dialogRef.afterClosed().subscribe((dataToAdd: ProjectGrantMembersCreateDialogExportType) => {
if (dataToAdd) {
dataToAdd.userIds.forEach((userid: string) => {
this.projectService.AddProjectGrantMember(
Promise.all(dataToAdd.userIds.map((userid: string) => {
return this.projectService.AddProjectGrantMember(
this.projectId,
this.grantId,
userid,
dataToAdd.rolesKeyList,
).then(() => {
this.toast.showInfo('Project Grant Member successfully added!');
}).catch(error => {
this.toast.showError(error);
});
);
})).then(() => {
console.log('this');
this.toast.showInfo('Project Grant Member successfully added!');
}).catch(error => {
this.toast.showError(error);
});
}
});
}