2019-01-18 18:03:45 +01:00
|
|
|
import { OverlayModule } from '@angular/cdk/overlay';
|
2018-01-30 10:35:26 +01:00
|
|
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
2020-03-26 17:44:12 +01:00
|
|
|
import { LOCALE_ID, NgModule, APP_INITIALIZER } from '@angular/core';
|
2019-12-11 15:51:03 +01:00
|
|
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
2019-01-18 18:03:45 +01:00
|
|
|
import { MatMomentDateModule, MAT_MOMENT_DATE_FORMATS } from '@angular/material-moment-adapter';
|
2019-12-11 15:51:03 +01:00
|
|
|
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
2019-09-16 17:46:19 +02:00
|
|
|
import { BrowserModule, Title } from '@angular/platform-browser';
|
2018-11-27 15:03:57 +01:00
|
|
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
2019-12-11 15:51:03 +01:00
|
|
|
import { AppRoutingModule } from '@app/app-routing.module';
|
|
|
|
import { AppComponent } from '@app/app.component';
|
|
|
|
import { CoreServiceModule } from '@app/core/core-service.module';
|
|
|
|
import { CultureService } from '@app/core/services/culture/culture-service';
|
|
|
|
import { NotificationModule } from '@app/library/notification/notification.module';
|
|
|
|
import { LoginModule } from '@app/ui/auth/login/login.module';
|
|
|
|
import { DatasetCreateWizardModule } from '@app/ui/dataset-create-wizard/dataset-create-wizard.module';
|
|
|
|
import { BreadcrumbModule } from '@app/ui/misc/breadcrumb/breadcrumb.module';
|
|
|
|
import { HelpContentModule } from '@app/ui/misc/help-content/help-content.module';
|
|
|
|
import { NavigationModule } from '@app/ui/misc/navigation/navigation.module';
|
2019-12-13 12:15:12 +01:00
|
|
|
import { ReloadHelperComponent } from '@app/ui/misc/reload-helper/reload-helper.component';
|
2019-12-11 15:51:03 +01:00
|
|
|
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 { CommonHttpModule } from '@common/http/common-http.module';
|
|
|
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
2018-11-27 15:03:57 +01:00
|
|
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
|
|
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
2019-12-11 15:51:03 +01:00
|
|
|
import { environment } from 'environments/environment';
|
|
|
|
import { CookieService } from 'ngx-cookie-service';
|
|
|
|
import { NgcCookieConsentConfig, NgcCookieConsentModule } from 'ngx-cookieconsent';
|
2020-01-23 17:35:11 +01:00
|
|
|
import { TranslateServerLoader } from './core/services/language/server.loader';
|
|
|
|
import { BaseHttpService } from './core/services/http/base-http.service';
|
2020-03-26 17:44:12 +01:00
|
|
|
import { ConfigurationService } from './core/services/configuration/configuration.service';
|
2020-04-08 15:36:06 +02:00
|
|
|
import { Oauth2DialogModule } from './ui/misc/oauth2-dialog/oauth2-dialog.module';
|
2017-12-14 17:43:57 +01:00
|
|
|
|
2019-01-18 18:03:45 +01:00
|
|
|
// AoT requires an exported function for factories
|
2020-03-26 17:44:12 +01:00
|
|
|
export function HttpLoaderFactory(http: HttpClient, appConfig: ConfigurationService) {
|
|
|
|
return new TranslateServerLoader(http, appConfig);
|
2020-02-12 17:24:42 +01:00
|
|
|
//GK: In case we want the original translation provider uncomment the line below.
|
2020-01-23 17:35:11 +01:00
|
|
|
//return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
|
2019-01-18 18:03:45 +01:00
|
|
|
}
|
2018-10-02 16:33:58 +02:00
|
|
|
|
2019-11-19 17:28:25 +01:00
|
|
|
const cookieConfig: NgcCookieConsentConfig = {
|
|
|
|
enabled: true,
|
|
|
|
cookie: {
|
2020-03-26 17:44:12 +01:00
|
|
|
domain: ""//environment.App // or 'your.domain.com' // it is mandatory to set a domain, for cookies to work properly (see https://goo.gl/S2Hy2A)
|
2019-11-19 17:28:25 +01:00
|
|
|
},
|
|
|
|
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",
|
2020-03-26 17:44:12 +01:00
|
|
|
href: "",//environment.App + "terms-of-service",
|
2020-06-25 16:52:00 +02:00
|
|
|
policy: "Cookies Policy"
|
2019-11-19 17:28:25 +01:00
|
|
|
},
|
|
|
|
position: "bottom-right",
|
|
|
|
theme: 'edgeless',
|
|
|
|
type: 'info'
|
|
|
|
};
|
|
|
|
|
2017-09-14 12:37:36 +02:00
|
|
|
@NgModule({
|
2018-07-23 17:56:09 +02:00
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
BrowserAnimationsModule,
|
2019-01-18 18:03:45 +01:00
|
|
|
CoreServiceModule.forRoot(),
|
|
|
|
AppRoutingModule,
|
|
|
|
CommonUiModule,
|
2018-07-23 17:56:09 +02:00
|
|
|
TranslateModule.forRoot({
|
|
|
|
loader: {
|
|
|
|
provide: TranslateLoader,
|
|
|
|
useFactory: HttpLoaderFactory,
|
2020-03-26 17:44:12 +01:00
|
|
|
deps: [HttpClient, ConfigurationService]
|
2018-07-23 17:56:09 +02:00
|
|
|
}
|
|
|
|
}),
|
2019-01-18 18:03:45 +01:00
|
|
|
HttpClientModule,
|
|
|
|
OverlayModule,
|
|
|
|
CommonHttpModule,
|
|
|
|
MatMomentDateModule,
|
2019-02-13 13:36:07 +01:00
|
|
|
LoginModule,
|
2019-01-18 18:03:45 +01:00
|
|
|
//Ui
|
|
|
|
NotificationModule,
|
|
|
|
NavigationModule,
|
|
|
|
BreadcrumbModule,
|
2019-03-05 11:20:10 +01:00
|
|
|
HelpContentModule,
|
|
|
|
ReactiveFormsModule,
|
|
|
|
FormsModule,
|
|
|
|
DatasetCreateWizardModule,
|
2019-04-24 11:26:53 +02:00
|
|
|
NavbarModule,
|
2019-11-19 17:28:25 +01:00
|
|
|
SidebarModule,
|
2020-04-08 15:36:06 +02:00
|
|
|
NgcCookieConsentModule.forRoot(cookieConfig),
|
|
|
|
Oauth2DialogModule
|
2019-01-18 18:03:45 +01:00
|
|
|
],
|
|
|
|
declarations: [
|
2019-12-13 12:15:12 +01:00
|
|
|
AppComponent,
|
|
|
|
ReloadHelperComponent
|
2018-07-23 17:56:09 +02:00
|
|
|
],
|
|
|
|
providers: [
|
2018-10-05 17:00:54 +02:00
|
|
|
{
|
|
|
|
provide: MAT_DATE_LOCALE,
|
|
|
|
deps: [CultureService],
|
2019-01-18 18:03:45 +01:00
|
|
|
useFactory: (cultureService) => cultureService.getCurrentCulture().name
|
2018-10-05 17:00:54 +02:00
|
|
|
},
|
2019-01-18 18:03:45 +01:00
|
|
|
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS },
|
|
|
|
{ provide: DateAdapter, useClass: MomentUtcDateAdapter },
|
2018-10-05 17:00:54 +02:00
|
|
|
{
|
|
|
|
provide: LOCALE_ID,
|
|
|
|
deps: [CultureService],
|
2019-01-18 18:03:45 +01:00
|
|
|
useFactory: (cultureService) => cultureService.getCurrentCulture().name
|
2018-10-05 17:00:54 +02:00
|
|
|
},
|
2019-11-19 17:28:25 +01:00
|
|
|
Title,
|
|
|
|
CookieService
|
2018-07-23 17:56:09 +02:00
|
|
|
],
|
|
|
|
bootstrap: [AppComponent]
|
2017-09-14 12:37:36 +02:00
|
|
|
})
|
2019-02-13 13:36:07 +01:00
|
|
|
export class AppModule { }
|