1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-18 15:47:57 +01:00

[PM-10326] Hide 'remove' option for organization managed members (#11874)

* Hide 'remove' option for organization managed members

* Refactor member component to conditionally show remove and delete buttons based on account deprovisioning feature flag

* Refactor member dialog component to conditionally show remove and delete buttons based on account deprovisioning feature flag

* Refactor member dialog and members components to simplify conditional rendering of remove and delete buttons based on account deprovisioning feature flag
This commit is contained in:
Rui Tomé 2024-11-11 10:51:13 +00:00 committed by GitHub
parent 2bbe4d2cba
commit 19046aa033
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 4 deletions

View File

@ -262,7 +262,9 @@
{{ "revokeAccess" | i18n }}
</button>
<button
*ngIf="editMode"
*ngIf="
editMode && (!(accountDeprovisioningEnabled$ | async) || !params.managedByOrganization)
"
type="button"
bitIconButton="bwi-close"
buttonType="danger"
@ -272,7 +274,9 @@
[disabled]="loading"
></button>
<button
*ngIf="editMode && params.managedByOrganization === true"
*ngIf="
editMode && (accountDeprovisioningEnabled$ | async) && params.managedByOrganization
"
type="button"
bitIconButton="bwi-trash"
buttonType="danger"

View File

@ -29,6 +29,8 @@ import { PermissionsApi } from "@bitwarden/common/admin-console/models/api/permi
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { ProductTierType } from "@bitwarden/common/billing/enums";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { DialogService, ToastService } from "@bitwarden/components";
@ -125,6 +127,10 @@ export class MemberDialogComponent implements OnDestroy {
manageResetPassword: false,
});
protected accountDeprovisioningEnabled$: Observable<boolean> = this.configService.getFeatureFlag$(
FeatureFlag.AccountDeprovisioning,
);
private destroy$ = new Subject<void>();
get customUserTypeSelected(): boolean {
@ -145,6 +151,7 @@ export class MemberDialogComponent implements OnDestroy {
private accountService: AccountService,
organizationService: OrganizationService,
private toastService: ToastService,
private configService: ConfigService,
) {
this.organization$ = organizationService
.get$(this.params.organizationId)

View File

@ -315,13 +315,18 @@
<i aria-hidden="true" class="bwi bwi-minus-circle"></i>
{{ "revokeAccess" | i18n }}
</button>
<button type="button" bitMenuItem (click)="remove(u)">
<button
*ngIf="!(accountDeprovisioningEnabled$ | async) || !u.managedByOrganization"
type="button"
bitMenuItem
(click)="remove(u)"
>
<span class="tw-text-danger">
<i aria-hidden="true" class="bwi bwi-close"></i> {{ "remove" | i18n }}
</span>
</button>
<button
*ngIf="u.managedByOrganization === true"
*ngIf="(accountDeprovisioningEnabled$ | async) && u.managedByOrganization"
type="button"
bitMenuItem
(click)="deleteUser(u)"

View File

@ -102,6 +102,10 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
FeatureFlag.EnableUpgradePasswordManagerSub,
);
protected accountDeprovisioningEnabled$: Observable<boolean> = this.configService.getFeatureFlag$(
FeatureFlag.AccountDeprovisioning,
);
// Fixed sizes used for cdkVirtualScroll
protected rowHeight = 62;
protected rowHeightClass = `tw-h-[62px]`;