diff --git a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.html b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.html index 9aa65fe09..ef9b225da 100644 --- a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.html +++ b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.html @@ -16,7 +16,7 @@ -
+
diff --git a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts index 3307196e9..c439a9c1f 100644 --- a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts @@ -1,12 +1,19 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, OnInit } from '@angular/core'; import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; -import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; +import { DomSanitizer } from '@angular/platform-browser'; import { TranslateService } from '@ngx-translate/core'; -import { BaseFormComponent, IqserPermissionsService, LanguageService, LoadingService, Toaster } from '@iqser/common-ui'; -import { IProfile } from '@red/domain'; +import { + BaseFormComponent, + getConfig, + IqserPermissionsService, + LanguageService, + LoadingService, + TenantsService, + Toaster, +} from '@iqser/common-ui'; +import { AppConfig, IProfile } from '@red/domain'; import { languagesTranslations } from '@translations/languages-translations'; import { UserService } from '@users/user.service'; -import { ConfigService } from '@services/config.service'; import { firstValueFrom } from 'rxjs'; import { UserPreferenceService } from '@users/user-preference.service'; import { ROLES } from '@users/roles'; @@ -14,7 +21,6 @@ import { UserProfileDialogService } from '../services/user-profile-dialog.servic import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ - selector: 'redaction-user-profile-screen', templateUrl: './user-profile-screen.component.html', styleUrls: ['./user-profile-screen.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, @@ -22,15 +28,13 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; export class UserProfileScreenComponent extends BaseFormComponent implements OnInit { readonly translations = languagesTranslations; readonly devMode = this._userPreferenceService.areDevFeaturesEnabled; - readonly changePasswordUrl: SafeResourceUrl; + readonly changePasswordUrl: string; #profileModel: IProfile; constructor( domSanitizer: DomSanitizer, - configService: ConfigService, private readonly _userService: UserService, - readonly userPreferences: UserPreferenceService, private readonly _loadingService: LoadingService, private readonly _dialogService: UserProfileDialogService, private readonly _formBuilder: UntypedFormBuilder, @@ -43,7 +47,9 @@ export class UserProfileScreenComponent extends BaseFormComponent implements OnI ) { super(); this._loadingService.start(); - this.changePasswordUrl = domSanitizer.bypassSecurityTrustResourceUrl(`${configService.values.OAUTH_URL}/account/password`); + const tenant = inject(TenantsService).currentTenant; + const realmUrl = `${getConfig().OAUTH_URL}/realms/${tenant}`; + this.changePasswordUrl = `${realmUrl}/account/password`; } get languageChanged(): boolean { diff --git a/package.json b/package.json index 0d850a061..737a24bd3 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "build-lint-all": "ng build --project=red-ui --configuration production --base-href /ui/", "build-paligo-styles": "mkdir -p dist/paligo-styles && sass --load-path=. paligo-styles/style.scss > dist/paligo-styles/redacto-theme.css", "i18n:extract": "ngx-translate-extract --input ./apps/red-ui/src ./libs/common-ui/src --output apps/red-ui/src/assets/i18n/{redact,scm}/{en,de}.json --clean --sort --format namespaced-json && prettier apps/red-ui/src/assets/i18n/*/*.json --write", - "postinstall": "ngcc --properties es2020 browser module main", "nx": "nx", "start": "nx serve", "update": "nx migrate latest",