mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00: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:
@@ -262,7 +262,9 @@
|
|||||||
{{ "revokeAccess" | i18n }}
|
{{ "revokeAccess" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngIf="editMode"
|
*ngIf="
|
||||||
|
editMode && (!(accountDeprovisioningEnabled$ | async) || !params.managedByOrganization)
|
||||||
|
"
|
||||||
type="button"
|
type="button"
|
||||||
bitIconButton="bwi-close"
|
bitIconButton="bwi-close"
|
||||||
buttonType="danger"
|
buttonType="danger"
|
||||||
@@ -272,7 +274,9 @@
|
|||||||
[disabled]="loading"
|
[disabled]="loading"
|
||||||
></button>
|
></button>
|
||||||
<button
|
<button
|
||||||
*ngIf="editMode && params.managedByOrganization === true"
|
*ngIf="
|
||||||
|
editMode && (accountDeprovisioningEnabled$ | async) && params.managedByOrganization
|
||||||
|
"
|
||||||
type="button"
|
type="button"
|
||||||
bitIconButton="bwi-trash"
|
bitIconButton="bwi-trash"
|
||||||
buttonType="danger"
|
buttonType="danger"
|
||||||
|
|||||||
@@ -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 { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
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 { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { DialogService, ToastService } from "@bitwarden/components";
|
import { DialogService, ToastService } from "@bitwarden/components";
|
||||||
|
|
||||||
@@ -125,6 +127,10 @@ export class MemberDialogComponent implements OnDestroy {
|
|||||||
manageResetPassword: false,
|
manageResetPassword: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
protected accountDeprovisioningEnabled$: Observable<boolean> = this.configService.getFeatureFlag$(
|
||||||
|
FeatureFlag.AccountDeprovisioning,
|
||||||
|
);
|
||||||
|
|
||||||
private destroy$ = new Subject<void>();
|
private destroy$ = new Subject<void>();
|
||||||
|
|
||||||
get customUserTypeSelected(): boolean {
|
get customUserTypeSelected(): boolean {
|
||||||
@@ -145,6 +151,7 @@ export class MemberDialogComponent implements OnDestroy {
|
|||||||
private accountService: AccountService,
|
private accountService: AccountService,
|
||||||
organizationService: OrganizationService,
|
organizationService: OrganizationService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
|
private configService: ConfigService,
|
||||||
) {
|
) {
|
||||||
this.organization$ = organizationService
|
this.organization$ = organizationService
|
||||||
.get$(this.params.organizationId)
|
.get$(this.params.organizationId)
|
||||||
|
|||||||
@@ -315,13 +315,18 @@
|
|||||||
<i aria-hidden="true" class="bwi bwi-minus-circle"></i>
|
<i aria-hidden="true" class="bwi bwi-minus-circle"></i>
|
||||||
{{ "revokeAccess" | i18n }}
|
{{ "revokeAccess" | i18n }}
|
||||||
</button>
|
</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">
|
<span class="tw-text-danger">
|
||||||
<i aria-hidden="true" class="bwi bwi-close"></i> {{ "remove" | i18n }}
|
<i aria-hidden="true" class="bwi bwi-close"></i> {{ "remove" | i18n }}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngIf="u.managedByOrganization === true"
|
*ngIf="(accountDeprovisioningEnabled$ | async) && u.managedByOrganization"
|
||||||
type="button"
|
type="button"
|
||||||
bitMenuItem
|
bitMenuItem
|
||||||
(click)="deleteUser(u)"
|
(click)="deleteUser(u)"
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
|
|||||||
FeatureFlag.EnableUpgradePasswordManagerSub,
|
FeatureFlag.EnableUpgradePasswordManagerSub,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected accountDeprovisioningEnabled$: Observable<boolean> = this.configService.getFeatureFlag$(
|
||||||
|
FeatureFlag.AccountDeprovisioning,
|
||||||
|
);
|
||||||
|
|
||||||
// Fixed sizes used for cdkVirtualScroll
|
// Fixed sizes used for cdkVirtualScroll
|
||||||
protected rowHeight = 62;
|
protected rowHeight = 62;
|
||||||
protected rowHeightClass = `tw-h-[62px]`;
|
protected rowHeightClass = `tw-h-[62px]`;
|
||||||
|
|||||||
Reference in New Issue
Block a user