feat: rehauled console (#3525)

* new console

* move npm ci to angular build

* rel path for assets

* local grpc copy

* login policy, rm clear views, features rel path

* lock

Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
Max Peintner
2022-04-28 10:35:02 +00:00
committed by GitHub
co-authored by Livio Amstutz
parent 00f7dbe875
commit 08ae39ae19
668 changed files with 47746 additions and 19117 deletions
@@ -0,0 +1,17 @@
<span class="title" mat-dialog-title>{{data.i18nTitle | translate}}</span>
<div mat-dialog-content>
<cnsl-project-roles-table class="role-table" *ngIf="projectId"
[displayedColumns]="['select', 'key', 'displayname', 'group']" (changedSelection)="selectRoles($event)"
[projectId]="projectId" [grantId]="grantId" [selectedKeys]="selectedRoleKeysList"
[showSelectionActionButton]="false">
</cnsl-project-roles-table>
</div>
<div mat-dialog-actions class="action">
<button mat-stroked-button (click)="closeDialog()">
{{'ACTIONS.CANCEL' | translate}}
</button>
<span class="fill-space"></span>
<button mat-raised-button color="primary" class="ok-button" (click)="closeDialogWithSuccess()">
{{'ACTIONS.CHANGE' | translate}}
</button>
</div>
@@ -0,0 +1,26 @@
.title {
font-size: 1.2rem;
margin-top: 0;
}
.role-table {
display: block;
width: 100%;
margin-top: 1rem;
}
.action {
display: flex;
button {
border-radius: 0.5rem;
}
.ok-button {
margin-left: 0.5rem;
}
.fill-space {
flex: 1;
}
}
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { UserGrantRoleDialogComponent } from './user-grant-role-dialog.component';
describe('UserGrantRoleDialogComponent', () => {
let component: UserGrantRoleDialogComponent;
let fixture: ComponentFixture<UserGrantRoleDialogComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ UserGrantRoleDialogComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(UserGrantRoleDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,34 @@
import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { Role } from 'src/app/proto/generated/zitadel/project_pb';
@Component({
selector: 'cnsl-user-grant-role-dialog',
templateUrl: './user-grant-role-dialog.component.html',
styleUrls: ['./user-grant-role-dialog.component.scss'],
})
export class UserGrantRoleDialogComponent {
public projectId: string = '';
public grantId: string = '';
public selectedRoleKeysList: string[] = [];
public selectedRoles: Role.AsObject[] = [];
constructor(public dialogRef: MatDialogRef<UserGrantRoleDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: any) {
this.projectId = data.projectId;
this.grantId = data.grantId;
this.selectedRoleKeysList = data.selectedRoleKeysList;
}
public selectRoles(selected: any): void {
this.selectedRoles = selected;
}
public closeDialog(): void {
this.dialogRef.close(false);
}
public closeDialogWithSuccess(): void {
this.dialogRef.close({ roles: this.selectedRoles.map((r) => r.key) });
}
}
@@ -0,0 +1,15 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { TranslateModule } from '@ngx-translate/core';
import { InputModule } from '../input/input.module';
import { ProjectRolesTableModule } from '../project-roles-table/project-roles-table.module';
import { UserGrantRoleDialogComponent } from './user-grant-role-dialog.component';
@NgModule({
declarations: [UserGrantRoleDialogComponent],
imports: [CommonModule, InputModule, MatButtonModule, MatIconModule, TranslateModule, ProjectRolesTableModule],
})
export class UserGrantRoleDialogModule {}