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:
Max Peintner
2021-04-07 16:46:35 +02:00
committed by GitHub
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
26 changed files with 1194 additions and 1130 deletions
@@ -31,17 +31,6 @@
dayelement.dates[j] | timestampToDate | localizedDate: 'HH:mm'
}}</span>
</span>
<!-- <span *ngIf="histindex === 0 && i === 0 && j === 0">
<span>current file</span>
<span class="block">{{
dayelement.dates[j] | timestampToDate | localizedDate: 'HH:mm'
}}</span>
</span> -->
<!-- <button mat-icon-button disabled>
<mat-icon class="icon red" color="warn">error_outline
</mat-icon>
</button> -->
</div>
</div>
</div>
@@ -129,14 +129,15 @@
display: flex;
justify-content: center;
}
}
.end-container {
font-size: 12px;
color: var(--grey);
font-size: 14px;
margin: 1rem 0;
color: var(--grey);
}
.end-container {
font-size: 12px;
color: var(--grey);
font-size: 14px;
margin: 1rem 0 1rem 0;
display: block;
color: var(--grey);
}
}
}
@@ -1,5 +1,5 @@
<app-detail-layout [backRouterLink]="[ serviceType === FeatureServiceType.ADMIN ? '/iam/policies' : '/org']"
[title]="'FEATURES.TITLE' | translate" [description]="'FEATURES.DESCRIPTION' | translate">
[title]="'ZITADEL ' +features?.tier.name + ' ' + ('FEATURES.TITLE' | translate)" [description]="'FEATURES.DESCRIPTION' | translate">
<p class="default" *ngIf="isDefault"> {{'POLICY.DEFAULTLABEL' | translate}}</p>
<ng-template appHasRole [appHasRole]="['iam.features.delete']">
@@ -14,7 +14,7 @@
<div class="row">
<span class="left-desc">{{'FEATURES.DATA.AUDITLOGRETENTION' | translate}}</span>
<span class="fill-space"></span>
<span>{{features.auditLogRetention | json }}</span>
<span>{{features.auditLogRetention | timestampToRetention }} {{'FEATURES.RETENTIONHOURS' | translate}}</span>
</div>
<div class="row">
<span class="left-desc">{{'FEATURES.DATA.LOGINPOLICYUSERNAMELOGIN' | translate}}</span>
@@ -10,6 +10,9 @@ import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
import { InputModule } from 'src/app/modules/input/input.module';
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
import {
TimestampToRetentionPipeModule,
} from 'src/app/pipes/timestamp-to-retention-pipe/timestamp-to-retention-pipe.module';
import { InfoSectionModule } from '../info-section/info-section.module';
import { FeaturesRoutingModule } from './features-routing.module';
@@ -34,6 +37,7 @@ import { FeaturesComponent } from './features.component';
InfoSectionModule,
TranslateModule,
DetailLayoutModule,
TimestampToRetentionPipeModule,
],
exports: [
FeaturesComponent,
@@ -1,13 +1,7 @@
<app-refresh-table *ngIf="projectId" (refreshed)="refreshPage()" [dataSize]="dataSource?.totalResult"
[emitRefreshOnPreviousRoutes]="['/projects/'+projectId+'/roles/create']" [selection]="selection"
[loading]="dataSource?.loading$ | async" [timestamp]="dataSource?.viewTimestamp">
<ng-template appHasRole [appHasRole]="['project.role.delete', 'project.role.delete:' + projectId]" actions>
<button color="warn" class="icon-button" [disabled]="disabled"
matTooltip="{{'PROJECT.ROLE.DELETE' | translate}}" (click)="deleteSelectedRoles()" mat-icon-button
*ngIf="selection.hasValue() && actionsVisible">
<i class="las la-trash"></i>
</button>
</ng-template>
<ng-template appHasRole [appHasRole]="['project.role.write:' + projectId, 'project.role.write']" actions>
<a *ngIf="actionsVisible" [disabled]="disabled" [routerLink]="[ '/projects', projectId, 'roles', 'create']"
color="primary" mat-raised-button>
@@ -57,6 +51,18 @@
</td>
</ng-container>
<ng-container matColumnDef="actions" stickyEnd>
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let role">
<button
[disabled]="disabled || (['project.role.delete', 'project.role.delete:' + projectId] | hasRole | async) == false"
mat-icon-button color="warn" matTooltip="{{'ACTIONS.DELETE' | translate}}"
(click)="deleteRole(role)">
<i class="las la-trash"></i>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr class="highlight" mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
@@ -41,3 +41,18 @@
outline: none;
cursor: pointer;
}
tr {
outline: none;
button {
visibility: hidden;
}
&:hover {
button {
visibility: visible;
}
}
}
@@ -28,7 +28,7 @@ export class ProjectRolesComponent implements AfterViewInit, OnInit {
@Output() public changedSelection: EventEmitter<Array<Role.AsObject>> = new EventEmitter();
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
public displayedColumns: string[] = ['select', 'key', 'displayname', 'group', 'creationDate'];
public displayedColumns: string[] = ['select', 'key', 'displayname', 'group', 'creationDate', 'actions'];
constructor(private mgmtService: ManagementService, private toast: ToastService, private dialog: MatDialog) {
this.dataSource = new ProjectRolesDataSource(this.mgmtService);
@@ -76,25 +76,16 @@ export class ProjectRolesComponent implements AfterViewInit, OnInit {
this.dataSource.rolesSubject.value.forEach((row: Role.AsObject) => this.selection.select(row));
}
public deleteSelectedRoles(): Promise<any> {
const oldState = this.dataSource.rolesSubject.value;
const indexes = this.selection.selected.map(sel => {
return oldState.findIndex(iter => iter.key === sel.key);
});
public deleteRole(role: Role.AsObject): Promise<any> {
const index = this.dataSource.rolesSubject.value.findIndex(iter => iter.key === role.key);
return Promise.all(this.selection.selected.map(role => {
return this.mgmtService.removeProjectRole(this.projectId, role.key);
})).then(() => {
return this.mgmtService.removeProjectRole(this.projectId, role.key).then(() => {
this.toast.showInfo('PROJECT.TOAST.ROLEREMOVED', true);
indexes.forEach(index => {
if (index > -1) {
oldState.splice(index, 1);
this.dataSource.rolesSubject.next(this.dataSource.rolesSubject.value);
}
});
this.selection.clear();
}).catch(error => {
this.toast.showError(error);
if (index > -1) {
this.dataSource.rolesSubject.value.splice(index, 1);
this.dataSource.rolesSubject.next(this.dataSource.rolesSubject.value);
}
});
}