Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
alecarn committed May 23, 2024
1 parent ccb7f54 commit 6fd1988
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 55 deletions.
34 changes: 34 additions & 0 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -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()
]
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ describe('AboutSubPageComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AboutSubPageComponent]
})
.compileComponents();

}).compileComponents();

fixture = TestBed.createComponent(AboutSubPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down
5 changes: 2 additions & 3 deletions src/app/pages/contact-us/contact-us.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ describe('ContactUsComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ContactUsComponent]
})
.compileComponents();

}).compileComponents();

fixture = TestBed.createComponent(ContactUsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down
6 changes: 2 additions & 4 deletions src/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
"url": "/apis/ogre"
},
"language": {
"prefix": [
"./locale/"
]
"prefix": ["./locale/"]
}
}
}
6 changes: 2 additions & 4 deletions src/contexts/_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@
{
"title": "Group 1 Title",
"name": "1",
"ids": [
"id1"
]
"ids": ["id1"]
}
],
"bundles": [
Expand Down Expand Up @@ -106,4 +104,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
}
}
}
}
}
45 changes: 6 additions & 39 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -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)
);

0 comments on commit 6fd1988

Please sign in to comment.