diff --git a/package-lock.json b/package-lock.json index 92535ed..d2ab9fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "@popperjs/core": "^2.11.8", "@sentry/browser": "^5.20.1", "@worldskills/bootstrap": "^4.10.1", - "@worldskills/worldskills-angular-lib": "^14.0.1", + "@worldskills/worldskills-angular-lib": "^14.0.2", "angular-oauth2-oidc": "^19.0.0", "jquery": "^3.5.1", "json2typescript": "^1.4.1", @@ -5913,9 +5913,9 @@ } }, "node_modules/@worldskills/worldskills-angular-lib": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/@worldskills/worldskills-angular-lib/-/worldskills-angular-lib-14.0.1.tgz", - "integrity": "sha512-rAp8oUn2VcjGmhoZcOKw2vF1cR/unR1XexaUXpK6NwfVQEDLq9wu0ELNptaBnaLMCBmRrx0oSNG5l8NqQucuzQ==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@worldskills/worldskills-angular-lib/-/worldskills-angular-lib-14.0.2.tgz", + "integrity": "sha512-W8H8zGKEfOEvrYnq4IsN0rovb6+TcjkpqHwNrZKm8gATWAHS+4FO8Vipu3GKOnx/r4yjI9GVQr0QsaLRvNw0fQ==", "dependencies": { "tslib": "^2.4.1" }, @@ -5924,8 +5924,8 @@ "@angular/core": "^15.1.1", "@ng-bootstrap/ng-bootstrap": "^18.0.0", "@ng-select/ng-select": "^10.0.3", - "@ngx-translate/core": "^13.0.0", - "@ngx-translate/http-loader": "^6.0.0", + "@ngx-translate/core": "^16.0.4", + "@ngx-translate/http-loader": "^16.0.1", "@sentry/browser": "^7.32.0", "@worldskills/bootstrap": "^4.10.1", "angular-oauth2-oidc": "^15.0.1", @@ -20789,9 +20789,9 @@ } }, "@worldskills/worldskills-angular-lib": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/@worldskills/worldskills-angular-lib/-/worldskills-angular-lib-14.0.1.tgz", - "integrity": "sha512-rAp8oUn2VcjGmhoZcOKw2vF1cR/unR1XexaUXpK6NwfVQEDLq9wu0ELNptaBnaLMCBmRrx0oSNG5l8NqQucuzQ==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@worldskills/worldskills-angular-lib/-/worldskills-angular-lib-14.0.2.tgz", + "integrity": "sha512-W8H8zGKEfOEvrYnq4IsN0rovb6+TcjkpqHwNrZKm8gATWAHS+4FO8Vipu3GKOnx/r4yjI9GVQr0QsaLRvNw0fQ==", "requires": { "tslib": "^2.4.1" } diff --git a/package.json b/package.json index 5c23e9e..d19a195 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@popperjs/core": "^2.11.8", "@sentry/browser": "^5.20.1", "@worldskills/bootstrap": "^4.10.1", - "@worldskills/worldskills-angular-lib": "^14.0.1", + "@worldskills/worldskills-angular-lib": "^14.0.2", "angular-oauth2-oidc": "^19.0.0", "jquery": "^3.5.1", "json2typescript": "^1.4.1", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6a9656a..65042f4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,6 +1,6 @@ import {BrowserModule} from '@angular/platform-browser'; import {NgModule} from '@angular/core'; -import {AlertsComponent, WorldskillsAngularLibModule, WsHttpInterceptor} from '@worldskills/worldskills-angular-lib'; +import {WorldskillsAngularLibModule, WsHttpInterceptor} from '@worldskills/worldskills-angular-lib'; import {TranslateHttpLoader} from '@ngx-translate/http-loader'; import {AppRoutingModule} from './app-routing.module'; import {AppComponent} from './app.component'; @@ -10,12 +10,11 @@ import {OAuthModule} from 'angular-oauth2-oidc'; import {FontAwesomeModule} from '@fortawesome/angular-fontawesome'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {TranslateLoader, TranslateModule} from '@ngx-translate/core'; -import { HTTP_INTERCEPTORS, HttpClient } from '@angular/common/http'; +import { HTTP_INTERCEPTORS, HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import {NgSelectModule} from '@ng-select/ng-select'; import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; import {CommonModule, DatePipe} from '@angular/common'; import {HttpInterceptorService} from '../services/http-interceptor/http-interceptor.service'; -import {WsSpinnerComponent} from './ws-spinner/ws-spinner.component'; import {EventsComponent} from './events/events.component'; import {EventsSearchFormComponent} from './events-search-form/events-search-form.component'; import {EventComponent} from './event/event.component'; @@ -66,6 +65,15 @@ export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http); } +export const appTranslationConfig = TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: HttpLoaderFactory, + deps: [HttpClient] + }, + isolate: true // isolate property is the key point to remember/ +}); + @NgModule({ imports: [ CommonModule, @@ -74,26 +82,30 @@ export function HttpLoaderFactory(http: HttpClient) { AppRoutingModule, FormsModule, ReactiveFormsModule, + WorldskillsAngularLibModule, OAuthModule.forRoot(), - NgSelectModule, NgbModule, + NgSelectModule, FontAwesomeModule, - TranslateModule.forRoot({ - defaultLanguage: 'en', - loader: { - provide: TranslateLoader, - useFactory: HttpLoaderFactory, - deps: [HttpClient] - } - }), + appTranslationConfig, CKEditorModule, - WorldskillsAngularLibModule, ], + /* + FormsModule, + OAuthModule.forRoot(), + RouterModule.forRoot(appRoutes, routerOptions), + WorldskillsAngularLibModule, + NgbModule, + NgSelectModule, + appTranslationConfig], providers: [ + { provide: HTTP_INTERCEPTORS, useClass: WsHttpInterceptor, multi: true }, + DatePipe, + provideHttpClient(withInterceptorsFromDi()) + */ declarations: [ AppComponent, HomeComponent, ErrorComponent, - WsSpinnerComponent, EventsComponent, EventsSearchFormComponent, EventComponent, @@ -142,7 +154,9 @@ export function HttpLoaderFactory(http: HttpClient) { providers: [ DatePipe, {provide: HTTP_INTERCEPTORS, useClass: WsHttpInterceptor, multi: true}, - {provide: HTTP_INTERCEPTORS, useClass: HttpInterceptorService, multi: true} + {provide: HTTP_INTERCEPTORS, useClass: HttpInterceptorService, multi: true}, + provideHttpClient(withInterceptorsFromDi()) + ], bootstrap: [AppComponent] }) diff --git a/src/app/ws-spinner/ws-spinner.component.css b/src/app/ws-spinner/ws-spinner.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/ws-spinner/ws-spinner.component.html b/src/app/ws-spinner/ws-spinner.component.html deleted file mode 100644 index 7ae994b..0000000 --- a/src/app/ws-spinner/ws-spinner.component.html +++ /dev/null @@ -1,5 +0,0 @@ -