From be8c5f28b5807c9682abd652294a4b3746cf5892 Mon Sep 17 00:00:00 2001 From: Jonas Hendrickx Date: Wed, 26 Mar 2025 17:59:27 +0100 Subject: [PATCH] [PM-18170] Remove 'PM-15814-alert-owners-of-reseller-managed-orgs' feature flag (#13757) --- .../organizations/collections/vault.component.ts | 8 +------- .../src/app/billing/services/trial-flow.service.ts | 13 ++----------- libs/common/src/enums/feature-flag.enum.ts | 2 -- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/apps/web/src/app/admin-console/organizations/collections/vault.component.ts b/apps/web/src/app/admin-console/organizations/collections/vault.component.ts index ec92597dc7b..8dfebea5229 100644 --- a/apps/web/src/app/admin-console/organizations/collections/vault.component.ts +++ b/apps/web/src/app/admin-console/organizations/collections/vault.component.ts @@ -45,7 +45,6 @@ import { getUserId } from "@bitwarden/common/auth/services/account.service"; import { OrganizationBillingServiceAbstraction } from "@bitwarden/common/billing/abstractions"; import { BillingApiServiceAbstraction } from "@bitwarden/common/billing/abstractions/billing-api.service.abstraction"; import { EventType } from "@bitwarden/common/enums"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; @@ -196,7 +195,6 @@ export class VaultComponent implements OnInit, OnDestroy { private refresh$ = new BehaviorSubject(null); private destroy$ = new Subject(); protected addAccessStatus$ = new BehaviorSubject(0); - private resellerManagedOrgAlert: boolean; private vaultItemDialogRef?: DialogRef | undefined; private readonly unpaidSubscriptionDialog$ = this.accountService.activeAccount$.pipe( @@ -264,10 +262,6 @@ export class VaultComponent implements OnInit, OnDestroy { async ngOnInit() { this.userId = await firstValueFrom(getUserId(this.accountService.activeAccount$)); - this.resellerManagedOrgAlert = await this.configService.getFeatureFlag( - FeatureFlag.ResellerManagedOrgAlert, - ); - this.trashCleanupWarning = this.i18nService.t( this.platformUtilsService.isSelfHost() ? "trashCleanupWarningSelfHosted" @@ -654,7 +648,7 @@ export class VaultComponent implements OnInit, OnDestroy { ); this.resellerWarning$ = organization$.pipe( - filter((org) => org.isOwner && this.resellerManagedOrgAlert), + filter((org) => org.isOwner), switchMap((org) => from(this.billingApiService.getOrganizationBillingMetadata(org.id)).pipe( map((metadata) => ({ org, metadata })), diff --git a/apps/web/src/app/billing/services/trial-flow.service.ts b/apps/web/src/app/billing/services/trial-flow.service.ts index eb08e5bd7ad..979fc29aed7 100644 --- a/apps/web/src/app/billing/services/trial-flow.service.ts +++ b/apps/web/src/app/billing/services/trial-flow.service.ts @@ -11,8 +11,6 @@ import { BillingSourceResponse } from "@bitwarden/common/billing/models/response import { OrganizationBillingMetadataResponse } from "@bitwarden/common/billing/models/response/organization-billing-metadata.response"; import { OrganizationSubscriptionResponse } from "@bitwarden/common/billing/models/response/organization-subscription.response"; import { PaymentSourceResponse } from "@bitwarden/common/billing/models/response/payment-source.response"; -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 } from "@bitwarden/components"; @@ -24,15 +22,12 @@ import { FreeTrial } from "../types/free-trial"; @Injectable({ providedIn: "root" }) export class TrialFlowService { - private resellerManagedOrgAlert: boolean; - constructor( private i18nService: I18nService, protected dialogService: DialogService, private router: Router, protected billingApiService: BillingApiServiceAbstraction, private organizationApiService: OrganizationApiServiceAbstraction, - private configService: ConfigService, ) {} checkForOrgsWithUpcomingPaymentIssues( organization: Organization, @@ -98,10 +93,6 @@ export class TrialFlowService { isCanceled: boolean, isUnpaid: boolean, ): Promise { - this.resellerManagedOrgAlert = await this.configService.getFeatureFlag( - FeatureFlag.ResellerManagedOrgAlert, - ); - if (!org?.isOwner && !org.providerId) { await this.dialogService.openSimpleDialog({ title: this.i18nService.t("suspendedOrganizationTitle", org?.name), @@ -113,7 +104,7 @@ export class TrialFlowService { return false; } - if (org.providerId && this.resellerManagedOrgAlert) { + if (org.providerId) { await this.dialogService.openSimpleDialog({ title: this.i18nService.t("suspendedOrganizationTitle", org.name), content: { key: "suspendedManagedOrgMessage", placeholders: [org.providerName] }, @@ -134,7 +125,7 @@ export class TrialFlowService { }); } - if (org.isOwner && isCanceled && this.resellerManagedOrgAlert) { + if (org.isOwner && isCanceled) { await this.changePlan(org); } } diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index 5e52eb31840..e3c15a1d40b 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -46,7 +46,6 @@ export enum FeatureFlag { TrialPaymentOptional = "PM-8163-trial-payment", MacOsNativeCredentialSync = "macos-native-credential-sync", PrivateKeyRegeneration = "pm-12241-private-key-regeneration", - ResellerManagedOrgAlert = "PM-15814-alert-owners-of-reseller-managed-orgs", AccountDeprovisioningBanner = "pm-17120-account-deprovisioning-admin-console-banner", PM15179_AddExistingOrgsFromProviderPortal = "pm-15179-add-existing-orgs-from-provider-portal", PM12276_BreadcrumbEventLogs = "pm-12276-breadcrumbing-for-business-features", @@ -107,7 +106,6 @@ export const DefaultFeatureFlagValue = { [FeatureFlag.TrialPaymentOptional]: FALSE, [FeatureFlag.MacOsNativeCredentialSync]: FALSE, [FeatureFlag.PrivateKeyRegeneration]: FALSE, - [FeatureFlag.ResellerManagedOrgAlert]: FALSE, [FeatureFlag.AccountDeprovisioningBanner]: FALSE, [FeatureFlag.PM15179_AddExistingOrgsFromProviderPortal]: FALSE, [FeatureFlag.PM12276_BreadcrumbEventLogs]: FALSE,