feat(console): granted project detail (#203)

* granted project detail

* support for grantedProjects

* getGrantedProjectGrantByIDs

* fix grant members bindings

* seperate granted from owned project detail

* lint

* dont show apps on granted projects
This commit is contained in:
Max Peintner
2020-06-10 15:52:56 +02:00
committed by GitHub
parent 9965beee9c
commit a35afd2b88
23 changed files with 2404 additions and 1773 deletions
+27 -13
View File
@@ -10,6 +10,7 @@ import {
ApplicationSearchRequest,
ApplicationSearchResponse,
ApplicationUpdate,
GrantedProject,
GrantedProjectSearchQuery,
GrantedProjectSearchRequest,
GrantedProjectSearchResponse,
@@ -28,6 +29,7 @@ import {
ProjectGrantMemberSearchRequest,
ProjectGrantSearchRequest,
ProjectGrantSearchResponse,
ProjectGrantUpdate,
ProjectID,
ProjectMemberAdd,
ProjectMemberChange,
@@ -111,7 +113,7 @@ export class ProjectService {
);
}
public async GetGrantedProjectGrantByID(projectId: string, id: string): Promise<ProjectGrant> {
public async GetGrantedProjectGrantByID(projectId: string, id: string): Promise<GrantedProject> {
const req = new ProjectGrantID();
req.setId(id);
req.setProjectId(projectId);
@@ -143,6 +145,18 @@ export class ProjectService {
);
}
public async UpdateProjectGrant(id: string, projectId: string, rolesList: string[]): Promise<ProjectGrant> {
const req = new ProjectGrantUpdate();
req.setRoleKeysList(rolesList);
req.setId(id);
req.setProjectId(projectId);
return await this.request(
c => c.updateProjectGrant,
req,
f => f,
);
}
public async ChangeProjectMember(id: string, userId: string, rolesList: string[]): Promise<Empty> {
const req = new ProjectMemberChange();
req.setId(id);
@@ -196,6 +210,18 @@ export class ProjectService {
);
}
public async AddProjectMember(projectId: string, userId: string, rolesList: string[]): Promise<Empty> {
const req = new ProjectMemberAdd();
req.setId(projectId);
req.setUserId(userId);
req.setRolesList(rolesList);
return await this.request(
c => c.addProjectMember,
req,
f => f,
);
}
public async AddProjectGrantMember(
projectId: string,
grantId: string,
@@ -499,16 +525,4 @@ export class ProjectService {
f => f,
);
}
public async AddProjectMember(projectId: string, userId: string, rolesList: string[]): Promise<Empty> {
const req = new ProjectMemberAdd();
req.setId(projectId);
req.setUserId(userId);
req.setRolesList(rolesList);
return await this.request(
c => c.addProjectMember,
req,
f => f,
);
}
}