mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-03-12 01:32:12 +00:00
refactor: replace TSLint with ESLint
This commit is contained in:
committed by
Jovan Krunić
parent
67fb4a43c9
commit
d696215d08
@@ -14,7 +14,12 @@
|
||||
*/
|
||||
import {Component} from '@angular/core';
|
||||
import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
|
||||
import {SCAppConfigurationMenuCategory, SCLanguage, SCThingTranslator, SCTranslations} from '@openstapps/core';
|
||||
import {
|
||||
SCAppConfigurationMenuCategory,
|
||||
SCLanguage,
|
||||
SCThingTranslator,
|
||||
SCTranslations,
|
||||
} from '@openstapps/core';
|
||||
import {NGXLogger} from 'ngx-logger';
|
||||
import {ConfigProvider} from '../../config/config.provider';
|
||||
|
||||
@@ -30,7 +35,6 @@ import {ConfigProvider} from '../../config/config.provider';
|
||||
templateUrl: 'navigation.html',
|
||||
})
|
||||
export class NavigationComponent {
|
||||
|
||||
/**
|
||||
* Possible languages to be used for translation
|
||||
*/
|
||||
@@ -46,10 +50,12 @@ export class NavigationComponent {
|
||||
*/
|
||||
translator: SCThingTranslator;
|
||||
|
||||
constructor(private readonly configProvider: ConfigProvider,
|
||||
public translateService: TranslateService,
|
||||
private readonly logger: NGXLogger) {
|
||||
this.loadMenuEntries();
|
||||
constructor(
|
||||
private readonly configProvider: ConfigProvider,
|
||||
public translateService: TranslateService,
|
||||
private readonly logger: NGXLogger,
|
||||
) {
|
||||
void this.loadMenuEntries();
|
||||
translateService.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||
this.language = event.lang as keyof SCTranslations<SCLanguage>;
|
||||
this.translator = new SCThingTranslator(this.language);
|
||||
@@ -62,11 +68,12 @@ export class NavigationComponent {
|
||||
*/
|
||||
async loadMenuEntries() {
|
||||
try {
|
||||
this.menu = await this.configProvider.getValue('menus') as SCAppConfigurationMenuCategory[];
|
||||
this.menu = (await this.configProvider.getValue(
|
||||
'menus',
|
||||
)) as SCAppConfigurationMenuCategory[];
|
||||
} catch (error) {
|
||||
this.logger.error(`error from loading menu entries: ${error}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// openPage(page) {
|
||||
|
||||
Reference in New Issue
Block a user