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,11 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RoleTransformPipe } from './role-transform.pipe';
@NgModule({
declarations: [RoleTransformPipe],
imports: [CommonModule],
exports: [RoleTransformPipe],
})
export class RoleTransformPipeModule {}
@@ -0,0 +1,27 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'roletransform',
})
export class RoleTransformPipe implements PipeTransform {
public transform(value: string | string[]): string {
if (typeof value === 'string') {
return getNewString(value);
} else if (typeof value === 'object' && value.length) {
return (
value
.map((s) => getNewString(s))
// .slice(0, -1)
.join(', ')
);
} else {
return '';
}
}
}
function getNewString(value: string): string {
const splitted = value.toLowerCase().split('_');
const uppercased = splitted.map((s) => `${s.substring(0, 1).toUpperCase()}${s.substring(1, s.length)}`);
return uppercased.join(' ');
}