diff --git a/libs/portal-integration-angular/src/index.ts b/libs/portal-integration-angular/src/index.ts index 339d1a37..afe00173 100644 --- a/libs/portal-integration-angular/src/index.ts +++ b/libs/portal-integration-angular/src/index.ts @@ -89,7 +89,6 @@ export * from './lib/model/person.model' export * from './lib/model/page-info.model' export * from './lib/model/portal' export * from './lib/model/user-profile.model' -export * from './lib/model/user-profile.model' export * from './lib/model/data-table-column.model' export * from './lib/model/column-type.model' export * from './lib/model/data-sort-direction' diff --git a/libs/portal-integration-angular/src/lib/core/portal-core.module.ts b/libs/portal-integration-angular/src/lib/core/portal-core.module.ts index 94bfd1e4..fbedfd83 100644 --- a/libs/portal-integration-angular/src/lib/core/portal-core.module.ts +++ b/libs/portal-integration-angular/src/lib/core/portal-core.module.ts @@ -56,7 +56,6 @@ import { HelpItemEditorComponent } from './components/help-item-editor/help-item import { NoHelpItemComponent } from './components/no-help-item/no-help-item.component' import { DataListGridComponent } from './components/data-list-grid/data-list-grid.component' import { PrimeNgModule } from './primeng.module' -import { MockAuthService } from '../mock-auth/mock-auth.service' import { ConfirmDialogModule } from 'primeng/confirmdialog' import { DataTableComponent } from './components/data-table/data-table.component' import de from '@angular/common/locales/de' @@ -167,7 +166,6 @@ export class MyMissingTranslationHandler implements MissingTranslationHandler { ], providers: [ ConfigurationService, - MockAuthService, { provide: LOCALE_ID, useFactory: (translate: TranslateService) => { diff --git a/libs/portal-integration-angular/src/lib/core/utils/create-translate-loader.utils.ts b/libs/portal-integration-angular/src/lib/core/utils/create-translate-loader.utils.ts index 7a09e908..a33296b8 100644 --- a/libs/portal-integration-angular/src/lib/core/utils/create-translate-loader.utils.ts +++ b/libs/portal-integration-angular/src/lib/core/utils/create-translate-loader.utils.ts @@ -1,3 +1,4 @@ +import { Location } from '@angular/common' import { HttpClient } from '@angular/common/http' import { TranslateLoader } from '@ngx-translate/core' import { TranslateHttpLoader } from '@ngx-translate/http-loader' @@ -12,9 +13,16 @@ export function createTranslateLoader(http: HttpClient, appStateService: AppStat filter(([, isLoading]) => !isLoading), map(([currentMfe]) => { return new TranslateCombinedLoader( - new TranslateHttpLoader(http, `${currentMfe.remoteBaseUrl}/assets/i18n/`, '.json'), + // translations of shell or of app in standalone mode new TranslateHttpLoader(http, `./assets/i18n/`, '.json'), - new TranslateHttpLoader(http, `./onecx-portal-lib/assets/i18n/`, '.json') + // translations of portal-integration-angular of app + new TranslateHttpLoader( + http, + Location.joinWithSlash(currentMfe.remoteBaseUrl, `onecx-portal-lib/assets/i18n/`), + '.json' + ), + // translations of the app + new TranslateHttpLoader(http, Location.joinWithSlash(currentMfe.remoteBaseUrl, `assets/i18n/`), '.json') ) }) ) diff --git a/libs/portal-integration-angular/src/lib/core/utils/portal-api-configuration.utils.ts b/libs/portal-integration-angular/src/lib/core/utils/portal-api-configuration.utils.ts index 463bf790..fbfe0fc3 100644 --- a/libs/portal-integration-angular/src/lib/core/utils/portal-api-configuration.utils.ts +++ b/libs/portal-integration-angular/src/lib/core/utils/portal-api-configuration.utils.ts @@ -5,6 +5,7 @@ import { ConfigurationService } from '../../services/configuration.service' type Config = { credentials: { [key: string]: string | (() => string | undefined) } + encodeParam: (param: unknown) => string selectHeaderContentType(contentTypes: string[]): string | undefined selectHeaderAccept(accepts: string[]): string | undefined isJsonMime(mime: string): boolean @@ -29,6 +30,13 @@ export class PortalApiConfiguration { this.configuration.credentials = value } + get encodeParam(): (param: unknown) => string { + return this.configuration.encodeParam + } + set encocdeParam(value: (param: unknown) => string) { + this.configuration.encodeParam = value + } + constructor( private configurationClassOfGenerator: unknown, private apiPrefix: string, diff --git a/libs/portal-integration-angular/src/lib/services/initialize-module-guard.service.ts b/libs/portal-integration-angular/src/lib/services/initialize-module-guard.service.ts index 151e975d..91ea3113 100644 --- a/libs/portal-integration-angular/src/lib/services/initialize-module-guard.service.ts +++ b/libs/portal-integration-angular/src/lib/services/initialize-module-guard.service.ts @@ -6,7 +6,7 @@ import { AppStateService } from './app-state.service' import { ConfigurationService } from './configuration.service' import { UserService } from './user.service' -@Injectable() +@Injectable({ providedIn: 'any' }) export class InitializeModuleGuard implements CanActivate { private SUPPORTED_LANGS = ['en', 'de'] private DEFAULT_LANG = 'en' diff --git a/update-guide.md b/update-guide.md index 23c8e749..57ae2be8 100644 --- a/update-guide.md +++ b/update-guide.md @@ -22,7 +22,12 @@ - .getCurrentUser(), .getUserRoles() and to get other user related data is now done with userService.profile$ ## ConfigurationService -- lang and lang$ are now defined in UserService as lang$ +- lang and lang$ are now defined in UserService as lang$: BehaviorSubject and to get the value use: +``` +userService.lang$.getValue() +or +userService.lang$.value +``` - to get the portal ID use: ``` configService.getProperty(CONFIG_KEY.TKIT_PORTAL_ID) @@ -52,7 +57,7 @@ await appStateService.currentPortal$.publish(Portal) loader: { provide: TranslateLoader, useFactory: createTranslateLoader, - deps: [HttpClient, AppStateService, ConfigurationService], + deps: [HttpClient, AppStateService], }, ```