rename dmp-frontend to frontend
This commit is contained in:
parent
94a690915a
commit
38544f463f
|
@ -1,4 +1,4 @@
|
|||
# DmpFrontend2
|
||||
# Frontend2
|
||||
|
||||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.4.
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"dmp-frontend": {
|
||||
"frontend": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
|
@ -91,18 +91,18 @@
|
|||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"buildTarget": "dmp-frontend:build"
|
||||
"buildTarget": "frontend:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"buildTarget": "dmp-frontend:build:production"
|
||||
"buildTarget": "frontend:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"buildTarget": "dmp-frontend:build"
|
||||
"buildTarget": "frontend:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
|
@ -130,7 +130,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"dmp-frontend-e2e": {
|
||||
"frontend-e2e": {
|
||||
"root": "",
|
||||
"sourceRoot": "e2e",
|
||||
"projectType": "application",
|
||||
|
@ -139,7 +139,7 @@
|
|||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "./protractor.conf.js",
|
||||
"devServerTarget": "dmp-frontend:serve"
|
||||
"devServerTarget": "frontend:serve"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import { AppPage } from './app.po';
|
||||
|
||||
describe('dmp-frontend2 App', () => {
|
||||
describe('frontend2 App', () => {
|
||||
let page: AppPage;
|
||||
|
||||
beforeEach(() => {
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "dmp-frontend2",
|
||||
"name": "frontend2",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
@ -21,10 +21,13 @@
|
|||
"@angular/material-moment-adapter": "^18.0.2",
|
||||
"@angular/platform-browser": "^18.0.2",
|
||||
"@kolkov/angular-editor": "^2.1.0",
|
||||
"@mat-datetimepicker/core": "^13.0.2",
|
||||
"@mat-datetimepicker/moment": "^13.0.2",
|
||||
"@ngx-translate/core": "^15.0.0",
|
||||
"@ngx-translate/http-loader": "^8.0.0",
|
||||
"@swimlane/ngx-datatable": "^20.1.0",
|
||||
"@tinymce/tinymce-angular": "^7.0.0",
|
||||
"@tinymce/tinymce-angular": "^8.0.0",
|
||||
"angular-mentions": "^1.5.0",
|
||||
"bootstrap": "^4.6.0",
|
||||
"cookieconsent": "^3.1.1",
|
||||
"dragula": "^3.7.3",
|
||||
|
@ -33,8 +36,6 @@
|
|||
"keycloak-js": "^24.0.5",
|
||||
"moment": "^2.30.1",
|
||||
"moment-timezone": "^0.5.45",
|
||||
"@mat-datetimepicker/core": "^13.0.2",
|
||||
"@mat-datetimepicker/moment": "^13.0.2",
|
||||
"ng-dialog-animation": "^9.0.4",
|
||||
"ng2-dragula": "^5.1.0",
|
||||
"ngx-colors": "^3.6.0",
|
||||
|
@ -44,7 +45,7 @@
|
|||
"ngx-guided-tour": "^2.0.1",
|
||||
"ngx-matomo-client": "^6.2.0",
|
||||
"rxjs": "^7.4.0",
|
||||
"tinymce": "^6.7.0",
|
||||
"tinymce": "^7.2.0",
|
||||
"ts-simple-nameof": "^1.3.1",
|
||||
"tslib": "^2.6.3",
|
||||
"zone.js": "~0.14.4"
|
||||
|
@ -62,7 +63,7 @@
|
|||
"@types/file-saver": "^2.0.7",
|
||||
"@types/moment-timezone": "^0.5.13",
|
||||
"@types/node": "^20.14.2",
|
||||
"codelyzer": "^6.0.2",
|
||||
"codelyzer": "^0.0.28",
|
||||
"ts-node": "~10.9.2",
|
||||
"tslint": "~6.1.0",
|
||||
"typescript": "5.4.5"
|
|
@ -1,281 +1,281 @@
|
|||
|
||||
import { of as observableOf, Subscription } from 'rxjs';
|
||||
|
||||
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationEnd, NavigationStart, Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { filter, map, switchMap } from 'rxjs/operators';
|
||||
import { AuthService, LoginStatus } from './core/services/auth/auth.service';
|
||||
import { CultureService } from './core/services/culture/culture-service';
|
||||
// import { BreadCrumbResolverService } from './ui/misc/breadcrumb/service/breadcrumb.service';
|
||||
import { DomSanitizer, Title } from '@angular/platform-browser';
|
||||
import { CookieService } from "ngx-cookie-service";
|
||||
import { NgcCookieConsentService, NgcStatusChangeEvent } from "ngx-cookieconsent";
|
||||
import { ConfigurationService } from './core/services/configuration/configuration.service';
|
||||
import { LanguageService } from './core/services/language/language.service';
|
||||
|
||||
import { MatSidenav } from '@angular/material/sidenav';
|
||||
import { MatomoService } from './core/services/matomo/matomo-service';
|
||||
import { SideNavService } from './core/services/sidenav/side-nav.sevice';
|
||||
import { TimezoneService } from './core/services/timezone/timezone-service';
|
||||
import { BreadcrumbService } from './ui/misc/breadcrumb/breadcrumb.service';
|
||||
import { TenantHandlingService } from './core/services/tenant/tenant-handling.service';
|
||||
import { MatIconRegistry } from '@angular/material/icon';
|
||||
|
||||
|
||||
declare const gapi: any;
|
||||
declare var $: any;
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss']
|
||||
})
|
||||
export class AppComponent implements OnInit, AfterViewInit {
|
||||
|
||||
hasBreadCrumb = observableOf(false);
|
||||
// sideNavOpen = false;
|
||||
private sideNavSubscription: Subscription;
|
||||
helpContentEnabled: boolean;
|
||||
private statusChangeSubscription: Subscription;
|
||||
showOnlyRouterOutlet = false;
|
||||
cssConfigLoaded = false;
|
||||
|
||||
@ViewChild('sidenav') sidenav: MatSidenav;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private authentication: AuthService,
|
||||
private translate: TranslateService,
|
||||
// private breadCrumbResolverService: BreadCrumbResolverService,
|
||||
private titleService: Title,
|
||||
private cultureService: CultureService,
|
||||
private timezoneService: TimezoneService,
|
||||
private cookieService: CookieService,
|
||||
private ccService: NgcCookieConsentService,
|
||||
private language: LanguageService,
|
||||
private configurationService: ConfigurationService,
|
||||
private matomoService: MatomoService,
|
||||
private tenantHandlingService: TenantHandlingService,
|
||||
private sidenavService: SideNavService,
|
||||
private breadcrumbService: BreadcrumbService,
|
||||
private sanitizer: DomSanitizer,
|
||||
public iconRegistry: MatIconRegistry,
|
||||
) {
|
||||
this.initializeServices();
|
||||
this.matomoService.init();
|
||||
this.helpContentEnabled = configurationService.helpService.enabled;
|
||||
|
||||
const paperPlaneIconSrc = this.sanitizer.bypassSecurityTrustResourceUrl('/assets/images/annotations/paper-plane.svg');
|
||||
iconRegistry.addSvgIcon('paperPlane', paperPlaneIconSrc);
|
||||
}
|
||||
ngAfterViewInit(): void {
|
||||
setTimeout(() => {
|
||||
this.sideNavSubscription = this.sidenavService.status().subscribe(isopen => {
|
||||
const hamburger = document.getElementById('hamburger');
|
||||
if (isopen) {
|
||||
//update value of hamburfer
|
||||
if (!hamburger) {//try later
|
||||
setTimeout(() => {
|
||||
const hamburger = document.getElementById('hamburger');
|
||||
if (hamburger) {
|
||||
hamburger.classList.add('change');
|
||||
}
|
||||
}, 300);
|
||||
} else {
|
||||
hamburger.classList.add('change');
|
||||
}
|
||||
this.sidenav.open()
|
||||
} else {//closed
|
||||
if (!hamburger) {//try later
|
||||
setTimeout(() => {
|
||||
const hamburger = document.getElementById('hamburger');
|
||||
if (hamburger) {
|
||||
hamburger.classList.remove('change');
|
||||
}
|
||||
}, 300);
|
||||
} else {
|
||||
hamburger.classList.remove('change');
|
||||
}
|
||||
this.sidenav.close();
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onActivate(event: any) {
|
||||
// this.breadCrumbResolverService.push(event);
|
||||
}
|
||||
|
||||
onDeactivate(event: any) {
|
||||
//this.breadCrumbResolverService.clear()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (!this.cookieService.check("cookiesConsent")) {
|
||||
// this.cookieService.set("cookiesConsent", "false", 356);
|
||||
this.cookieService.set("cookiesConsent", "false", 356, null, null, false, 'Lax');
|
||||
|
||||
}
|
||||
|
||||
this.hasBreadCrumb = this.router.events.pipe(
|
||||
filter(event => event instanceof NavigationEnd),
|
||||
map(() => this.route),
|
||||
map(route => route.firstChild),
|
||||
switchMap(route => route.data),
|
||||
map(data => data['breadcrumb']));
|
||||
|
||||
const appTitle = this.titleService.getTitle();
|
||||
this.router
|
||||
.events.pipe(
|
||||
filter(event => event instanceof NavigationEnd),
|
||||
map(() => {
|
||||
let child = this.route.firstChild;
|
||||
if (child != null) {
|
||||
while (child.firstChild) {
|
||||
child = child.firstChild;
|
||||
}
|
||||
if (child.snapshot.data && child.snapshot.data.showOnlyRouterOutlet) {
|
||||
this.showOnlyRouterOutlet = true;
|
||||
this.ccService.getConfig().enabled = false;
|
||||
this.ccService.destroy();
|
||||
this.ccService.init(this.ccService.getConfig());
|
||||
} else {
|
||||
this.showOnlyRouterOutlet = false;
|
||||
if (this.cookieService.get("cookiesConsent") == "true") {
|
||||
this.ccService.getConfig().enabled = false;
|
||||
} else {
|
||||
this.ccService.getConfig().enabled = true;
|
||||
}
|
||||
this.ccService.destroy();
|
||||
this.ccService.init(this.ccService.getConfig());
|
||||
}
|
||||
|
||||
const usePrefix = child.snapshot.data['usePrefix'] ?? true;
|
||||
if (child.snapshot.data['getFromTitleService']) {
|
||||
return { title: this.titleService.getTitle(), usePrefix: usePrefix };
|
||||
}
|
||||
else if (child.snapshot.data['title']) {
|
||||
return { title: child.snapshot.data['title'], usePrefix: usePrefix };
|
||||
}
|
||||
}
|
||||
return { title: appTitle, usePrefix: true };
|
||||
})
|
||||
).subscribe((titleOptions: { title: string, usePrefix: boolean }) => {
|
||||
this.translateTitle(titleOptions.title, titleOptions.usePrefix);
|
||||
this.translate.onLangChange.subscribe(() => this.translateTitle(titleOptions.title, titleOptions.usePrefix));
|
||||
});
|
||||
|
||||
|
||||
this.router
|
||||
.events.pipe(
|
||||
filter(event => event instanceof NavigationEnd)
|
||||
)
|
||||
.subscribe((event: NavigationStart) => {
|
||||
|
||||
this.breadcrumbService.addExcludedParam('t', true);
|
||||
|
||||
if (this.authentication.getSelectedTenantName() && this.authentication.getSelectedTenantName() !== '')
|
||||
this.breadcrumbService.addIdResolvedValue(this.authentication.selectedTenant(), this.authentication.getSelectedTenantName());
|
||||
|
||||
// const enrichedUrl = this.tenantHandlingService.getUrlEnrichedWithTenantCode(event.url, this.authentication.selectedTenant() ?? 'default');
|
||||
// if (event.url != enrichedUrl) {
|
||||
// this.router.navigateByUrl(enrichedUrl);
|
||||
// }
|
||||
});
|
||||
|
||||
this.statusChangeSubscription = this.ccService.statusChange$.subscribe((event: NgcStatusChangeEvent) => {
|
||||
if (event.status == "dismiss") {
|
||||
// this.cookieService.set("cookiesConsent", "true", 365);
|
||||
this.cookieService.set("cookiesConsent", "true", 356, null, null, false, 'Lax');
|
||||
}
|
||||
});
|
||||
|
||||
this.ccService.getConfig().content.href = this.configurationService.app + "cookies-policy";
|
||||
this.ccService.getConfig().cookie.domain = this.configurationService.app;
|
||||
this.translate
|
||||
.get(['COOKIE.MESSAGE', 'COOKIE.DISMISS', 'COOKIE.DENY', 'COOKIE.LINK', 'COOKIE.POLICY'])
|
||||
.subscribe(data => {
|
||||
this.ccService.getConfig().content = this.ccService.getConfig().content || {};
|
||||
// Override default messages with the translated ones
|
||||
this.ccService.getConfig().content.message = data['COOKIE.MESSAGE'];
|
||||
this.ccService.getConfig().content.dismiss = data['COOKIE.DISMISS'];
|
||||
this.ccService.getConfig().content.deny = data['COOKIE.DENY'];
|
||||
this.ccService.getConfig().content.link = data['COOKIE.LINK'];
|
||||
this.ccService.getConfig().content.policy = data['COOKIE.POLICY'];
|
||||
|
||||
if (this.cookieService.get("cookiesConsent") == "true") {
|
||||
this.ccService.getConfig().enabled = false;
|
||||
}
|
||||
this.ccService.destroy();
|
||||
this.ccService.init(this.ccService.getConfig());
|
||||
});
|
||||
}
|
||||
|
||||
translateTitle(ttl: string, usePrefix: boolean) {
|
||||
if (ttl.length > 0) {
|
||||
this.translate.get(ttl).subscribe((translated: string) => {
|
||||
if (usePrefix) {
|
||||
this.translate.get('GENERAL.TITLES.PREFIX').subscribe((titlePrefix: string) => {
|
||||
this.titleService.setTitle(titlePrefix + translated);
|
||||
});
|
||||
} else {
|
||||
this.titleService.setTitle(translated);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.translate.get('GENERAL.TITLES.GENERAL').subscribe((translated: string) => {
|
||||
this.titleService.setTitle(translated);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.statusChangeSubscription.unsubscribe();
|
||||
if (this.sideNavSubscription) {
|
||||
this.sideNavSubscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
login() {
|
||||
//redirect to login page
|
||||
this.router.navigate(['/login'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
|
||||
logout() {
|
||||
|
||||
}
|
||||
|
||||
public isAuthenticated(): boolean {
|
||||
return this.authentication.currentAccountIsAuthenticated();
|
||||
}
|
||||
|
||||
goToPlans() { //not used
|
||||
this.router.navigate(['/plans'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
|
||||
initializeServices() {
|
||||
|
||||
if (!this.authentication.currentAccountIsAuthenticated() && this.configurationService.cssColorsTenantConfiguration) {
|
||||
this.tenantHandlingService.applyTenantCssColors(this.configurationService.cssColorsTenantConfiguration);
|
||||
}
|
||||
|
||||
this.translate.setDefaultLang(this.language.getDefaultLanguagesCode());
|
||||
this.authentication.currentAccountIsAuthenticated() && this.authentication.getUserProfileCulture() ? this.cultureService.cultureSelected(this.authentication.getUserProfileCulture()) : this.cultureService.cultureSelected(this.configurationService.defaultCulture);
|
||||
this.authentication.currentAccountIsAuthenticated() && this.authentication.getUserProfileTimezone() ? this.timezoneService.timezoneSelected(this.authentication.getUserProfileTimezone()) : this.timezoneService.timezoneSelected(this.configurationService.defaultTimezone);
|
||||
this.authentication.currentAccountIsAuthenticated() && this.authentication.getUserProfileLanguage() ? this.language.changeLanguage(this.authentication.getUserProfileLanguage()) : (this.language.getDefaultLanguagesCode());
|
||||
|
||||
this.authentication.getAuthenticationStateObservable().subscribe(authenticationState => {
|
||||
if (authenticationState.loginStatus === LoginStatus.LoggedIn) {
|
||||
this.tenantHandlingService.loadAndApplyTenantCssColors();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
toggleNavbar(event) {
|
||||
document.getElementById('hamburger').classList.toggle("change");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
import { of as observableOf, Subscription } from 'rxjs';
|
||||
|
||||
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationEnd, NavigationStart, Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { filter, map, switchMap } from 'rxjs/operators';
|
||||
import { AuthService, LoginStatus } from './core/services/auth/auth.service';
|
||||
import { CultureService } from './core/services/culture/culture-service';
|
||||
// import { BreadCrumbResolverService } from './ui/misc/breadcrumb/service/breadcrumb.service';
|
||||
import { DomSanitizer, Title } from '@angular/platform-browser';
|
||||
import { CookieService } from "ngx-cookie-service";
|
||||
import { NgcCookieConsentService, NgcStatusChangeEvent } from "ngx-cookieconsent";
|
||||
import { ConfigurationService } from './core/services/configuration/configuration.service';
|
||||
import { LanguageService } from './core/services/language/language.service';
|
||||
|
||||
import { MatSidenav } from '@angular/material/sidenav';
|
||||
import { MatomoService } from './core/services/matomo/matomo-service';
|
||||
import { SideNavService } from './core/services/sidenav/side-nav.sevice';
|
||||
import { TimezoneService } from './core/services/timezone/timezone-service';
|
||||
import { BreadcrumbService } from './ui/misc/breadcrumb/breadcrumb.service';
|
||||
import { TenantHandlingService } from './core/services/tenant/tenant-handling.service';
|
||||
import { MatIconRegistry } from '@angular/material/icon';
|
||||
|
||||
|
||||
declare const gapi: any;
|
||||
declare var $: any;
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss']
|
||||
})
|
||||
export class AppComponent implements OnInit, AfterViewInit {
|
||||
|
||||
hasBreadCrumb = observableOf(false);
|
||||
// sideNavOpen = false;
|
||||
private sideNavSubscription: Subscription;
|
||||
helpContentEnabled: boolean;
|
||||
private statusChangeSubscription: Subscription;
|
||||
showOnlyRouterOutlet = false;
|
||||
cssConfigLoaded = false;
|
||||
|
||||
@ViewChild('sidenav') sidenav: MatSidenav;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private authentication: AuthService,
|
||||
private translate: TranslateService,
|
||||
// private breadCrumbResolverService: BreadCrumbResolverService,
|
||||
private titleService: Title,
|
||||
private cultureService: CultureService,
|
||||
private timezoneService: TimezoneService,
|
||||
private cookieService: CookieService,
|
||||
private ccService: NgcCookieConsentService,
|
||||
private language: LanguageService,
|
||||
private configurationService: ConfigurationService,
|
||||
private matomoService: MatomoService,
|
||||
private tenantHandlingService: TenantHandlingService,
|
||||
private sidenavService: SideNavService,
|
||||
private breadcrumbService: BreadcrumbService,
|
||||
private sanitizer: DomSanitizer,
|
||||
public iconRegistry: MatIconRegistry,
|
||||
) {
|
||||
this.initializeServices();
|
||||
this.matomoService.init();
|
||||
this.helpContentEnabled = configurationService.helpService.enabled;
|
||||
|
||||
const paperPlaneIconSrc = this.sanitizer.bypassSecurityTrustResourceUrl('/assets/images/annotations/paper-plane.svg');
|
||||
iconRegistry.addSvgIcon('paperPlane', paperPlaneIconSrc);
|
||||
}
|
||||
ngAfterViewInit(): void {
|
||||
setTimeout(() => {
|
||||
this.sideNavSubscription = this.sidenavService.status().subscribe(isopen => {
|
||||
const hamburger = document.getElementById('hamburger');
|
||||
if (isopen) {
|
||||
//update value of hamburfer
|
||||
if (!hamburger) {//try later
|
||||
setTimeout(() => {
|
||||
const hamburger = document.getElementById('hamburger');
|
||||
if (hamburger) {
|
||||
hamburger.classList.add('change');
|
||||
}
|
||||
}, 300);
|
||||
} else {
|
||||
hamburger.classList.add('change');
|
||||
}
|
||||
this.sidenav.open()
|
||||
} else {//closed
|
||||
if (!hamburger) {//try later
|
||||
setTimeout(() => {
|
||||
const hamburger = document.getElementById('hamburger');
|
||||
if (hamburger) {
|
||||
hamburger.classList.remove('change');
|
||||
}
|
||||
}, 300);
|
||||
} else {
|
||||
hamburger.classList.remove('change');
|
||||
}
|
||||
this.sidenav.close();
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onActivate(event: any) {
|
||||
// this.breadCrumbResolverService.push(event);
|
||||
}
|
||||
|
||||
onDeactivate(event: any) {
|
||||
//this.breadCrumbResolverService.clear()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (!this.cookieService.check("cookiesConsent")) {
|
||||
// this.cookieService.set("cookiesConsent", "false", 356);
|
||||
this.cookieService.set("cookiesConsent", "false", 356, null, null, false, 'Lax');
|
||||
|
||||
}
|
||||
|
||||
this.hasBreadCrumb = this.router.events.pipe(
|
||||
filter(event => event instanceof NavigationEnd),
|
||||
map(() => this.route),
|
||||
map(route => route.firstChild),
|
||||
switchMap(route => route.data),
|
||||
map(data => data['breadcrumb']));
|
||||
|
||||
const appTitle = this.titleService.getTitle();
|
||||
this.router
|
||||
.events.pipe(
|
||||
filter(event => event instanceof NavigationEnd),
|
||||
map(() => {
|
||||
let child = this.route.firstChild;
|
||||
if (child != null) {
|
||||
while (child.firstChild) {
|
||||
child = child.firstChild;
|
||||
}
|
||||
if (child.snapshot.data && child.snapshot.data.showOnlyRouterOutlet) {
|
||||
this.showOnlyRouterOutlet = true;
|
||||
this.ccService.getConfig().enabled = false;
|
||||
this.ccService.destroy();
|
||||
this.ccService.init(this.ccService.getConfig());
|
||||
} else {
|
||||
this.showOnlyRouterOutlet = false;
|
||||
if (this.cookieService.get("cookiesConsent") == "true") {
|
||||
this.ccService.getConfig().enabled = false;
|
||||
} else {
|
||||
this.ccService.getConfig().enabled = true;
|
||||
}
|
||||
this.ccService.destroy();
|
||||
this.ccService.init(this.ccService.getConfig());
|
||||
}
|
||||
|
||||
const usePrefix = child.snapshot.data['usePrefix'] ?? true;
|
||||
if (child.snapshot.data['getFromTitleService']) {
|
||||
return { title: this.titleService.getTitle(), usePrefix: usePrefix };
|
||||
}
|
||||
else if (child.snapshot.data['title']) {
|
||||
return { title: child.snapshot.data['title'], usePrefix: usePrefix };
|
||||
}
|
||||
}
|
||||
return { title: appTitle, usePrefix: true };
|
||||
})
|
||||
).subscribe((titleOptions: { title: string, usePrefix: boolean }) => {
|
||||
this.translateTitle(titleOptions.title, titleOptions.usePrefix);
|
||||
this.translate.onLangChange.subscribe(() => this.translateTitle(titleOptions.title, titleOptions.usePrefix));
|
||||
});
|
||||
|
||||
|
||||
this.router
|
||||
.events.pipe(
|
||||
filter(event => event instanceof NavigationEnd)
|
||||
)
|
||||
.subscribe((event: NavigationStart) => {
|
||||
|
||||
this.breadcrumbService.addExcludedParam('t', true);
|
||||
|
||||
if (this.authentication.getSelectedTenantName() && this.authentication.getSelectedTenantName() !== '')
|
||||
this.breadcrumbService.addIdResolvedValue(this.authentication.selectedTenant(), this.authentication.getSelectedTenantName());
|
||||
|
||||
// const enrichedUrl = this.tenantHandlingService.getUrlEnrichedWithTenantCode(event.url, this.authentication.selectedTenant() ?? 'default');
|
||||
// if (event.url != enrichedUrl) {
|
||||
// this.router.navigateByUrl(enrichedUrl);
|
||||
// }
|
||||
});
|
||||
|
||||
this.statusChangeSubscription = this.ccService.statusChange$.subscribe((event: NgcStatusChangeEvent) => {
|
||||
if (event.status == "dismiss") {
|
||||
// this.cookieService.set("cookiesConsent", "true", 365);
|
||||
this.cookieService.set("cookiesConsent", "true", 356, null, null, false, 'Lax');
|
||||
}
|
||||
});
|
||||
|
||||
this.ccService.getConfig().content.href = this.configurationService.app + "cookies-policy";
|
||||
this.ccService.getConfig().cookie.domain = this.configurationService.app;
|
||||
this.translate
|
||||
.get(['COOKIE.MESSAGE', 'COOKIE.DISMISS', 'COOKIE.DENY', 'COOKIE.LINK', 'COOKIE.POLICY'])
|
||||
.subscribe(data => {
|
||||
this.ccService.getConfig().content = this.ccService.getConfig().content || {};
|
||||
// Override default messages with the translated ones
|
||||
this.ccService.getConfig().content.message = data['COOKIE.MESSAGE'];
|
||||
this.ccService.getConfig().content.dismiss = data['COOKIE.DISMISS'];
|
||||
this.ccService.getConfig().content.deny = data['COOKIE.DENY'];
|
||||
this.ccService.getConfig().content.link = data['COOKIE.LINK'];
|
||||
this.ccService.getConfig().content.policy = data['COOKIE.POLICY'];
|
||||
|
||||
if (this.cookieService.get("cookiesConsent") == "true") {
|
||||
this.ccService.getConfig().enabled = false;
|
||||
}
|
||||
this.ccService.destroy();
|
||||
this.ccService.init(this.ccService.getConfig());
|
||||
});
|
||||
}
|
||||
|
||||
translateTitle(ttl: string, usePrefix: boolean) {
|
||||
if (ttl.length > 0) {
|
||||
this.translate.get(ttl).subscribe((translated: string) => {
|
||||
if (usePrefix) {
|
||||
this.translate.get('GENERAL.TITLES.PREFIX').subscribe((titlePrefix: string) => {
|
||||
this.titleService.setTitle(titlePrefix + translated);
|
||||
});
|
||||
} else {
|
||||
this.titleService.setTitle(translated);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.translate.get('GENERAL.TITLES.GENERAL').subscribe((translated: string) => {
|
||||
this.titleService.setTitle(translated);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.statusChangeSubscription.unsubscribe();
|
||||
if (this.sideNavSubscription) {
|
||||
this.sideNavSubscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
login() {
|
||||
//redirect to login page
|
||||
this.router.navigate(['/login'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
|
||||
logout() {
|
||||
|
||||
}
|
||||
|
||||
public isAuthenticated(): boolean {
|
||||
return this.authentication.currentAccountIsAuthenticated();
|
||||
}
|
||||
|
||||
goToPlans() { //not used
|
||||
this.router.navigate(['/plans'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
|
||||
initializeServices() {
|
||||
|
||||
if (!this.authentication.currentAccountIsAuthenticated() && this.configurationService.cssColorsTenantConfiguration) {
|
||||
this.tenantHandlingService.applyTenantCssColors(this.configurationService.cssColorsTenantConfiguration);
|
||||
}
|
||||
|
||||
this.translate.setDefaultLang(this.language.getDefaultLanguagesCode());
|
||||
this.authentication.currentAccountIsAuthenticated() && this.authentication.getUserProfileCulture() ? this.cultureService.cultureSelected(this.authentication.getUserProfileCulture()) : this.cultureService.cultureSelected(this.configurationService.defaultCulture);
|
||||
this.authentication.currentAccountIsAuthenticated() && this.authentication.getUserProfileTimezone() ? this.timezoneService.timezoneSelected(this.authentication.getUserProfileTimezone()) : this.timezoneService.timezoneSelected(this.configurationService.defaultTimezone);
|
||||
this.authentication.currentAccountIsAuthenticated() && this.authentication.getUserProfileLanguage() ? this.language.changeLanguage(this.authentication.getUserProfileLanguage()) : (this.language.getDefaultLanguagesCode());
|
||||
|
||||
this.authentication.getAuthenticationStateObservable().subscribe(authenticationState => {
|
||||
if (authenticationState.loginStatus === LoginStatus.LoggedIn) {
|
||||
this.tenantHandlingService.loadAndApplyTenantCssColors();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
toggleNavbar(event) {
|
||||
document.getElementById('hamburger').classList.toggle("change");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,189 +1,189 @@
|
|||
import { OverlayModule } from '@angular/cdk/overlay';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { APP_INITIALIZER, LOCALE_ID, NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MAT_MOMENT_DATE_FORMATS, MatMomentDateModule } from '@angular/material-moment-adapter';
|
||||
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
||||
import { BrowserModule, Title } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { AppRoutingModule } from '@app/app-routing.module';
|
||||
import { AppComponent } from '@app/app.component';
|
||||
import { CoreServiceModule } from '@app/core/core-service.module';
|
||||
import { NotificationModule } from '@app/library/notification/notification.module';
|
||||
import { LoginModule } from '@app/ui/auth/login/login.module';
|
||||
import { ReloadHelperComponent } from '@app/ui/misc/reload-helper/reload-helper.component';
|
||||
import { NavbarModule } from '@app/ui/navbar/navbar.module';
|
||||
import { SidebarModule } from '@app/ui/sidebar/sidebar.module';
|
||||
import { MomentUtcDateAdapter } from '@common/date/moment-utc-date-adapter';
|
||||
import { MomentUtcDateTimeAdapter } from '@common/date/moment-utc-date-time.adapter';
|
||||
import { BaseHttpParams } from '@common/http/base-http-params';
|
||||
import { CommonHttpModule } from '@common/http/common-http.module';
|
||||
import { InterceptorType } from '@common/http/interceptors/interceptor-type';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { DatetimeAdapter } from '@mat-datetimepicker/core';
|
||||
import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { CoreNotificationServiceModule } from '@notification-service/services/core-service.module';
|
||||
import { CoreAnnotationServiceModule } from 'annotation-service/services/core-service.module';
|
||||
import { KeycloakAngularModule, KeycloakService } from 'keycloak-angular';
|
||||
import { DragulaModule } from 'ng2-dragula';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
import { NgcCookieConsentConfig, NgcCookieConsentModule } from 'ngx-cookieconsent';
|
||||
import { MatomoInitializationMode, NgxMatomoModule } from 'ngx-matomo-client';
|
||||
import { from } from 'rxjs';
|
||||
import { AuthService } from './core/services/auth/auth.service';
|
||||
import { ConfigurationService } from './core/services/configuration/configuration.service';
|
||||
import { CultureService } from './core/services/culture/culture-service';
|
||||
import { LanguageHttpService } from './core/services/language/language.http.service';
|
||||
import { LanguageService } from './core/services/language/language.service';
|
||||
import { TranslateServerLoader } from './core/services/language/server.loader';
|
||||
import { AnalyticsService } from './core/services/matomo/analytics-service';
|
||||
import { MatomoService } from './core/services/matomo/matomo-service';
|
||||
import { TenantHandlingService } from './core/services/tenant/tenant-handling.service';
|
||||
import { GuidedTourModule } from './library/guided-tour/guided-tour.module';
|
||||
import { DepositOauth2DialogModule } from './ui/misc/deposit-oauth2-dialog/deposit-oauth2-dialog.module';
|
||||
import { OpenCDMPCustomTranslationCompiler } from './utilities/translate/opencdmp-custom-translation-compiler';
|
||||
|
||||
// AoT requires an exported function for factories
|
||||
export function HttpLoaderFactory(languageHttpService: LanguageHttpService) {
|
||||
return new TranslateServerLoader(languageHttpService);
|
||||
}
|
||||
|
||||
const cookieConfig: NgcCookieConsentConfig = {
|
||||
enabled: true,
|
||||
cookie: {
|
||||
domain: ""//environment.App // or 'your.domain.com' // it is mandatory to set a domain, for cookies to work properly (see https://goo.gl/S2Hy2A)
|
||||
},
|
||||
palette: {
|
||||
popup: {
|
||||
background: "#000000",
|
||||
text: "#ffffff",
|
||||
link: "#ffffff"
|
||||
},
|
||||
button: {
|
||||
background: "#00b29f",
|
||||
text: "#ffffff",
|
||||
border: "transparent"
|
||||
}
|
||||
},
|
||||
content: {
|
||||
message: "This website uses cookies to enhance the user experience.",
|
||||
dismiss: "Got it!",
|
||||
deny: "Refuse cookies",
|
||||
link: "Learn more",
|
||||
href: "",//environment.App + "terms-of-service",
|
||||
policy: "Cookies Policy"
|
||||
},
|
||||
position: "bottom-right",
|
||||
theme: 'edgeless',
|
||||
type: 'info'
|
||||
};
|
||||
|
||||
export function InstallationConfigurationFactory(appConfig: ConfigurationService, keycloak: KeycloakService, authService: AuthService, languageService: LanguageService, tenantHandlingService: TenantHandlingService) {
|
||||
return () => appConfig.loadConfiguration().then(() => {
|
||||
return languageService.loadAvailableLanguages().toPromise();
|
||||
}).then(x => keycloak.init({
|
||||
config: {
|
||||
url: appConfig.keycloak.address,
|
||||
realm: appConfig.keycloak.realm,
|
||||
clientId: appConfig.keycloak.clientId,
|
||||
},
|
||||
initOptions: {
|
||||
onLoad: 'check-sso',
|
||||
flow: appConfig.keycloak.flow,
|
||||
checkLoginIframe: false,
|
||||
scope: appConfig.keycloak.scope,
|
||||
pkceMethod: 'S256'
|
||||
},
|
||||
shouldAddToken: () => false
|
||||
}).then(() => {
|
||||
const params = new BaseHttpParams();
|
||||
params.interceptorContext = {
|
||||
excludedInterceptors: [
|
||||
InterceptorType.Locale,
|
||||
InterceptorType.ProgressIndication,
|
||||
InterceptorType.RequestTiming,
|
||||
InterceptorType.UnauthorizedResponse,
|
||||
]
|
||||
};
|
||||
|
||||
const tenantCode = tenantHandlingService.extractTenantCodeFromUrlPath(window.location.pathname) ?? authService.selectedTenant() ?? 'default';
|
||||
const tokenPromise = keycloak.getToken();
|
||||
return authService.prepareAuthRequest(from(tokenPromise), tenantCode, { params }).toPromise().catch(error => authService.onAuthenticateError(error));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
ReloadHelperComponent
|
||||
],
|
||||
bootstrap: [AppComponent], imports: [BrowserModule,
|
||||
BrowserAnimationsModule,
|
||||
KeycloakAngularModule,
|
||||
CoreServiceModule.forRoot(),
|
||||
CoreAnnotationServiceModule.forRoot(),
|
||||
CoreNotificationServiceModule.forRoot(),
|
||||
AppRoutingModule,
|
||||
CommonUiModule,
|
||||
TranslateModule.forRoot({
|
||||
compiler: { provide: TranslateCompiler, useClass: OpenCDMPCustomTranslationCompiler },
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: HttpLoaderFactory,
|
||||
deps: [LanguageHttpService]
|
||||
}
|
||||
}),
|
||||
OverlayModule,
|
||||
CommonHttpModule,
|
||||
MatMomentDateModule,
|
||||
LoginModule,
|
||||
//Ui
|
||||
NotificationModule,
|
||||
ReactiveFormsModule,
|
||||
FormsModule,
|
||||
NavbarModule,
|
||||
SidebarModule,
|
||||
NgcCookieConsentModule.forRoot(cookieConfig),
|
||||
DepositOauth2DialogModule,
|
||||
GuidedTourModule.forRoot(),
|
||||
DragulaModule.forRoot(),
|
||||
NgxMatomoModule.forRoot({
|
||||
mode: MatomoInitializationMode.AUTO_DEFERRED,
|
||||
})],
|
||||
providers: [
|
||||
ConfigurationService,
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: InstallationConfigurationFactory,
|
||||
deps: [ConfigurationService, KeycloakService, AuthService, LanguageService, TenantHandlingService],
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
provide: MAT_DATE_LOCALE,
|
||||
deps: [CultureService],
|
||||
useFactory: (cultureService) => cultureService.getCurrentCulture().name
|
||||
},
|
||||
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS },
|
||||
{ provide: DateAdapter, useClass: MomentUtcDateAdapter },
|
||||
{ provide: DatetimeAdapter, useClass: MomentUtcDateTimeAdapter },
|
||||
{
|
||||
provide: LOCALE_ID,
|
||||
deps: [CultureService, ConfigurationService],
|
||||
useFactory: (cultureService, installationConfigurationService) => cultureService.getCurrentCulture(installationConfigurationService).name
|
||||
},
|
||||
{
|
||||
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
|
||||
useValue: {
|
||||
appearance: 'outline'
|
||||
}
|
||||
},
|
||||
Title,
|
||||
CookieService,
|
||||
MatomoService,
|
||||
AnalyticsService,
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
})
|
||||
export class AppModule { }
|
||||
import { OverlayModule } from '@angular/cdk/overlay';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { APP_INITIALIZER, LOCALE_ID, NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MAT_MOMENT_DATE_FORMATS, MatMomentDateModule } from '@angular/material-moment-adapter';
|
||||
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
||||
import { BrowserModule, Title } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { AppRoutingModule } from '@app/app-routing.module';
|
||||
import { AppComponent } from '@app/app.component';
|
||||
import { CoreServiceModule } from '@app/core/core-service.module';
|
||||
import { NotificationModule } from '@app/library/notification/notification.module';
|
||||
import { LoginModule } from '@app/ui/auth/login/login.module';
|
||||
import { ReloadHelperComponent } from '@app/ui/misc/reload-helper/reload-helper.component';
|
||||
import { NavbarModule } from '@app/ui/navbar/navbar.module';
|
||||
import { SidebarModule } from '@app/ui/sidebar/sidebar.module';
|
||||
import { MomentUtcDateAdapter } from '@common/date/moment-utc-date-adapter';
|
||||
import { MomentUtcDateTimeAdapter } from '@common/date/moment-utc-date-time.adapter';
|
||||
import { BaseHttpParams } from '@common/http/base-http-params';
|
||||
import { CommonHttpModule } from '@common/http/common-http.module';
|
||||
import { InterceptorType } from '@common/http/interceptors/interceptor-type';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { DatetimeAdapter } from '@mat-datetimepicker/core';
|
||||
import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { CoreNotificationServiceModule } from '@notification-service/services/core-service.module';
|
||||
import { CoreAnnotationServiceModule } from 'annotation-service/services/core-service.module';
|
||||
import { KeycloakAngularModule, KeycloakService } from 'keycloak-angular';
|
||||
import { DragulaModule } from 'ng2-dragula';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
import { NgcCookieConsentConfig, NgcCookieConsentModule } from 'ngx-cookieconsent';
|
||||
import { MatomoInitializationMode, NgxMatomoModule } from 'ngx-matomo-client';
|
||||
import { from } from 'rxjs';
|
||||
import { AuthService } from './core/services/auth/auth.service';
|
||||
import { ConfigurationService } from './core/services/configuration/configuration.service';
|
||||
import { CultureService } from './core/services/culture/culture-service';
|
||||
import { LanguageHttpService } from './core/services/language/language.http.service';
|
||||
import { LanguageService } from './core/services/language/language.service';
|
||||
import { TranslateServerLoader } from './core/services/language/server.loader';
|
||||
import { AnalyticsService } from './core/services/matomo/analytics-service';
|
||||
import { MatomoService } from './core/services/matomo/matomo-service';
|
||||
import { TenantHandlingService } from './core/services/tenant/tenant-handling.service';
|
||||
import { GuidedTourModule } from './library/guided-tour/guided-tour.module';
|
||||
import { DepositOauth2DialogModule } from './ui/misc/deposit-oauth2-dialog/deposit-oauth2-dialog.module';
|
||||
import { OpenCDMPCustomTranslationCompiler } from './utilities/translate/opencdmp-custom-translation-compiler';
|
||||
|
||||
// AoT requires an exported function for factories
|
||||
export function HttpLoaderFactory(languageHttpService: LanguageHttpService) {
|
||||
return new TranslateServerLoader(languageHttpService);
|
||||
}
|
||||
|
||||
const cookieConfig: NgcCookieConsentConfig = {
|
||||
enabled: true,
|
||||
cookie: {
|
||||
domain: ""//environment.App // or 'your.domain.com' // it is mandatory to set a domain, for cookies to work properly (see https://goo.gl/S2Hy2A)
|
||||
},
|
||||
palette: {
|
||||
popup: {
|
||||
background: "#000000",
|
||||
text: "#ffffff",
|
||||
link: "#ffffff"
|
||||
},
|
||||
button: {
|
||||
background: "#00b29f",
|
||||
text: "#ffffff",
|
||||
border: "transparent"
|
||||
}
|
||||
},
|
||||
content: {
|
||||
message: "This website uses cookies to enhance the user experience.",
|
||||
dismiss: "Got it!",
|
||||
deny: "Refuse cookies",
|
||||
link: "Learn more",
|
||||
href: "",//environment.App + "terms-of-service",
|
||||
policy: "Cookies Policy"
|
||||
},
|
||||
position: "bottom-right",
|
||||
theme: 'edgeless',
|
||||
type: 'info'
|
||||
};
|
||||
|
||||
export function InstallationConfigurationFactory(appConfig: ConfigurationService, keycloak: KeycloakService, authService: AuthService, languageService: LanguageService, tenantHandlingService: TenantHandlingService) {
|
||||
return () => appConfig.loadConfiguration().then(() => {
|
||||
return languageService.loadAvailableLanguages().toPromise();
|
||||
}).then(x => keycloak.init({
|
||||
config: {
|
||||
url: appConfig.keycloak.address,
|
||||
realm: appConfig.keycloak.realm,
|
||||
clientId: appConfig.keycloak.clientId,
|
||||
},
|
||||
initOptions: {
|
||||
onLoad: 'check-sso',
|
||||
flow: appConfig.keycloak.flow,
|
||||
checkLoginIframe: false,
|
||||
scope: appConfig.keycloak.scope,
|
||||
pkceMethod: 'S256'
|
||||
},
|
||||
shouldAddToken: () => false
|
||||
}).then(() => {
|
||||
const params = new BaseHttpParams();
|
||||
params.interceptorContext = {
|
||||
excludedInterceptors: [
|
||||
InterceptorType.Locale,
|
||||
InterceptorType.ProgressIndication,
|
||||
InterceptorType.RequestTiming,
|
||||
InterceptorType.UnauthorizedResponse,
|
||||
]
|
||||
};
|
||||
|
||||
const tenantCode = tenantHandlingService.extractTenantCodeFromUrlPath(window.location.pathname) ?? authService.selectedTenant() ?? 'default';
|
||||
const tokenPromise = keycloak.getToken();
|
||||
return authService.prepareAuthRequest(from(tokenPromise), tenantCode, { params }).toPromise().catch(error => authService.onAuthenticateError(error));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
ReloadHelperComponent
|
||||
],
|
||||
bootstrap: [AppComponent], imports: [BrowserModule,
|
||||
BrowserAnimationsModule,
|
||||
KeycloakAngularModule,
|
||||
CoreServiceModule.forRoot(),
|
||||
CoreAnnotationServiceModule.forRoot(),
|
||||
CoreNotificationServiceModule.forRoot(),
|
||||
AppRoutingModule,
|
||||
CommonUiModule,
|
||||
TranslateModule.forRoot({
|
||||
compiler: { provide: TranslateCompiler, useClass: OpenCDMPCustomTranslationCompiler },
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: HttpLoaderFactory,
|
||||
deps: [LanguageHttpService]
|
||||
}
|
||||
}),
|
||||
OverlayModule,
|
||||
CommonHttpModule,
|
||||
MatMomentDateModule,
|
||||
LoginModule,
|
||||
//Ui
|
||||
NotificationModule,
|
||||
ReactiveFormsModule,
|
||||
FormsModule,
|
||||
NavbarModule,
|
||||
SidebarModule,
|
||||
NgcCookieConsentModule.forRoot(cookieConfig),
|
||||
DepositOauth2DialogModule,
|
||||
GuidedTourModule.forRoot(),
|
||||
DragulaModule.forRoot(),
|
||||
NgxMatomoModule.forRoot({
|
||||
mode: MatomoInitializationMode.AUTO_DEFERRED,
|
||||
})],
|
||||
providers: [
|
||||
ConfigurationService,
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: InstallationConfigurationFactory,
|
||||
deps: [ConfigurationService, KeycloakService, AuthService, LanguageService, TenantHandlingService],
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
provide: MAT_DATE_LOCALE,
|
||||
deps: [CultureService],
|
||||
useFactory: (cultureService) => cultureService.getCurrentCulture().name
|
||||
},
|
||||
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS },
|
||||
{ provide: DateAdapter, useClass: MomentUtcDateAdapter },
|
||||
{ provide: DatetimeAdapter, useClass: MomentUtcDateTimeAdapter },
|
||||
{
|
||||
provide: LOCALE_ID,
|
||||
deps: [CultureService, ConfigurationService],
|
||||
useFactory: (cultureService, installationConfigurationService) => cultureService.getCurrentCulture(installationConfigurationService).name
|
||||
},
|
||||
{
|
||||
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
|
||||
useValue: {
|
||||
appearance: 'outline'
|
||||
}
|
||||
},
|
||||
Title,
|
||||
CookieService,
|
||||
MatomoService,
|
||||
AnalyticsService,
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
})
|
||||
export class AppModule { }
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue