This commit is contained in:
Diamantis Tziotzios 2024-06-07 09:49:19 +03:00
parent eaa802872a
commit 72d2728474
1 changed files with 70 additions and 68 deletions

View File

@ -83,7 +83,7 @@ const appearance: MatFormFieldDefaultOptions = {
// appearance: 'standard'
};
export function InstallationConfigurationFactory(appConfig: ConfigurationService, keycloak: KeycloakService, authService: AuthService, languageService: LanguageService, tenantHandlingService:TenantHandlingService) {
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({
@ -118,71 +118,73 @@ export function InstallationConfigurationFactory(appConfig: ConfigurationService
}
@NgModule({ declarations: [
AppComponent,
ReloadHelperComponent
],
bootstrap: [AppComponent], imports: [BrowserModule,
BrowserAnimationsModule,
KeycloakAngularModule,
CoreServiceModule.forRoot(),
CoreAnnotationServiceModule.forRoot(),
CoreNotificationServiceModule.forRoot(),
AppRoutingModule,
CommonUiModule,
TranslateModule.forRoot({
compiler: { provide: TranslateCompiler, useClass: OpenDMPCustomTranslationCompiler },
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [LanguageHttpService]
}
}),
OverlayModule,
CommonHttpModule,
MatMomentDateModule,
LoginModule,
//Ui
NotificationModule,
// BreadcrumbModule,
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],
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: LOCALE_ID,
deps: [CultureService],
useFactory: (cultureService) => cultureService.getCurrentCulture().name
},
{
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
useValue: appearance
},
Title,
CookieService,
MatomoService,
AnalyticsService,
provideHttpClient(withInterceptorsFromDi())
] })
@NgModule({
declarations: [
AppComponent,
ReloadHelperComponent
],
bootstrap: [AppComponent], imports: [BrowserModule,
BrowserAnimationsModule,
KeycloakAngularModule,
CoreServiceModule.forRoot(),
CoreAnnotationServiceModule.forRoot(),
CoreNotificationServiceModule.forRoot(),
AppRoutingModule,
CommonUiModule,
TranslateModule.forRoot({
compiler: { provide: TranslateCompiler, useClass: OpenDMPCustomTranslationCompiler },
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [LanguageHttpService]
}
}),
OverlayModule,
CommonHttpModule,
MatMomentDateModule,
LoginModule,
//Ui
NotificationModule,
// BreadcrumbModule,
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: LOCALE_ID,
deps: [CultureService],
useFactory: (cultureService) => cultureService.getCurrentCulture().name
},
{
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
useValue: appearance
},
Title,
CookieService,
MatomoService,
AnalyticsService,
provideHttpClient(withInterceptorsFromDi())
]
})
export class AppModule { }