forked from juice-shop/juice-shop
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.module.ts
328 lines (325 loc) · 13.8 KB
/
app.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
/*
* Copyright (c) 2014-2023 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/
import { BrowserModule } from '@angular/platform-browser'
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'
import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http'
import { CookieModule, CookieService } from 'ngx-cookie'
import { ReactiveFormsModule, FormsModule } from '@angular/forms'
import { Routing } from './app.routing'
import { OverlayContainer } from '@angular/cdk/overlay'
import { TranslateLoader, TranslateModule } from '@ngx-translate/core'
import { TranslateHttpLoader } from '@ngx-translate/http-loader'
import { QRCodeModule } from 'anuglar2-qrcode'
import { ClipboardModule } from 'ngx-clipboard'
import { FileUploadModule } from 'ng2-file-upload'
import { SlideshowModule } from 'ng-simple-slideshow'
import { NgxSpinnerModule } from 'ngx-spinner'
import { AppComponent } from './app.component'
import { AboutComponent } from './about/about.component'
import { AdministrationComponent } from './administration/administration.component'
import { BasketComponent } from './basket/basket.component'
import { LoginComponent } from './login/login.component'
import { ScoreBoardLegacyComponent } from './score-board-legacy/score-board-legacy.component'
import { NavbarComponent } from './navbar/navbar.component'
import { WelcomeComponent } from './welcome/welcome.component'
import { WelcomeBannerComponent } from './welcome-banner/welcome-banner.component'
import { SearchResultComponent } from './search-result/search-result.component'
import { ForgotPasswordComponent } from './forgot-password/forgot-password.component'
import { RegisterComponent } from './register/register.component'
import { ContactComponent } from './contact/contact.component'
import { ChangePasswordComponent } from './change-password/change-password.component'
import { ProductDetailsComponent } from './product-details/product-details.component'
import { ComplaintComponent } from './complaint/complaint.component'
import { ChatbotComponent } from './chatbot/chatbot.component'
import { TrackResultComponent } from './track-result/track-result.component'
import { RecycleComponent } from './recycle/recycle.component'
import { QrCodeComponent } from './qr-code/qr-code.component'
import { UserDetailsComponent } from './user-details/user-details.component'
import { ServerStartedNotificationComponent } from './server-started-notification/server-started-notification.component'
import {
ChallengeSolvedNotificationComponent
} from './challenge-solved-notification/challenge-solved-notification.component'
import { OAuthComponent } from './oauth/oauth.component'
import { NFTUnlockComponent } from './nft-unlock/nft-unlock.component'
import { TokenSaleComponent } from './token-sale/token-sale.component'
import { ProductReviewEditComponent } from './product-review-edit/product-review-edit.component'
import { TwoFactorAuthEnterComponent } from './two-factor-auth-enter/two-factor-auth-enter.component'
import { PrivacySecurityComponent } from './privacy-security/privacy-security.component'
import { ErrorPageComponent } from './error-page/error-page.component'
import { NgMatSearchBarModule } from 'ng-mat-search-bar'
import { RequestInterceptor } from './Services/request.interceptor'
import { ProductService } from './Services/product.service'
import { ConfigurationService } from './Services/configuration.service'
import { AdministrationService } from './Services/administration.service'
import { SecurityQuestionService } from './Services/security-question.service'
import { UserService } from './Services/user.service'
import { SecurityAnswerService } from './Services/security-answer.service'
import { FeedbackService } from './Services/feedback.service'
import { CaptchaService } from './Services/captcha.service'
import { WindowRefService } from './Services/window-ref.service'
import { ProductReviewService } from './Services/product-review.service'
import { ComplaintService } from './Services/complaint.service'
import { ChatbotService } from './Services/chatbot.service'
import { TrackOrderService } from './Services/track-order.service'
import { RecycleService } from './Services/recycle.service'
import { BasketService } from './Services/basket.service'
import { ChallengeService } from './Services/challenge.service'
import { DataSubjectService } from './Services/data-subject.service'
import { ImageCaptchaService } from './Services/image-captcha.service'
import { KeysService } from './Services/keys.service'
import { AddressService } from './Services/address.service'
import { QuantityService } from './Services/quantity.service'
import { FeatureFlagService } from './Services/feature-flag.service'
import { FlexLayoutModule } from '@angular/flex-layout'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { MatToolbarModule } from '@angular/material/toolbar'
import { MatIconModule } from '@angular/material/icon'
import { MatFormFieldModule } from '@angular/material/form-field'
import { MatSelectModule } from '@angular/material/select'
import { MatButtonModule } from '@angular/material/button'
import { MatSidenavModule } from '@angular/material/sidenav'
import { MatTableModule } from '@angular/material/table'
import { MatPaginatorModule } from '@angular/material/paginator'
import { MatCardModule } from '@angular/material/card'
import { MatInputModule } from '@angular/material/input'
import { MatCheckboxModule } from '@angular/material/checkbox'
import { MatDialogModule } from '@angular/material/dialog'
import { MatDividerModule } from '@angular/material/divider'
import { MatDatepickerModule } from '@angular/material/datepicker'
import { MatNativeDateModule } from '@angular/material/core'
import { MatExpansionModule } from '@angular/material/expansion'
import { MatProgressBarModule } from '@angular/material/progress-bar'
import { MatTooltipModule } from '@angular/material/tooltip'
import { MatMenuModule } from '@angular/material/menu'
import { MatListModule } from '@angular/material/list'
import { SidenavComponent } from './sidenav/sidenav.component'
import { MatButtonToggleModule } from '@angular/material/button-toggle'
import { LayoutModule } from '@angular/cdk/layout'
import { MatGridListModule } from '@angular/material/grid-list'
import { MatSnackBarModule } from '@angular/material/snack-bar'
import { MatRadioModule } from '@angular/material/radio'
import { MatBadgeModule } from '@angular/material/badge'
import { HighlightModule, HIGHLIGHT_OPTIONS } from 'ngx-highlightjs'
import { ScoreBoardModule } from './score-board/score-board.module'
import { TwoFactorAuthComponent } from './two-factor-auth/two-factor-auth.component'
import { DataExportComponent } from './data-export/data-export.component'
import { LastLoginIpComponent } from './last-login-ip/last-login-ip.component'
import { PrivacyPolicyComponent } from './privacy-policy/privacy-policy.component'
import { AddressCreateComponent } from './address-create/address-create.component'
import { AddressSelectComponent } from './address-select/address-select.component'
import { PaymentService } from './Services/payment.service'
import { PaymentComponent } from './payment/payment.component'
import { PaymentMethodComponent } from './payment-method/payment-method.component'
import { SavedPaymentMethodsComponent } from './saved-payment-methods/saved-payment-methods.component'
import { AccountingComponent } from './accounting/accounting.component'
import { OrderSummaryComponent } from './order-summary/order-summary.component'
import { PurchaseBasketComponent } from './purchase-basket/purchase-basket.component'
import { AddressComponent } from './address/address.component'
import { SavedAddressComponent } from './saved-address/saved-address.component'
import { ChallengeStatusBadgeComponent } from './challenge-status-badge/challenge-status-badge.component'
import { OrderCompletionComponent } from './order-completion/order-completion.component'
import { WalletComponent } from './wallet/wallet.component'
import { WalletService } from './Services/wallet.service'
import { OrderHistoryComponent } from './order-history/order-history.component'
import { OrderHistoryService } from './Services/order-history.service'
import { DeliveryMethodComponent } from './delivery-method/delivery-method.component'
import { DeliveryService } from './Services/delivery.service'
import { PhotoWallComponent } from './photo-wall/photo-wall.component'
import { PhotoWallService } from './Services/photo-wall.service'
import { DeluxeUserComponent } from './deluxe-user/deluxe-user.component'
import { AccountingGuard, AdminGuard, DeluxeGuard, LoginGuard } from './app.guard'
import { MatPasswordStrengthModule } from '@angular-material-extensions/password-strength'
import { MatSlideToggleModule } from '@angular/material/slide-toggle'
import { FeedbackDetailsComponent } from './feedback-details/feedback-details.component'
import { MatSliderModule } from '@angular/material/slider'
import { MatTabsModule } from '@angular/material/tabs'
import { MatChipsModule } from '@angular/material/chips'
import { CodeSnippetComponent } from './code-snippet/code-snippet.component'
import { CodeAreaComponent } from './code-area/code-area.component'
import { NgxTextDiffModule } from 'ngx-text-diff'
import { CodeFixesComponent } from './code-fixes/code-fixes.component'
export function HttpLoaderFactory (http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json')
}
@NgModule({
declarations: [
AppComponent,
AboutComponent,
AdministrationComponent,
BasketComponent,
LoginComponent,
ScoreBoardLegacyComponent,
NavbarComponent,
WelcomeComponent,
WelcomeBannerComponent,
SearchResultComponent,
ForgotPasswordComponent,
RegisterComponent,
ContactComponent,
ChangePasswordComponent,
ProductDetailsComponent,
ComplaintComponent,
ChatbotComponent,
TrackResultComponent,
RecycleComponent,
QrCodeComponent,
UserDetailsComponent,
ServerStartedNotificationComponent,
ChallengeSolvedNotificationComponent,
OAuthComponent,
TokenSaleComponent,
NFTUnlockComponent,
ProductReviewEditComponent,
TwoFactorAuthEnterComponent,
SidenavComponent,
PrivacySecurityComponent,
ErrorPageComponent,
TwoFactorAuthComponent,
DataExportComponent,
LastLoginIpComponent,
PrivacyPolicyComponent,
OrderCompletionComponent,
AddressCreateComponent,
AddressSelectComponent,
AddressComponent,
SavedAddressComponent,
PaymentComponent,
PaymentMethodComponent,
SavedPaymentMethodsComponent,
AccountingComponent,
OrderSummaryComponent,
PurchaseBasketComponent,
PrivacyPolicyComponent,
ChallengeStatusBadgeComponent,
WalletComponent,
OrderHistoryComponent,
DeliveryMethodComponent,
PhotoWallComponent,
DeluxeUserComponent,
FeedbackDetailsComponent,
CodeSnippetComponent,
CodeAreaComponent,
CodeFixesComponent
],
imports: [
BrowserModule,
Routing,
TranslateModule.forRoot(
{
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}
),
CookieModule.forRoot(),
MatPasswordStrengthModule.forRoot(),
FlexLayoutModule,
HttpClientModule,
ReactiveFormsModule,
BrowserAnimationsModule,
SlideshowModule,
QRCodeModule,
FileUploadModule,
ClipboardModule,
NgxSpinnerModule,
MatToolbarModule,
MatIconModule,
FormsModule,
MatFormFieldModule,
MatSelectModule,
MatButtonModule,
MatSidenavModule,
MatTableModule,
MatPaginatorModule,
MatCardModule,
MatInputModule,
MatCheckboxModule,
MatDialogModule,
MatDividerModule,
MatDatepickerModule,
MatNativeDateModule,
MatExpansionModule,
MatProgressBarModule,
MatTooltipModule,
MatMenuModule,
MatListModule,
MatButtonToggleModule,
LayoutModule,
MatGridListModule,
NgMatSearchBarModule,
MatBadgeModule,
MatRadioModule,
MatSnackBarModule,
MatSliderModule,
MatTabsModule,
MatSlideToggleModule,
MatChipsModule,
NgxTextDiffModule,
HighlightModule,
ScoreBoardModule
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: RequestInterceptor,
multi: true
},
{
provide: HIGHLIGHT_OPTIONS,
useValue: {
coreLibraryLoader: async () => await import('highlight.js/lib/core'),
lineNumbersLoader: async () => await import('highlightjs-line-numbers.js'),
languages: {
typescript: async () => await import('highlight.js/lib/languages/typescript'),
javascript: async () => await import('highlight.js/lib/languages/javascript'),
yaml: async () => await import('highlight.js/lib/languages/yaml')
}
}
},
ProductService,
ConfigurationService,
AdministrationService,
SecurityQuestionService,
DataSubjectService,
UserService,
SecurityAnswerService,
CaptchaService,
FeedbackService,
WindowRefService,
ProductReviewService,
ComplaintService,
ChatbotService,
TrackOrderService,
RecycleService,
BasketService,
ChallengeService,
CookieService,
AdminGuard,
LoginGuard,
PaymentService,
AccountingGuard,
DeluxeGuard,
ImageCaptchaService,
KeysService,
AddressService,
QuantityService,
WalletService,
OrderHistoryService,
DeliveryService,
PhotoWallService,
FeatureFlagService
],
bootstrap: [AppComponent]
})
export class AppModule {
constructor (public configurationService: ConfigurationService, public overlayContainer: OverlayContainer) {
configurationService.getApplicationConfiguration().subscribe((conf) => {
overlayContainer.getContainerElement().classList.add(conf.application.theme + '-theme')
})
}
}