mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
feat: add auth support (default and paia)
This commit is contained in:
committed by
Jovan Krunić
parent
046a95ba1d
commit
b5f239ea4e
40
src/app/modules/menu/navigation/navigation.service.ts
Normal file
40
src/app/modules/menu/navigation/navigation.service.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {SCAppConfigurationMenuCategory} from '@openstapps/core';
|
||||
import {ConfigProvider} from '../../config/config.provider';
|
||||
import {NGXLogger} from 'ngx-logger';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class NavigationService {
|
||||
constructor(
|
||||
private configProvider: ConfigProvider,
|
||||
private logger: NGXLogger,
|
||||
) {}
|
||||
|
||||
async getMenu() {
|
||||
let menu: SCAppConfigurationMenuCategory[] = [];
|
||||
try {
|
||||
menu = (await this.configProvider.getValue(
|
||||
'menus',
|
||||
)) as SCAppConfigurationMenuCategory[];
|
||||
} catch (error) {
|
||||
this.logger.error(`error from loading menu entries: ${error}`);
|
||||
}
|
||||
// TODO: Load if from the backend (config)
|
||||
menu[1].items.unshift({
|
||||
icon: 'person',
|
||||
route: '/profile',
|
||||
title: 'profile',
|
||||
translations: {
|
||||
de: {
|
||||
title: 'Profil',
|
||||
},
|
||||
en: {
|
||||
title: 'profile',
|
||||
},
|
||||
},
|
||||
});
|
||||
return menu;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user