@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
47 lines (42 loc) • 1.91 kB
JavaScript
import * as i1 from '@c8y/ngx-components';
import { NavigatorNode, hookRoute, hookNavigator } from '@c8y/ngx-components';
import * as i0 from '@angular/core';
import { Injectable } from '@angular/core';
import { gettext } from '@c8y/ngx-components/gettext';
class TranslationEditorNaviagtorFactoryService {
constructor(permissions) {
this.permissions = permissions;
this.node = new NavigatorNode({
icon: 'language1',
label: gettext('Localization'),
parent: 'Settings',
path: 'localization'
});
}
get() {
if (!this.permissions.hasRole('ROLE_APPLICATION_MANAGEMENT_ADMIN')) {
return [];
}
return this.node;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TranslationEditorNaviagtorFactoryService, deps: [{ token: i1.Permissions }], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TranslationEditorNaviagtorFactoryService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TranslationEditorNaviagtorFactoryService, decorators: [{
type: Injectable,
args: [{
providedIn: 'root'
}]
}], ctorParameters: () => [{ type: i1.Permissions }] });
const tranlationEditorProviders = [
hookRoute({
path: 'localization',
loadComponent: () => import('@c8y/ngx-components/translation-editor/lazy').then(m => m.TranslationEditorComponent)
}),
hookNavigator(TranslationEditorNaviagtorFactoryService)
];
/**
* Generated bundle index. Do not edit.
*/
export { tranlationEditorProviders };
//# sourceMappingURL=c8y-ngx-components-translation-editor.mjs.map