mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-21 12:28:46 +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,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(' ');
|
||||
}
|
||||
Reference in New Issue
Block a user