mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-18 11:15:12 +00:00
fix(console): some imperfections, delete memberships from detail, role delete from table, app state (#1551)
* app state, roles, remove memberships, feature detail * chore(deps): bump tslib from 2.0.3 to 2.2.0 in /console (#1549) * fix: pass necessary webauthn data through events (#1541) * fix: pass necessary webauthn data through events (#1544) * docs: update readme (#1460) (#1545) * Update readme * Apply suggestions from code review but features Co-authored-by: Florian Forster <[email protected]> * Update README.md Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Maximilian Panne <[email protected]> Co-authored-by: Florian Forster <[email protected]> (cherry picked from commit 5c5b13cf84aca3641ec8fd43036c7ec25479d598) Co-authored-by: mffap <[email protected]> * chore(deps): bump tslib from 2.0.3 to 2.2.0 in /console Bumps [tslib](https://github.com/Microsoft/tslib) from 2.0.3 to 2.2.0. - [Release notes](https://github.com/Microsoft/tslib/releases) - [Commits](https://github.com/Microsoft/tslib/compare/2.0.3...2.2.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: mffap <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @angular/language-service from 11.2.0 to 11.2.8 in /console (#1521) * fix: pass necessary webauthn data through events (#1541) * fix: pass necessary webauthn data through events (#1544) * docs: update readme (#1460) (#1545) * Update readme * Apply suggestions from code review but features Co-authored-by: Florian Forster <[email protected]> * Update README.md Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Maximilian Panne <[email protected]> Co-authored-by: Florian Forster <[email protected]> (cherry picked from commit 5c5b13cf84aca3641ec8fd43036c7ec25479d598) Co-authored-by: mffap <[email protected]> * chore(deps-dev): bump @angular/language-service in /console Bumps [@angular/language-service](https://github.com/angular/angular/tree/HEAD/packages/language-service) from 11.2.0 to 11.2.8. - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/11.2.8/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/11.2.8/packages/language-service) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: mffap <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @angular-devkit/build-angular from 0.1102.1 to 0.1102.7 in /console (#1520) * fix: pass necessary webauthn data through events (#1541) * fix: pass necessary webauthn data through events (#1544) * docs: update readme (#1460) (#1545) * Update readme * Apply suggestions from code review but features Co-authored-by: Florian Forster <[email protected]> * Update README.md Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Maximilian Panne <[email protected]> Co-authored-by: Florian Forster <[email protected]> (cherry picked from commit 5c5b13cf84aca3641ec8fd43036c7ec25479d598) Co-authored-by: mffap <[email protected]> * chore(deps-dev): bump @angular-devkit/build-angular in /console Bumps [@angular-devkit/build-angular](https://github.com/angular/angular-cli) from 0.1102.1 to 0.1102.7. - [Release notes](https://github.com/angular/angular-cli/releases) - [Commits](https://github.com/angular/angular-cli/commits) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: mffap <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump karma from 6.1.1 to 6.3.2 in /console (#1519) * fix: pass necessary webauthn data through events (#1541) * fix: pass necessary webauthn data through events (#1544) * docs: update readme (#1460) (#1545) * Update readme * Apply suggestions from code review but features Co-authored-by: Florian Forster <[email protected]> * Update README.md Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Maximilian Panne <[email protected]> Co-authored-by: Florian Forster <[email protected]> (cherry picked from commit 5c5b13cf84aca3641ec8fd43036c7ec25479d598) Co-authored-by: mffap <[email protected]> * chore(deps-dev): bump karma from 6.1.1 to 6.3.2 in /console Bumps [karma](https://github.com/karma-runner/karma) from 6.1.1 to 6.3.2. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](https://github.com/karma-runner/karma/compare/v6.1.1...v6.3.2) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: mffap <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump google-protobuf from 3.13.0 to 3.15.7 in /console (#1518) * fix: pass necessary webauthn data through events (#1541) * fix: pass necessary webauthn data through events (#1544) * docs: update readme (#1460) (#1545) * Update readme * Apply suggestions from code review but features Co-authored-by: Florian Forster <[email protected]> * Update README.md Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Maximilian Panne <[email protected]> Co-authored-by: Florian Forster <[email protected]> (cherry picked from commit 5c5b13cf84aca3641ec8fd43036c7ec25479d598) Co-authored-by: mffap <[email protected]> * chore(deps): bump google-protobuf from 3.13.0 to 3.15.7 in /console Bumps [google-protobuf](https://github.com/protocolbuffers/protobuf) from 3.13.0 to 3.15.7. - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py) - [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.13.0...v3.15.7) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: mffap <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @angular/cli from 11.2.0 to 11.2.7 in /console (#1517) * fix: pass necessary webauthn data through events (#1541) * fix: pass necessary webauthn data through events (#1544) * docs: update readme (#1460) (#1545) * Update readme * Apply suggestions from code review but features Co-authored-by: Florian Forster <[email protected]> * Update README.md Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Maximilian Panne <[email protected]> Co-authored-by: Florian Forster <[email protected]> (cherry picked from commit 5c5b13cf84aca3641ec8fd43036c7ec25479d598) Co-authored-by: mffap <[email protected]> * chore(deps-dev): bump @angular/cli from 11.2.0 to 11.2.7 in /console Bumps [@angular/cli](https://github.com/angular/angular-cli) from 11.2.0 to 11.2.7. - [Release notes](https://github.com/angular/angular-cli/releases) - [Commits](https://github.com/angular/angular-cli/compare/v11.2.0...v11.2.7) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: mffap <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Peintner <[email protected]> * chore(deps-dev): bump @types/node from 14.14.28 to 14.14.37 in /console (#1489) * fix: pass necessary webauthn data through events (#1541) * fix: pass necessary webauthn data through events (#1544) * docs: update readme (#1460) (#1545) * Update readme * Apply suggestions from code review but features Co-authored-by: Florian Forster <[email protected]> * Update README.md Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Maximilian Panne <[email protected]> Co-authored-by: Florian Forster <[email protected]> (cherry picked from commit 5c5b13cf84aca3641ec8fd43036c7ec25479d598) Co-authored-by: mffap <[email protected]> * chore(deps-dev): bump @types/node from 14.14.28 to 14.14.37 in /console Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.28 to 14.14.37. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: mffap <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: mffap <[email protected]>
This commit is contained in:
co-authored by
Livio Amstutz
mffap
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
parent
3487a7a713
commit
e9a457ddf5
@@ -29,12 +29,12 @@
|
||||
|
||||
<ng-container matColumnDef="externalUserDisplayName">
|
||||
<th mat-header-cell *matHeaderCellDef> {{ 'USER.EXTERNALIDP.USERDISPLAYNAME' | translate }} </th>
|
||||
<td mat-cell *matCellDef="let idp"> {{idp?.externalUserDisplayName}} </td>
|
||||
<td mat-cell *matCellDef="let idp"> {{idp?.providedUserName}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="externalUserId">
|
||||
<th mat-header-cell *matHeaderCellDef> {{ 'USER.EXTERNALIDP.EXTERNALUSERID' | translate }} </th>
|
||||
<td mat-cell *matCellDef="let idp"> {{idp?.externalUserId}} </td>
|
||||
<td mat-cell *matCellDef="let idp"> {{idp?.providedUserId}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions" stickyEnd>
|
||||
|
||||
+18
-4
@@ -27,10 +27,13 @@
|
||||
<ng-container matColumnDef="memberType">
|
||||
<th mat-header-cell *matHeaderCellDef> {{ 'USER.MEMBERSHIPS.TYPE' | translate }} </th>
|
||||
<td class="pointer" mat-cell *matCellDef="let member">
|
||||
<span *ngIf="member.orgId && !member.projectGrantId && !member.projectId"> {{'USER.MEMBERSHIPS.TYPES.ORG' | translate }}</span>
|
||||
<span *ngIf="member.projectId && !member.projectGrantId"> {{'USER.MEMBERSHIPS.TYPES.PROJECT' | translate }}</span>
|
||||
<span *ngIf="member.projectId && member.projectGrantId"> {{'USER.MEMBERSHIPS.TYPES.GRANTEDPROJECT' | translate }}</span>
|
||||
</td>
|
||||
<span *ngIf="member.orgId && !member.projectGrantId && !member.projectId">
|
||||
{{'USER.MEMBERSHIPS.TYPES.ORG' | translate }}</span>
|
||||
<span *ngIf="member.projectId && !member.projectGrantId"> {{'USER.MEMBERSHIPS.TYPES.PROJECT' |
|
||||
translate }}</span>
|
||||
<span *ngIf="member.projectId && member.projectGrantId">
|
||||
{{'USER.MEMBERSHIPS.TYPES.GRANTEDPROJECT' | translate }}</span>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="displayName">
|
||||
@@ -59,6 +62,17 @@
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions" stickyEnd>
|
||||
<th mat-header-cell *matHeaderCellDef></th>
|
||||
<td mat-cell *matCellDef="let member">
|
||||
<button [disabled]="member.projectId && member.projectGrantId ? (['project.grant.member.delete:' + member.projectGrantId, 'project.grant.member.delete'] | hasRole | async) == false : member.projectId ? (['project.member.delete:' + member.projectGrantId, 'project.member.delete'] | hasRole | async) == false : member.orgId ? (['org.member.delete:' + member.orgId, 'org.member.delete'] | hasRole | async) == false : (['iam.member.delete'] | hasRole | async) == false"
|
||||
mat-icon-button color="warn" matTooltip="{{'ACTIONS.REMOVE' | translate}}"
|
||||
(click)="removeMembership(member)">
|
||||
<i class="las la-minus-circle"></i>
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr class="highlight" mat-row *matRowDef="let row; columns: displayedColumns;">
|
||||
</tr>
|
||||
|
||||
+16
@@ -34,3 +34,19 @@
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
tr {
|
||||
outline: none;
|
||||
|
||||
button {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
button {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+22
-1
@@ -30,7 +30,7 @@ export class MembershipDetailComponent implements AfterViewInit {
|
||||
public memberRoleOptions: string[] = [];
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
public displayedColumns: string[] = ['select', 'memberType', 'displayName', 'creationDate', 'changeDate', 'roles'];
|
||||
public displayedColumns: string[] = ['select', 'memberType', 'displayName', 'creationDate', 'changeDate', 'roles', 'actions'];
|
||||
|
||||
public loading: boolean = false;
|
||||
public memberships!: Membership.AsObject[];
|
||||
@@ -203,6 +203,27 @@ export class MembershipDetailComponent implements AfterViewInit {
|
||||
}
|
||||
}
|
||||
|
||||
public removeMembership(membership: Membership.AsObject): void {
|
||||
let prom;
|
||||
|
||||
if (membership.projectId && membership.projectGrantId && membership.userId) {
|
||||
prom = this.mgmtService.removeProjectGrantMember(membership.projectId, membership.projectGrantId, membership.userId);
|
||||
} else if (membership.projectId && membership.userId) {
|
||||
prom = this.mgmtService.removeProjectMember(membership.projectId, membership.userId);
|
||||
} else if (membership.orgId && membership.userId) {
|
||||
prom = this.mgmtService.removeOrgMember(membership.userId);
|
||||
} else if (membership.userId) {
|
||||
prom = this.adminService.removeIAMMember(membership.userId);
|
||||
}
|
||||
|
||||
if (prom) {
|
||||
prom.then(() => {
|
||||
this.toast.showInfo('PROJECT.TOAST.MEMBERREMOVED', true);
|
||||
this.refreshPage();
|
||||
}).catch(error => this.toast.showError(error));
|
||||
}
|
||||
}
|
||||
|
||||
public refreshPage(): void {
|
||||
this.selection.clear();
|
||||
this.dataSource.loadMemberships(this.user.id, this.paginator.pageIndex, this.paginator.pageSize);
|
||||
|
||||
@@ -12,6 +12,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
|
||||
import { RefreshTableModule } from 'src/app/modules/refresh-table/refresh-table.module';
|
||||
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
|
||||
import { LocalizedDatePipeModule } from 'src/app/pipes/localized-date-pipe/localized-date-pipe.module';
|
||||
import { TimestampToDatePipeModule } from 'src/app/pipes/timestamp-to-date-pipe/timestamp-to-date-pipe.module';
|
||||
|
||||
@@ -43,6 +44,7 @@ const routes: Routes = [
|
||||
HasRoleModule,
|
||||
MatIconModule,
|
||||
MatButtonModule,
|
||||
HasRolePipeModule,
|
||||
RefreshTableModule,
|
||||
MatTooltipModule,
|
||||
],
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
[ngStyle]="{'z-index': 100 - i}">
|
||||
<div class="membership-avatar" [ngStyle]="{'background-color': getColor(membership)}">
|
||||
<i *ngIf="membership.orgId" class="las la-archway"></i>
|
||||
<i *ngIf="membership.projectId && !membership.grantId" class="icon las la-layer-group"></i>
|
||||
<i *ngIf="membership.projectId && membership.grantId" class="icon las la-layer-group"></i>
|
||||
<i *ngIf="membership.projectId && !membership.projectGrantId" class="icon las la-layer-group"></i>
|
||||
<i *ngIf="membership.projectId && membership.projectGrantId" class="icon las la-layer-group"></i>
|
||||
|
||||
<span>{{membership.displayName}}</span>
|
||||
</div>
|
||||
@@ -25,6 +25,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<button [disabled]="disabled" class="add-img" (click)="addMember()" mat-icon-button
|
||||
matTooltip="{{'ACTIONS.ADD' | translate}}" aria-label="add membership">
|
||||
<mat-icon>add</mat-icon>
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
|
||||
<ng-template appHasRole [appHasRole]="['user.write$', 'user.write:'+user?.id]">
|
||||
<button class="state-button" mat-stroked-button color="warn"
|
||||
*ngIf="user?.state === UserState.USER_STATE_ACTIVE"
|
||||
*ngIf="user?.state !== UserState.USER_STATE_INACTIVE"
|
||||
(click)="changeState(UserState.USER_STATE_INACTIVE)">{{'USER.PAGES.DEACTIVATE' |
|
||||
translate}}</button>
|
||||
<button class="state-button" mat-stroked-button color="warn"
|
||||
*ngIf="user?.state === UserState.USER_STATE_INACTIVE"
|
||||
*ngIf="user?.state !== UserState.USER_STATE_ACTIVE"
|
||||
(click)="changeState(UserState.USER_STATE_ACTIVE)">{{'USER.PAGES.REACTIVATE' | translate}}</button>
|
||||
</ng-template>
|
||||
</div>
|
||||
|
||||
@@ -48,10 +48,10 @@
|
||||
|
||||
<ng-container matColumnDef="displayName">
|
||||
<th mat-header-cell *matHeaderCellDef
|
||||
[ngClass]="{'search-active': this.userSearchKey == UserListSearchKey.USERSEARCHKEY_DISPLAY_NAME}">
|
||||
[ngClass]="{'search-active': this.userSearchKey == UserListSearchKey.DISPLAY_NAME}">
|
||||
{{ 'USER.PROFILE.DISPLAYNAME' | translate }}
|
||||
<template [ngTemplateOutlet]="templateRef"
|
||||
[ngTemplateOutletContext]="{key: UserListSearchKey.USERSEARCHKEY_DISPLAY_NAME}"></template>
|
||||
[ngTemplateOutletContext]="{key: UserListSearchKey.DISPLAY_NAME}"></template>
|
||||
</th>
|
||||
<td mat-cell *matCellDef="let user" [routerLink]="user.id ? ['/users', user.id ]: null">
|
||||
{{user.human?.profile?.displayName}}
|
||||
|
||||
Reference in New Issue
Block a user