Browse Source

UI: Clear code after merge

pull/8938/head
Vladyslav_Prykhodko 3 years ago
parent
commit
83d525aa92
  1. 9
      ui-ngx/src/app/app.component.ts
  2. 9
      ui-ngx/src/app/shared/models/icon.models.ts

9
ui-ngx/src/app/app.component.ts

@ -30,7 +30,7 @@ import { combineLatest } from 'rxjs';
import { selectIsAuthenticated, selectIsUserLoaded } from '@core/auth/auth.selectors';
import { distinctUntilChanged, filter, map, skip } from 'rxjs/operators';
import { AuthService } from '@core/auth/auth.service';
import { svgIcons } from '@shared/models/icon.models';
import { svgIcons, svgIconsUrl } from '@shared/models/icon.models';
@Component({
selector: 'tb-root',
@ -65,10 +65,9 @@ export class AppComponent implements OnInit {
);
}
this.matIconRegistry.addSvgIcon('windows', this.domSanitizer.bypassSecurityTrustResourceUrl('/assets/windows.svg'));
this.matIconRegistry.addSvgIcon('macos', this.domSanitizer.bypassSecurityTrustResourceUrl('/assets/macos.svg'));
this.matIconRegistry.addSvgIcon('linux', this.domSanitizer.bypassSecurityTrustResourceUrl('/assets/linux.svg'));
this.matIconRegistry.addSvgIcon('docker', this.domSanitizer.bypassSecurityTrustResourceUrl('/assets/docker.svg'));
for (const svgIcon of Object.keys(svgIconsUrl)) {
this.matIconRegistry.addSvgIcon(svgIcon, this.domSanitizer.bypassSecurityTrustResourceUrl(svgIcons[svgIcon]));
}
this.storageService.testLocalStorage();

9
ui-ngx/src/app/shared/models/icon.models.ts

@ -56,8 +56,15 @@ export const svgIcons: {[key: string]: string} = {
'</svg>'
};
export const svgIconsUrl: { [key: string]: string } = {
windows: '/assets/windows.svg',
macos: '/assets/macos.svg',
linux: '/assets/linux.svg',
docker: '/assets/docker.svg'
};
const svgIconNamespaces: string[] = ['mdi'];
const svgIconNames = Object.keys(svgIcons);
const svgIconNames = [...Object.keys(svgIcons), ...Object.keys(svgIconsUrl)];
export const splitIconName = (iconName: string): [string, string] => {
if (!iconName) {

Loading…
Cancel
Save