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';
|
2018-11-27 15:03:57 +01:00
|
|
|
import { LOCALE_ID, NgModule } 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';
|
2017-12-14 17:43:57 +01:00
|
|
|
|
2019-01-18 18:03:45 +01:00
|
|
|
// AoT requires an exported function for factories
|
|
|
|
export function HttpLoaderFactory(http: HttpClient) {
|
|
|
|
return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
|
|
|
|
}
|
2018-10-02 16:33:58 +02:00
|
|
|
|
2019-11-19 17:28:25 +01:00
|
|
|
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",
|
2019-12-02 09:29:41 +01:00
|
|
|
href: environment.App + "terms-of-service",
|
2019-11-19 17:28:25 +01:00
|
|
|
policy: "Cookie Policy"
|
|
|
|
},
|
|
|
|
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,
|
|
|
|
deps: [HttpClient]
|
|
|
|
}
|
|
|
|
}),
|
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,
|
|
|
|
NgcCookieConsentModule.forRoot(cookieConfig)
|
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 { }
|