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 ef9b225da..701b675c5 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 @@ -28,7 +28,7 @@
- {{ 'user-profile-screen.actions.change-password' | translate }} + {{ 'user-profile-screen.actions.change-password' | translate }}
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 ca4347707..f1a736a95 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,11 +1,9 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; -import { DomSanitizer } from '@angular/platform-browser'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; -import { BaseFormComponent, getConfig, IqserPermissionsService, LanguageService, LoadingService, Toaster } from '@iqser/common-ui'; -import { TenantsService } from '@iqser/common-ui/lib/tenants'; +import { BaseFormComponent, IqserPermissionsService, LanguageService, LoadingService, Toaster } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; -import { AppConfig, IProfile } from '@red/domain'; +import { IProfile } from '@red/domain'; import { languagesTranslations } from '@translations/languages-translations'; import { Roles } from '@users/roles'; import { UserPreferenceService } from '@users/user-preference.service'; @@ -22,10 +20,8 @@ export class UserProfileScreenComponent extends BaseFormComponent implements OnI #profileModel: IProfile; readonly translations = languagesTranslations; readonly devMode = this._userPreferenceService.isIqserDevMode; - readonly changePasswordUrl: string; constructor( - domSanitizer: DomSanitizer, private readonly _userService: UserService, private readonly _loadingService: LoadingService, private readonly _dialogService: UserProfileDialogService, @@ -39,9 +35,6 @@ export class UserProfileScreenComponent extends BaseFormComponent implements OnI ) { super(); this._loadingService.start(); - const tenant = inject(TenantsService).activeTenantId; - const realmUrl = `${getConfig().OAUTH_URL}/realms/${tenant}`; - this.changePasswordUrl = `${realmUrl}/account/password`; } get languageChanged(): boolean { @@ -115,6 +108,10 @@ export class UserProfileScreenComponent extends BaseFormComponent implements OnI } } + async resetPassword() { + await this._userService.createResetPasswordAction(); + } + private _getForm(): UntypedFormGroup { return this._formBuilder.group({ email: ['', [Validators.required, Validators.email]], diff --git a/libs/common-ui b/libs/common-ui index 7b29cc5f3..a2d30f0a6 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 7b29cc5f317838df075a939f2679bd899ef843bf +Subproject commit a2d30f0a652650325eba1c333a2790527d054c08