1717
1818import { BrowserModule } from "@angular/platform-browser" ;
1919import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
20- import {
21- APP_INITIALIZER ,
22- ErrorHandler ,
23- Inject ,
24- LOCALE_ID ,
25- NgModule ,
26- } from "@angular/core" ;
20+ import { LOCALE_ID , NgModule } from "@angular/core" ;
2721import { HttpClientModule } from "@angular/common/http" ;
28- import * as Sentry from "@sentry/angular" ;
2922
3023import { AppComponent } from "./app.component" ;
3124import { allRoutes } from "./app.routing" ;
@@ -40,8 +33,6 @@ import {
4033import { environment } from "../environments/environment" ;
4134import { AnalyticsService } from "./core/analytics/analytics.service" ;
4235import { ConfigurableEnumModule } from "./core/basic-datatypes/configurable-enum/configurable-enum.module" ;
43- import { MatPaginatorIntl } from "@angular/material/paginator" ;
44- import { TranslatableMatPaginator } from "./core/language/TranslatableMatPaginator" ;
4536import { FaIconLibrary } from "@fortawesome/angular-fontawesome" ;
4637import { fas } from "@fortawesome/free-solid-svg-icons" ;
4738import { far } from "@fortawesome/free-regular-svg-icons" ;
@@ -81,20 +72,20 @@ import { HistoricalDataModule } from "./features/historical-data/historical-data
8172import { MatchingEntitiesModule } from "./features/matching-entities/matching-entities.module" ;
8273import { ProgressDashboardWidgetModule } from "./features/dashboard-widgets/progress-dashboard-widget/progress-dashboard-widget.module" ;
8374import { ReportingModule } from "./features/reporting/reporting.module" ;
84- import { Router , RouterModule } from "@angular/router" ;
75+ import { RouterModule } from "@angular/router" ;
8576import { TodosModule } from "./features/todos/todos.module" ;
86- import moment from "moment" ;
87- import { getLocaleFirstDayOfWeek } from "@angular/common" ;
8877import { waitForChangeTo } from "./core/session/session-states/session-utils" ;
8978import { LoginState } from "./core/session/session-states/login-state.enum" ;
90- import { appInitializers } from "./app-initializers " ;
79+ import { APP_INITIALIZER_PROPAGATE_CONFIG_UPDATES } from "./core/config/config. app-initializer " ;
9180import { ImportModule } from "./core/import/import.module" ;
9281import { ShortcutDashboardWidgetModule } from "./features/dashboard-widgets/shortcut-dashboard-widget/shortcut-dashboard-widget.module" ;
9382import { EntityCountDashboardWidgetModule } from "./features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard-widget.module" ;
9483import { BirthdayDashboardWidgetModule } from "./features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-widget.module" ;
9584import { MarkdownPageModule } from "./features/markdown-page/markdown-page.module" ;
9685import { LoginStateSubject } from "./core/session/session-type" ;
9786import { AdminModule } from "./core/admin/admin.module" ;
87+ import { Logging } from "./core/logging/logging.service" ;
88+ import { APP_INITIALIZER_DEMO_DATA } from "./core/demo-data/demo-data.app-initializer" ;
9889
9990/**
10091 * Main entry point of the application.
@@ -147,23 +138,7 @@ import { AdminModule } from "./core/admin/admin.module";
147138 MatDialogModule ,
148139 ] ,
149140 providers : [
150- /* Sentry setup */
151- {
152- provide : ErrorHandler ,
153- useValue : Sentry . createErrorHandler ( ) ,
154- } ,
155- {
156- provide : Sentry . TraceService ,
157- deps : [ Router ] ,
158- } ,
159- {
160- provide : APP_INITIALIZER ,
161- useFactory : ( ) => ( ) => { } ,
162- deps : [ Sentry . TraceService ] ,
163- multi : true ,
164- } ,
165-
166- { provide : MatPaginatorIntl , useValue : TranslatableMatPaginator ( ) } ,
141+ ...Logging . getAngularTracingProviders ( ) ,
167142 { provide : ComponentRegistry , useValue : componentRegistry } ,
168143 { provide : EntityRegistry , useValue : entityRegistry } ,
169144 { provide : WINDOW_TOKEN , useValue : window } ,
@@ -190,17 +165,13 @@ import { AdminModule } from "./core/admin/admin.module";
190165 } ) ,
191166 deps : [ LoginStateSubject ] ,
192167 } ,
193- appInitializers ,
168+ APP_INITIALIZER_PROPAGATE_CONFIG_UPDATES ,
169+ APP_INITIALIZER_DEMO_DATA ,
194170 ] ,
195171 bootstrap : [ AppComponent ] ,
196172} )
197173export class AppModule {
198- constructor ( icons : FaIconLibrary , @ Inject ( LOCALE_ID ) locale : string ) {
174+ constructor ( icons : FaIconLibrary ) {
199175 icons . addIconPacks ( fas , far ) ;
200- moment . updateLocale ( moment . locale ( ) , {
201- week : {
202- dow : getLocaleFirstDayOfWeek ( locale ) ,
203- } ,
204- } ) ;
205176 }
206177}
0 commit comments