diff --git a/apps/desktop/src/app/app.component.ts b/apps/desktop/src/app/app.component.ts index 6277231f6d3..3ce4d57e25b 100644 --- a/apps/desktop/src/app/app.component.ts +++ b/apps/desktop/src/app/app.component.ts @@ -11,7 +11,7 @@ import { } from "@angular/core"; import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { Router } from "@angular/router"; -import { filter, firstValueFrom, map, Subject, takeUntil, timeout, withLatestFrom } from "rxjs"; +import { filter, firstValueFrom, map, Subject, switchMap, takeUntil, timeout } from "rxjs"; import { CollectionService } from "@bitwarden/admin-console/common"; import { DeviceTrustToastService } from "@bitwarden/angular/auth/services/device-trust-toast.service.abstraction"; @@ -29,7 +29,6 @@ import { UserVerificationService } from "@bitwarden/common/auth/abstractions/use import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason"; import { getUserId } from "@bitwarden/common/auth/services/account.service"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { ProcessReloadServiceAbstraction } from "@bitwarden/common/key-management/abstractions/process-reload.service"; import { KeyConnectorService } from "@bitwarden/common/key-management/key-connector/abstractions/key-connector.service"; import { MasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction"; @@ -820,27 +819,26 @@ export class AppComponent implements OnInit, OnDestroy { } private async deleteAccount() { - const userId = await firstValueFrom(getUserId(this.accountService.activeAccount$)); - await firstValueFrom( - this.configService.getFeatureFlag$(FeatureFlag.AccountDeprovisioning).pipe( - withLatestFrom(this.organizationService.organizations$(userId)), - map(async ([accountDeprovisioningEnabled, organization]) => { - if ( - accountDeprovisioningEnabled && - organization.some((o) => o.userIsManagedByOrganization === true) - ) { - await this.dialogService.openSimpleDialog({ - title: { key: "cannotDeleteAccount" }, - content: { key: "cannotDeleteAccountDesc" }, - cancelButtonText: null, - acceptButtonText: { key: "close" }, - type: "danger", - }); - } else { - DeleteAccountComponent.open(this.dialogService); - } - }), + const userIsManaged = await firstValueFrom( + this.accountService.activeAccount$.pipe( + getUserId, + switchMap((userId) => this.organizationService.organizations$(userId)), + map((orgs) => orgs.some((o) => o.userIsManagedByOrganization === true)), ), ); + + if (userIsManaged) { + await this.dialogService.openSimpleDialog({ + title: { key: "cannotDeleteAccount" }, + content: { key: "cannotDeleteAccountDesc" }, + cancelButtonText: null, + acceptButtonText: { key: "close" }, + type: "danger", + }); + + return; + } + + DeleteAccountComponent.open(this.dialogService); } } diff --git a/apps/web/src/app/admin-console/common/base-members.component.ts b/apps/web/src/app/admin-console/common/base-members.component.ts index 1ecf122e429..488af7ee518 100644 --- a/apps/web/src/app/admin-console/common/base-members.component.ts +++ b/apps/web/src/app/admin-console/common/base-members.component.ts @@ -50,11 +50,15 @@ export abstract class BaseMembersComponent { } get showBulkConfirmUsers(): boolean { - return this.dataSource.acceptedUserCount > 0; + return this.dataSource + .getCheckedUsers() + .every((member) => member.status == this.userStatusType.Accepted); } get showBulkReinviteUsers(): boolean { - return this.dataSource.invitedUserCount > 0; + return this.dataSource + .getCheckedUsers() + .every((member) => member.status == this.userStatusType.Invited); } abstract userType: typeof OrganizationUserType | typeof ProviderUserType; diff --git a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html index fec790dabcb..ad3879b3659 100644 --- a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html +++ b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html @@ -115,7 +115,7 @@ *ngIf="canAccessExport$ | async" > diff --git a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts index ec67a17bce9..9c3912b98fd 100644 --- a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts +++ b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts @@ -55,7 +55,6 @@ export class OrganizationLayoutComponent implements OnInit { protected readonly logo = AdminConsoleLogo; protected orgFilter = (org: Organization) => canAccessOrgAdmin(org); - protected domainVerificationNavigationTextKey: string; protected integrationPageEnabled$: Observable; @@ -146,12 +145,6 @@ export class OrganizationLayoutComponent implements OnInit { this.integrationPageEnabled$ = this.organization$.pipe(map((org) => org.canAccessIntegrations)); - this.domainVerificationNavigationTextKey = (await this.configService.getFeatureFlag( - FeatureFlag.AccountDeprovisioning, - )) - ? "claimedDomains" - : "domainVerification"; - this.canShowPoliciesTab$ = this.organization$.pipe( switchMap((organization) => this.organizationBillingService diff --git a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-delete-dialog.component.ts b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-delete-dialog.component.ts index 27caea3ebd3..51ba98fabb9 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-delete-dialog.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-delete-dialog.component.ts @@ -1,12 +1,9 @@ // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore import { Component, Inject } from "@angular/core"; -import { firstValueFrom } from "rxjs"; import { OrganizationUserApiService } from "@bitwarden/admin-console/common"; import { OrganizationUserStatusType } from "@bitwarden/common/admin-console/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 { DIALOG_DATA, DialogConfig, DialogService } from "@bitwarden/components"; @@ -35,7 +32,6 @@ export class BulkDeleteDialogComponent { @Inject(DIALOG_DATA) protected dialogParams: BulkDeleteDialogParams, protected i18nService: I18nService, private organizationUserApiService: OrganizationUserApiService, - private configService: ConfigService, private deleteManagedMemberWarningService: DeleteManagedMemberWarningService, ) { this.organizationId = dialogParams.organizationId; @@ -43,11 +39,7 @@ export class BulkDeleteDialogComponent { } async submit() { - if ( - await firstValueFrom(this.configService.getFeatureFlag$(FeatureFlag.AccountDeprovisioning)) - ) { - await this.deleteManagedMemberWarningService.acknowledgeWarning(this.organizationId); - } + await this.deleteManagedMemberWarningService.acknowledgeWarning(this.organizationId); try { this.loading = true; diff --git a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.html b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.html index 4925c210039..1b711b366d6 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.html +++ b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.html @@ -1,12 +1,6 @@ - + - {{ bulkMemberTitle }} - - {{ bulkTitle }} - + {{ bulkTitle }}
@@ -20,7 +14,7 @@ {{ "nonCompliantMembersError" | i18n }} @@ -50,7 +44,7 @@ - {{ (accountDeprovisioning.enabled ? "member" : "user") | i18n }} + {{ "member" | i18n }} {{ "details" | i18n }} @@ -82,7 +76,7 @@ - {{ (accountDeprovisioning.enabled ? "member" : "user") | i18n }} + {{ "member" | i18n }} {{ "status" | i18n }} @@ -113,7 +107,7 @@ [bitAction]="submit" buttonType="primary" > - {{ accountDeprovisioning.enabled ? bulkMemberTitle : bulkTitle }} + {{ bulkTitle }} -

+

{{ "claimedDomainsDesc" | i18n }} {{ - ((accountDeprovisioningEnabled$ | async) - ? "domainStatusUnderVerification" - : "domainStatusUnverified" - ) | i18n + "domainStatusUnderVerification" | i18n }} {{ - ((accountDeprovisioningEnabled$ | async) - ? "domainStatusClaimed" - : "domainStatusVerified" - ) | i18n + "domainStatusClaimed" | i18n }} @@ -94,10 +84,7 @@ type="button" > - {{ - ((accountDeprovisioningEnabled$ | async) ? "claimDomain" : "verifyDomain") - | i18n - }} + {{ "claimDomain" | i18n }}