feat: add dashboard component (#811)

Fixes: #808
This commit is contained in:
Karan Takalkar
2020-05-30 22:15:29 +05:30
committed by GitHub
parent ca9404213c
commit ab3bef463d
27 changed files with 1025 additions and 13 deletions
+28
View File
@@ -0,0 +1,28 @@
/** Angular Imports */
import { Pipe, PipeTransform } from '@angular/core';
/**
* URL to String pipe.
* Transform eg: `self-service/users` :: `Self Service | Users`
*/
@Pipe({
name: 'urlToString'
})
export class UrlToStringPipe implements PipeTransform {
transform(url: string): any {
const urlSubstrings: string[] = url.slice(1).split('/');
const stringRepresentation =
urlSubstrings
.map((path: string) => {
return path.split('-')
.map((str: string) => {
return str.charAt(0).toUpperCase() + str.slice(1);
})
.join(' ');
})
.join(' | ');
return stringRepresentation;
}
}