|
| 1 | +import { HttpClient, HttpClientModule, HttpClientXsrfModule, HTTP_INTERCEPTORS } from '@angular/common/http'; |
| 2 | +import { ErrorHandler, NgModule } from '@angular/core'; |
| 3 | +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
1 | 4 | import { BrowserModule } from '@angular/platform-browser'; |
2 | | -import { NgModule, ErrorHandler, APP_INITIALIZER } from '@angular/core'; |
3 | | -import * as Sentry from '@sentry/angular-ivy'; |
4 | | -import { AppRoutingModule } from './routing/app-routing.module'; |
5 | | -import { AppComponent } from './app.component'; |
6 | | -import { LoginComponent } from './pages/landing-page/login/login.component'; |
7 | | -import { Router } from '@angular/router'; |
8 | 5 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; |
9 | | -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
| 6 | +import { AppComponent } from './app.component'; |
10 | 7 | import { MaterialModule } from './modules/material/material.module'; |
11 | | -import { HttpClient, HttpClientModule, HttpClientXsrfModule, HTTP_INTERCEPTORS } from '@angular/common/http'; |
12 | | -import { CrowdSourceLoginComponent } from './pages/landing-page/crowdsource-login/crowdsource-login.component'; |
13 | | -import { ConfirmationComponent } from './services/confirmation/confirmation.component'; |
14 | | -import { LoaderComponent } from './services/loader/loader.component'; |
15 | 8 | import { CreateUserDialogComponent } from './pages/admin/admin-dashboard/manage-users/create-user-dialog/create-user-dialog.component'; |
| 9 | +import { AdminModule } from './pages/admin/admin.module'; |
| 10 | +import { CrowdSourceLoginComponent } from './pages/landing-page/crowdsource-login/crowdsource-login.component'; |
16 | 11 | import { LandingPageComponent } from './pages/landing-page/landing-page.component'; |
| 12 | +import { LoginComponent } from './pages/landing-page/login/login.component'; |
17 | 13 | import { RegisterComponent } from './pages/landing-page/register/register.component'; |
18 | | -import { AdminModule } from './pages/admin/admin.module'; |
19 | 14 | import { ParticipantModule } from './pages/participant/participant.module'; |
20 | 15 | import { TaskModule } from './pages/tasks/task.module'; |
21 | | -// import { ErrorInterceptor } from './interceptors/error.interceptor'; |
22 | | -import { SendResetPasswordComponent } from './pages/landing-page/forgot-password/send-reset-password/send-reset-password.component'; |
| 16 | +import { AppRoutingModule } from './routing/app-routing.module'; |
| 17 | +import { ConfirmationComponent } from './services/confirmation/confirmation.component'; |
| 18 | +import { LoaderComponent } from './services/loader/loader.component'; |
| 19 | +import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; |
| 20 | +import { TranslateHttpLoader } from '@ngx-translate/http-loader'; |
| 21 | +import { HttpCsrfInterceptor } from './interceptors/csrf.interceptor'; |
23 | 22 | import { ResetPasswordLoginComponent } from './pages/landing-page/forgot-password/change-password-page/reset-password-login.component'; |
| 23 | +import { SendResetPasswordComponent } from './pages/landing-page/forgot-password/send-reset-password/send-reset-password.component'; |
| 24 | +import { NotFoundComponent } from './pages/landing-page/not-found/not-found.component'; |
24 | 25 | import { StudyBackgroundComponent } from './pages/landing-page/study-background/study-background.component'; |
| 26 | +import { OrganizationMemberModule } from './pages/organization-member/organization-member.module'; |
25 | 27 | import { SharedModule } from './pages/shared/shared.module'; |
26 | | -import { NotFoundComponent } from './pages/landing-page/not-found/not-found.component'; |
27 | | -import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; |
28 | | -import { TranslateHttpLoader } from '@ngx-translate/http-loader'; |
29 | 28 | import { SnackbarComponent } from './services/snackbar/snackbar.component'; |
30 | | -import { OrganizationMemberModule } from './pages/organization-member/organization-member.module'; |
31 | | -import { HttpCsrfInterceptor } from './interceptors/csrf.interceptor'; |
| 29 | +import CustomErrorHandler from './CustomErrorHandler'; |
32 | 30 |
|
33 | 31 | export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { |
34 | 32 | return new TranslateHttpLoader(http, '../assets/translate/', '.json'); |
@@ -94,20 +92,18 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { |
94 | 92 | }, |
95 | 93 | { |
96 | 94 | provide: ErrorHandler, |
97 | | - useValue: Sentry.createErrorHandler({ |
98 | | - showDialog: true, |
99 | | - }), |
100 | | - }, |
101 | | - { |
102 | | - provide: Sentry.TraceService, |
103 | | - deps: [Router], |
104 | | - }, |
105 | | - { |
106 | | - provide: APP_INITIALIZER, |
107 | | - useFactory: () => () => {}, |
108 | | - deps: [Sentry.TraceService], |
109 | | - multi: true, |
| 95 | + useClass: CustomErrorHandler, |
110 | 96 | }, |
| 97 | + // { |
| 98 | + // provide: Sentry.TraceService, |
| 99 | + // deps: [Router], |
| 100 | + // }, |
| 101 | + // { |
| 102 | + // provide: APP_INITIALIZER, |
| 103 | + // useFactory: () => () => {}, |
| 104 | + // deps: [Sentry.TraceService], |
| 105 | + // multi: true, |
| 106 | + // }, |
111 | 107 | ], |
112 | 108 | bootstrap: [AppComponent], |
113 | 109 | }) |
|
0 commit comments