mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-06 10:58:48 +00:00
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:
co-authored by
Livio Amstutz
parent
00f7dbe875
commit
08ae39ae19
@@ -0,0 +1,49 @@
|
||||
<div class="cnsl-top-view">
|
||||
<div class="max-width-container">
|
||||
<div class="cnsl-top-row">
|
||||
|
||||
<div class="cnsl-link-row">
|
||||
<a *ngIf="hasBackButton" cnslBack class="cnsl-link" mat-icon-button>
|
||||
<mat-icon class="icon">arrow_back</mat-icon>
|
||||
</a>
|
||||
<div class="cnsl-title-row-wrapper">
|
||||
<div class="cnsl-title-row">
|
||||
<h2 class="cnsl-title">{{title}}</h2>
|
||||
<div class="cnsl-state-dot" *ngIf="isActive || isInactive" [matTooltip]="stateTooltip"
|
||||
[ngClass]="{'active': isActive, 'inactive': isInactive }">
|
||||
</div>
|
||||
</div>
|
||||
<div class="cnsl-doc-row">
|
||||
<span class="cnsl-type" [innerHtml]="sub"></span>
|
||||
<a *ngIf="docLink" mat-icon-button [href]="docLink" rel="noreferrer" target="_blank">
|
||||
<i class="las la-info-circle"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span class="fill-space"></span>
|
||||
|
||||
<ng-container *ngIf="hasActions">
|
||||
<button class="cnsl-actions-trigger-desk cnsl-action-button" mat-raised-button color="primary"
|
||||
[matMenuTriggerFor]="actions">
|
||||
<span>{{'ACTIONS.ACTIONS' | translate}}</span>
|
||||
<mat-icon class="icon">keyboard_arrow_down</mat-icon>
|
||||
</button>
|
||||
<button class="cnsl-actions-trigger-mob" matTooltip="{{'ACTIONS.ACTIONS' | translate}}" mat-icon-button
|
||||
[matMenuTriggerFor]="actions">
|
||||
<i class="las la-ellipsis-v"></i>
|
||||
</button>
|
||||
|
||||
<mat-menu #actions="matMenu" xPosition="before">
|
||||
<ng-content select="[topActions]"></ng-content>
|
||||
</mat-menu>
|
||||
</ng-container>
|
||||
|
||||
<div *ngIf="hasContributors" class="mob-full-width">
|
||||
<ng-content select="[topContributors]"></ng-content>
|
||||
</div>
|
||||
</div>
|
||||
<ng-content select="[topContent]"></ng-content>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,131 @@
|
||||
@use '@angular/material' as mat;
|
||||
|
||||
@mixin top-view-theme($theme) {
|
||||
$foreground: map-get($theme, foreground);
|
||||
$background: map-get($theme, background);
|
||||
$is-dark-theme: map-get($theme, is-dark);
|
||||
$warn: map-get($theme, warn);
|
||||
$warn-color: map-get($warn, 500);
|
||||
|
||||
.cnsl-top-view {
|
||||
border-bottom: 1px solid map-get($foreground, divider);
|
||||
margin: 0 -2rem;
|
||||
padding: 2rem 2rem 1rem 2rem;
|
||||
background: map-get($background, metadata-section);
|
||||
box-sizing: border-box;
|
||||
min-height: 182px;
|
||||
|
||||
@media only screen and (max-width: 500px) {
|
||||
margin: 0 -1rem;
|
||||
padding: 2rem 1rem 1rem 1rem;
|
||||
}
|
||||
|
||||
.cnsl-top-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 1rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.cnsl-link-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.cnsl-link {
|
||||
margin-right: 1rem;
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.cnsl-title-row-wrapper {
|
||||
.cnsl-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.cnsl-title {
|
||||
margin: 0;
|
||||
margin-right: 0.5rem;
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.cnsl-state-dot {
|
||||
height: 8px;
|
||||
width: 8px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
|
||||
&.active {
|
||||
background-color: var(--success);
|
||||
}
|
||||
|
||||
&.inactive {
|
||||
background-color: var(--warn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 700px) {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.cnsl-doc-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: -10px;
|
||||
|
||||
i {
|
||||
font-size: 1.2rem;
|
||||
height: 1.2rem;
|
||||
line-height: 1.2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cnsl-type {
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.cnsl-sub {
|
||||
margin: 1rem 1rem 0 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.fill-space {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.cnsl-actions-trigger-desk {
|
||||
margin-top: 0.25rem;
|
||||
display: none;
|
||||
align-items: center;
|
||||
|
||||
@media only screen and (min-width: 700px) {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-left: 0.25rem;
|
||||
margin-right: -0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.cnsl-actions-trigger-mob {
|
||||
display: inline;
|
||||
|
||||
@media only screen and (min-width: 700px) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.mob-full-width {
|
||||
flex-basis: 100%;
|
||||
|
||||
@media only screen and (min-width: 700px) {
|
||||
flex-basis: auto;
|
||||
margin-left: 2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TopViewComponent } from './top-view.component';
|
||||
|
||||
describe('TopViewComponent', () => {
|
||||
let component: TopViewComponent;
|
||||
let fixture: ComponentFixture<TopViewComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ TopViewComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TopViewComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'cnsl-top-view',
|
||||
templateUrl: './top-view.component.html',
|
||||
styleUrls: ['./top-view.component.scss'],
|
||||
})
|
||||
export class TopViewComponent {
|
||||
@Input() public title: string = '';
|
||||
@Input() public sub: string = '';
|
||||
@Input() public stateTooltip: string = '';
|
||||
@Input() public isActive: boolean = false;
|
||||
@Input() public isInactive: boolean = false;
|
||||
@Input() public hasActions: boolean | null = false;
|
||||
@Input() public hasContributors: boolean | null = false;
|
||||
@Input() public docLink: string = '';
|
||||
@Input() public hasBackButton: boolean | null = true;
|
||||
@Output() public backClicked: EventEmitter<void> = new EventEmitter();
|
||||
|
||||
constructor() {}
|
||||
|
||||
public backClick(): void {
|
||||
this.backClicked.emit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { BackModule } from 'src/app/directives/back/back.module';
|
||||
|
||||
import { TopViewComponent } from './top-view.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [TopViewComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule,
|
||||
BackModule,
|
||||
MatMenuModule,
|
||||
MatIconModule,
|
||||
MatButtonModule,
|
||||
MatTooltipModule,
|
||||
TranslateModule,
|
||||
],
|
||||
exports: [TopViewComponent],
|
||||
})
|
||||
export class TopViewModule {}
|
||||
Reference in New Issue
Block a user