Skip to content

Commit 509b578

Browse files
committed
Reorganized code of client/app/main.ts to improve its readability
1 parent 1756614 commit 509b578

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+32
-31
lines changed

client/app/main.ts

+32-31
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
2-
3-
const translationModule = TranslateModule.forRoot({
4-
loader: {
5-
provide: TranslateLoader,
6-
useFactory: createTranslateLoader,
7-
deps: [HttpClient],
8-
},
9-
})
10-
;
11-
121
// https://github.com/globaleaks/GlobaLeaks/issues/3277
132
// Create a proxy to override localStorage methods with sessionStorage methods
143
(function() {
@@ -50,30 +39,39 @@ import { FormsModule } from "@angular/forms";
5039
import { NgIdleKeepaliveModule } from "@ng-idle/keepalive";
5140
import { MarkdownModule, MARKED_OPTIONS } from "ngx-markdown";
5241
import { AppComponent, createTranslateLoader } from "@app/pages/app/app.component";
53-
import { importProvidersFrom } from "@angular/core";
54-
import Flow from "@flowjs/flow.js";
55-
import {provideRouter} from "@angular/router";
56-
57-
58-
import { ApplicationRef } from '@angular/core';
42+
import { provideRouter } from "@angular/router";
43+
import { ApplicationRef, importProvidersFrom } from '@angular/core';
5944
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
60-
45+
import Flow from "@flowjs/flow.js";
6146

6247
bootstrapApplication(AppComponent, {
6348
providers: [
6449
provideRouter(appRoutes),
65-
importProvidersFrom(NgbModule, BrowserModule, translationModule, NgSelectModule, FormsModule, NgbTooltipModule, NgIdleKeepaliveModule.forRoot(), MarkdownModule.forRoot({
66-
markedOptions: {
67-
provide: MARKED_OPTIONS,
68-
useFactory: (rendererService: MarkdownRendererService) => ({
69-
breaks: true,
70-
renderer: rendererService.getCustomRenderer(),
71-
}),
72-
deps: [MarkdownRendererService]
73-
}
74-
}), NgxFlowModule, NgOptimizedImage),
75-
ReceiptValidatorDirective,
76-
TranslatorPipe, TranslateService,
50+
importProvidersFrom(NgbModule,
51+
BrowserModule,
52+
NgSelectModule,
53+
NgxFlowModule,
54+
NgOptimizedImage,
55+
FormsModule,
56+
NgbTooltipModule,
57+
NgIdleKeepaliveModule.forRoot(),
58+
MarkdownModule.forRoot({
59+
markedOptions: {
60+
provide: MARKED_OPTIONS,
61+
useFactory: (rendererService: MarkdownRendererService) => ({
62+
breaks: true,
63+
renderer: rendererService.getCustomRenderer(),
64+
}),
65+
deps: [MarkdownRendererService]
66+
}
67+
}),
68+
TranslateModule.forRoot({
69+
loader: {
70+
provide: TranslateLoader,
71+
useFactory: createTranslateLoader,
72+
deps: [HttpClient],
73+
},
74+
})),
7775
{ provide: APP_BASE_HREF, useValue: "/" },
7876
{ provide: HTTP_INTERCEPTORS, useClass: appInterceptor, multi: true },
7977
{ provide: HTTP_INTERCEPTORS, useClass: ErrorCatchingInterceptor, multi: true },
@@ -96,8 +94,11 @@ bootstrapApplication(AppComponent, {
9694
}
9795
},
9896
{ provide: 'MockEngine', useValue: mockEngine },
97+
ReceiptValidatorDirective,
98+
TranslatorPipe,
99+
TranslateService,
99100
provideHttpClient(withInterceptorsFromDi()),
100-
provideAnimations(),
101+
provideAnimations()
101102
]
102103
}).then(moduleRef => {
103104
// Expose Angular stability status to Cypress
-13.8 KB
3.6 KB
458 Bytes
-8.33 KB
-9.83 KB
-18.3 KB
-12.6 KB
-7.17 KB
-16.5 KB
-9.71 KB
7.12 KB

documentation/images/admin/tor.en.png

-18.5 KB
-9.51 KB
-15.2 KB
-8.57 KB
747 Bytes
-4.26 KB
695 Bytes
-4.25 KB
21.4 KB
-51.4 KB
2.13 KB
-14.3 KB

documentation/images/user/2fa.en.png

-10.5 KB
-4.77 KB
-1018 Bytes
-698 Bytes
-779 Bytes
-16.7 KB
-37.1 KB
-340 Bytes

documentation/images/wizard/1.en.png

-147 Bytes

documentation/images/wizard/2.en.png

-4.63 KB

documentation/images/wizard/3.en.png

2.58 KB

documentation/images/wizard/4.en.png

-6.36 KB

documentation/images/wizard/5.en.png

7.66 KB

documentation/images/wizard/6.en.png

5.04 KB

0 commit comments

Comments
 (0)