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
+6 -9
View File
@@ -61,13 +61,12 @@ export class OrgService {
);
}
public async SearchOrgMembers(orgId: string, limit: number, offset: number): Promise<OrgMemberSearchResponse> {
public async SearchMyOrgMembers(limit: number, offset: number): Promise<OrgMemberSearchResponse> {
const req = new OrgMemberSearchRequest();
req.setOrgId(orgId);
req.setLimit(limit);
req.setOffset(offset);
return await this.request(
c => c.searchOrgMembers,
c => c.searchMyOrgMembers,
req,
f => f,
);
@@ -83,26 +82,24 @@ export class OrgService {
);
}
public async AddOrgMember(orgId: string, userId: string, rolesList: string[]): Promise<Empty> {
public async AddMyOrgMember(userId: string, rolesList: string[]): Promise<Empty> {
const req = new AddOrgMemberRequest();
req.setOrgId(orgId);
req.setUserId(userId);
if (rolesList) {
req.setRolesList(rolesList);
}
return await this.request(
c => c.addOrgMember,
c => c.addMyOrgMember,
req,
f => f,
);
}
public async RemoveOrgMember(orgId: string, userId: string): Promise<Empty> {
public async RemoveMyOrgMember(userId: string): Promise<Empty> {
const req = new RemoveOrgMemberRequest();
req.setOrgId(orgId);
req.setUserId(userId);
return await this.request(
c => c.removeOrgMember,
c => c.removeMyOrgMember,
req,
f => f,
);
+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,
);
}
}