diff --git a/src/app/app.config.ts b/src/app/app.config.ts new file mode 100644 index 00000000..2afeaf8c --- /dev/null +++ b/src/app/app.config.ts @@ -0,0 +1,34 @@ +import { provideHttpClient } from '@angular/common/http'; +import { ApplicationConfig, importProvidersFrom } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { provideAnimations } from '@angular/platform-browser/animations'; +import { + PreloadAllModules, + provideRouter, + withPreloading +} from '@angular/router'; + +import { provideIcon } from '@igo2/common/icon'; +import { IgoCoreModule } from '@igo2/core'; +import { provideConfig } from '@igo2/core/config'; +import { provideTranslation } from '@igo2/core/language'; +import { provideNavigationTitle } from '@igo2/sdg'; + +import { environment } from '../environments'; +import { routes } from './app.routes'; + +export const appConfig: ApplicationConfig = { + providers: [ + importProvidersFrom(BrowserModule, IgoCoreModule), + provideHttpClient(), + provideAnimations(), + provideRouter(routes, withPreloading(PreloadAllModules)), + provideConfig({ + default: { ...environment, ...environment.igo }, + path: './config/config.json' + }), + provideTranslation(), + provideNavigationTitle(), + provideIcon() + ] +}; diff --git a/src/app/pages/about/about-sub-page/about-sub-page.component.spec.ts b/src/app/pages/about/about-sub-page/about-sub-page.component.spec.ts index d60a442d..b77e86b3 100644 --- a/src/app/pages/about/about-sub-page/about-sub-page.component.spec.ts +++ b/src/app/pages/about/about-sub-page/about-sub-page.component.spec.ts @@ -9,9 +9,8 @@ describe('AboutSubPageComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [AboutSubPageComponent] - }) - .compileComponents(); - + }).compileComponents(); + fixture = TestBed.createComponent(AboutSubPageComponent); component = fixture.componentInstance; fixture.detectChanges(); diff --git a/src/app/pages/contact-us/contact-us.component.spec.ts b/src/app/pages/contact-us/contact-us.component.spec.ts index 4f2b7f9b..a7308cfc 100644 --- a/src/app/pages/contact-us/contact-us.component.spec.ts +++ b/src/app/pages/contact-us/contact-us.component.spec.ts @@ -9,9 +9,8 @@ describe('ContactUsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ContactUsComponent] - }) - .compileComponents(); - + }).compileComponents(); + fixture = TestBed.createComponent(ContactUsComponent); component = fixture.componentInstance; fixture.detectChanges(); diff --git a/src/config/config.json b/src/config/config.json index 9ff3fe41..2120a726 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -19,8 +19,6 @@ "url": "/apis/ogre" }, "language": { - "prefix": [ - "./locale/" - ] + "prefix": ["./locale/"] } -} \ No newline at end of file +} diff --git a/src/contexts/_default.json b/src/contexts/_default.json index f2282c3a..66f95d8d 100644 --- a/src/contexts/_default.json +++ b/src/contexts/_default.json @@ -55,9 +55,7 @@ { "title": "Group 1 Title", "name": "1", - "ids": [ - "id1" - ] + "ids": ["id1"] } ], "bundles": [ @@ -106,4 +104,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/locale/en.json b/src/locale/en.json index 68ef7cdf..3af689cd 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -62,4 +62,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/locale/fr.json b/src/locale/fr.json index 8f3af3b4..3ea456fd 100644 --- a/src/locale/fr.json +++ b/src/locale/fr.json @@ -62,4 +62,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/main.ts b/src/main.ts index af53ecb6..7b32d292 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,47 +1,14 @@ -import { provideHttpClient } from '@angular/common/http'; -import { enableProdMode, importProvidersFrom } from '@angular/core'; -import { MatTooltipDefaultOptions } from '@angular/material/tooltip'; -import { BrowserModule, bootstrapApplication } from '@angular/platform-browser'; -import { provideAnimations } from '@angular/platform-browser/animations'; -import { - PreloadAllModules, - provideRouter, - withPreloading -} from '@angular/router'; - -import { provideIcon } from '@igo2/common/icon'; -import { IgoCoreModule } from '@igo2/core'; -import { provideConfig } from '@igo2/core/config'; -import { provideTranslation } from '@igo2/core/language'; -import { provideNavigationTitle } from '@igo2/sdg'; +import { enableProdMode } from '@angular/core'; +import { bootstrapApplication } from '@angular/platform-browser'; import { AppComponent } from './app/app.component'; -import { routes } from './app/app.routes'; +import { appConfig } from './app/app.config'; import { environment } from './environments/environment'; if (environment.production) { enableProdMode(); } -export const defaultTooltipOptions: MatTooltipDefaultOptions = { - showDelay: 500, - hideDelay: 0, - touchendHideDelay: 0, - disableTooltipInteractivity: true -}; - -bootstrapApplication(AppComponent, { - providers: [ - importProvidersFrom(BrowserModule, IgoCoreModule), - provideHttpClient(), - provideAnimations(), - provideRouter(routes, withPreloading(PreloadAllModules)), - provideConfig({ - default: { ...environment, ...environment.igo }, - path: './config/config.json' - }), - provideTranslation(), - provideNavigationTitle(), - provideIcon() - ] -}).catch((err) => console.log(err)); +bootstrapApplication(AppComponent, appConfig).catch((err) => + console.error(err) +);