Skip to content

Commit 64afc78

Browse files
committed
[Account Recovery][PM-18721] feature flag AccountRecoveryDialogComponent
1 parent ecab81b commit 64afc78

File tree

2 files changed

+51
-27
lines changed

2 files changed

+51
-27
lines changed

apps/web/src/app/admin-console/organizations/members/members.component.ts

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ import { GroupApiService } from "../core";
6464
import { OrganizationUserView } from "../core/views/organization-user.view";
6565
import { openEntityEventsDialog } from "../manage/entity-events.component";
6666

67+
import {
68+
AccountRecoveryDialogComponent,
69+
AccountRecoveryDialogResult,
70+
} from "./components/account-recovery/account-recovery-dialog.component";
6771
import { BulkConfirmDialogComponent } from "./components/bulk/bulk-confirm-dialog.component";
6872
import { BulkDeleteDialogComponent } from "./components/bulk/bulk-delete-dialog.component";
6973
import { BulkEnableSecretsManagerDialogComponent } from "./components/bulk/bulk-enable-sm-dialog.component";
@@ -719,18 +723,38 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
719723
}
720724

721725
async resetPassword(user: OrganizationUserView) {
722-
const dialogRef = ResetPasswordComponent.open(this.dialogService, {
723-
data: {
724-
name: this.userNamePipe.transform(user),
725-
email: user != null ? user.email : null,
726-
organizationId: this.organization.id,
727-
id: user != null ? user.id : null,
728-
},
729-
});
726+
const changePasswordRefactorFlag = await this.configService.getFeatureFlag(
727+
FeatureFlag.PM16117_ChangeExistingPasswordRefactor,
728+
);
730729

731-
const result = await lastValueFrom(dialogRef.closed);
732-
if (result === ResetPasswordDialogResult.Ok) {
733-
await this.load();
730+
if (changePasswordRefactorFlag) {
731+
const dialogRef = AccountRecoveryDialogComponent.open(this.dialogService, {
732+
data: {
733+
name: this.userNamePipe.transform(user),
734+
email: user != null ? user.email : null,
735+
organizationId: this.organization.id,
736+
id: user != null ? user.id : null,
737+
},
738+
});
739+
740+
const result = await lastValueFrom(dialogRef.closed);
741+
if (result === AccountRecoveryDialogResult.Ok) {
742+
await this.load();
743+
}
744+
} else {
745+
const dialogRef = ResetPasswordComponent.open(this.dialogService, {
746+
data: {
747+
name: this.userNamePipe.transform(user),
748+
email: user != null ? user.email : null,
749+
organizationId: this.organization.id,
750+
id: user != null ? user.id : null,
751+
},
752+
});
753+
754+
const result = await lastValueFrom(dialogRef.closed);
755+
if (result === ResetPasswordDialogResult.Ok) {
756+
await this.load();
757+
}
734758
}
735759
}
736760

libs/auth/src/angular/input-password/input-password.component.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@
3535
type="password"
3636
formControlName="newPassword"
3737
/>
38-
<ng-container *ngIf="flow === InputPasswordFlow.ChangePasswordDelegation">
39-
<button
40-
type="button"
41-
bitIconButton="bwi-generate"
42-
bitSuffix
43-
[appA11yTitle]="'generatePassword' | i18n"
44-
(click)="generatePassword()"
45-
></button>
46-
<button
47-
type="button"
48-
bitSuffix
49-
bitIconButton="bwi-clone"
50-
appA11yTitle="{{ 'copyPassword' | i18n }}"
51-
(click)="copy()"
52-
></button>
53-
</ng-container>
38+
<button
39+
*ngIf="flow === InputPasswordFlow.ChangePasswordDelegation"
40+
type="button"
41+
bitIconButton="bwi-generate"
42+
bitSuffix
43+
[appA11yTitle]="'generatePassword' | i18n"
44+
(click)="generatePassword()"
45+
></button>
46+
<button
47+
*ngIf="flow === InputPasswordFlow.ChangePasswordDelegation"
48+
type="button"
49+
bitSuffix
50+
bitIconButton="bwi-clone"
51+
appA11yTitle="{{ 'copyPassword' | i18n }}"
52+
(click)="copy()"
53+
></button>
5454
<button
5555
type="button"
5656
bitIconButton

0 commit comments

Comments
 (0)