From 5bdb22bc995a504803c64667345c928422e554d4 Mon Sep 17 00:00:00 2001 From: voommen-livefront Date: Wed, 23 Jul 2025 09:04:22 -0500 Subject: [PATCH 1/3] PM-23826 add feature flag and only set the card when the feature flag is on --- .../integrations/integrations.component.ts | 31 +++++++++++++++---- libs/common/src/enums/feature-flag.enum.ts | 6 ++++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts b/apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts index 5c6fa72c311..c0a57c82954 100644 --- a/apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts +++ b/apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts @@ -1,8 +1,8 @@ // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore -import { Component, OnInit } from "@angular/core"; +import { Component, OnDestroy, OnInit } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; -import { Observable, switchMap } from "rxjs"; +import { Observable, Subject, switchMap, takeUntil } from "rxjs"; import { getOrganizationById, @@ -11,6 +11,8 @@ import { import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { IntegrationType } from "@bitwarden/common/enums"; +import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; +import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { HeaderModule } from "../../../layouts/header/header.module"; import { SharedModule } from "../../../shared/shared.module"; @@ -30,10 +32,12 @@ import { Integration } from "../shared/components/integrations/models"; FilterIntegrationsPipe, ], }) -export class AdminConsoleIntegrationsComponent implements OnInit { +export class AdminConsoleIntegrationsComponent implements OnInit, OnDestroy { integrationsList: Integration[] = []; tabIndex: number; organization$: Observable; + isEventBasedIntegrationsEnabled: boolean = false; + private destroy$ = new Subject(); ngOnInit(): void { this.organization$ = this.route.params.pipe( @@ -53,7 +57,15 @@ export class AdminConsoleIntegrationsComponent implements OnInit { private route: ActivatedRoute, private organizationService: OrganizationService, private accountService: AccountService, + private configService: ConfigService, ) { + this.configService + .getFeatureFlag$(FeatureFlag.EventBasedOrganizationIntegrations) + .pipe(takeUntil(this.destroy$)) + .subscribe((isEnabled) => { + this.isEventBasedIntegrationsEnabled = isEnabled; + }); + this.integrationsList = [ { name: "AD FS", @@ -228,7 +240,10 @@ export class AdminConsoleIntegrationsComponent implements OnInit { image: "../../../../../../../images/integrations/logo-microsoft-intune-color.svg", type: IntegrationType.DEVICE, }, - { + ]; + + if (this.isEventBasedIntegrationsEnabled) { + this.integrationsList.push({ name: "Crowdstrike", linkURL: "", image: "../../../../../../../images/integrations/logo-crowdstrike-black.svg", @@ -236,8 +251,12 @@ export class AdminConsoleIntegrationsComponent implements OnInit { description: "crowdstrikeEventIntegrationDesc", isConnected: false, canSetupConnection: true, - }, - ]; + }); + } + } + ngOnDestroy(): void { + this.destroy$.next(); + this.destroy$.complete(); } get IntegrationType(): typeof IntegrationType { diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index 8e9dc6fd35e..fe56d94fe5d 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -49,6 +49,9 @@ export enum FeatureFlag { /* Tools */ DesktopSendUIRefresh = "desktop-send-ui-refresh", + /* DIRT */ + EventBasedOrganizationIntegrations = "event-based-organization-integrations", + /* Vault */ PM8851_BrowserOnboardingNudge = "pm-8851-browser-onboarding-nudge", PM9111ExtensionPersistAddEditForm = "pm-9111-extension-persist-add-edit-form", @@ -95,6 +98,9 @@ export const DefaultFeatureFlagValue = { /* Tools */ [FeatureFlag.DesktopSendUIRefresh]: FALSE, + /* DIRT */ + [FeatureFlag.EventBasedOrganizationIntegrations]: true, + /* Vault */ [FeatureFlag.PM8851_BrowserOnboardingNudge]: FALSE, [FeatureFlag.PM9111ExtensionPersistAddEditForm]: FALSE, From 25b2153b9c61f123332526774d3bc0f714f25859 Mon Sep 17 00:00:00 2001 From: voommen-livefront Date: Wed, 23 Jul 2025 09:08:45 -0500 Subject: [PATCH 2/3] PM-23825 set feature flag to false by default --- libs/common/src/enums/feature-flag.enum.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index fe56d94fe5d..dce7df8636c 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -99,7 +99,7 @@ export const DefaultFeatureFlagValue = { [FeatureFlag.DesktopSendUIRefresh]: FALSE, /* DIRT */ - [FeatureFlag.EventBasedOrganizationIntegrations]: true, + [FeatureFlag.EventBasedOrganizationIntegrations]: FALSE, /* Vault */ [FeatureFlag.PM8851_BrowserOnboardingNudge]: FALSE, From 5415b098c46c7a12d4f0161f36c7967a340a41a6 Mon Sep 17 00:00:00 2001 From: voommen-livefront Date: Wed, 23 Jul 2025 09:22:06 -0500 Subject: [PATCH 3/3] PM-23825 updated code to use the new @if statements --- .../integration-card.component.html | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/apps/web/src/app/admin-console/organizations/shared/components/integrations/integration-card/integration-card.component.html b/apps/web/src/app/admin-console/organizations/shared/components/integrations/integration-card/integration-card.component.html index d0afda4c0ae..2c0db1cf933 100644 --- a/apps/web/src/app/admin-console/organizations/shared/components/integrations/integration-card/integration-card.component.html +++ b/apps/web/src/app/admin-console/organizations/shared/components/integrations/integration-card/integration-card.component.html @@ -19,32 +19,38 @@

{{ name }} - - {{ "on" | i18n }} - {{ "off" | i18n }} - + @if (showConnectedBadge()) { + + @if (isConnected) { + {{ "on" | i18n }} + } + @if (!isConnected) { + {{ "off" | i18n }} + } + + }

{{ description }}

- - - - - {{ "new" | i18n }} - + @if (canSetupConnection) { + + } + + @if (linkURL) { + + + } + @if (showNewBadge()) { + + {{ "new" | i18n }} + + }