1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 13:53:34 +00:00

[PM-14562] Risk insights notification feature flag (#13095)

* Risk insights notification feature flag

* Feature flag should be false
This commit is contained in:
Tom
2025-01-29 10:26:54 -05:00
committed by GitHub
parent 24f426268e
commit ab197049f5
3 changed files with 11 additions and 2 deletions

View File

@@ -28,7 +28,7 @@
<div class="tw-mt-4 tw-flex tw-flex-col" *ngIf="!loading && dataSource.data.length"> <div class="tw-mt-4 tw-flex tw-flex-col" *ngIf="!loading && dataSource.data.length">
<div class="tw-flex tw-justify-between tw-mb-4"> <div class="tw-flex tw-justify-between tw-mb-4">
<h2 bitTypography="h2">{{ "criticalApplications" | i18n }}</h2> <h2 bitTypography="h2">{{ "criticalApplications" | i18n }}</h2>
<button bitButton buttonType="primary" type="button"> <button *ngIf="isNotificationsFeatureEnabled" bitButton buttonType="primary" type="button">
<i class="bwi bwi-envelope tw-mr-2"></i> <i class="bwi bwi-envelope tw-mr-2"></i>
{{ "requestPasswordChange" | i18n }} {{ "requestPasswordChange" | i18n }}
</button> </button>

View File

@@ -15,6 +15,8 @@ import {
ApplicationHealthReportDetailWithCriticalFlag, ApplicationHealthReportDetailWithCriticalFlag,
ApplicationHealthReportSummary, ApplicationHealthReportSummary,
} from "@bitwarden/bit-common/tools/reports/risk-insights/models/password-health"; } from "@bitwarden/bit-common/tools/reports/risk-insights/models/password-health";
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 { OrganizationId } from "@bitwarden/common/types/guid"; import { OrganizationId } from "@bitwarden/common/types/guid";
import { import {
@@ -47,8 +49,12 @@ export class CriticalApplicationsComponent implements OnInit {
protected organizationId: string; protected organizationId: string;
protected applicationSummary = {} as ApplicationHealthReportSummary; protected applicationSummary = {} as ApplicationHealthReportSummary;
noItemsIcon = Icons.Security; noItemsIcon = Icons.Security;
isNotificationsFeatureEnabled: boolean = false;
ngOnInit() { async ngOnInit() {
this.isNotificationsFeatureEnabled = await this.configService.getFeatureFlag(
FeatureFlag.EnableRiskInsightsNotifications,
);
this.organizationId = this.activatedRoute.snapshot.paramMap.get("organizationId") ?? ""; this.organizationId = this.activatedRoute.snapshot.paramMap.get("organizationId") ?? "";
combineLatest([ combineLatest([
this.dataService.applications$, this.dataService.applications$,
@@ -111,6 +117,7 @@ export class CriticalApplicationsComponent implements OnInit {
protected criticalAppsService: CriticalAppsService, protected criticalAppsService: CriticalAppsService,
protected reportService: RiskInsightsReportService, protected reportService: RiskInsightsReportService,
protected i18nService: I18nService, protected i18nService: I18nService,
private configService: ConfigService,
) { ) {
this.searchControl.valueChanges this.searchControl.valueChanges
.pipe(debounceTime(200), takeUntilDestroyed()) .pipe(debounceTime(200), takeUntilDestroyed())

View File

@@ -47,6 +47,7 @@ export enum FeatureFlag {
PrivateKeyRegeneration = "pm-12241-private-key-regeneration", PrivateKeyRegeneration = "pm-12241-private-key-regeneration",
ResellerManagedOrgAlert = "PM-15814-alert-owners-of-reseller-managed-orgs", ResellerManagedOrgAlert = "PM-15814-alert-owners-of-reseller-managed-orgs",
NewDeviceVerification = "new-device-verification", NewDeviceVerification = "new-device-verification",
EnableRiskInsightsNotifications = "enable-risk-insights-notifications",
} }
export type AllowedFeatureFlagTypes = boolean | number | string; export type AllowedFeatureFlagTypes = boolean | number | string;
@@ -104,6 +105,7 @@ export const DefaultFeatureFlagValue = {
[FeatureFlag.PrivateKeyRegeneration]: FALSE, [FeatureFlag.PrivateKeyRegeneration]: FALSE,
[FeatureFlag.ResellerManagedOrgAlert]: FALSE, [FeatureFlag.ResellerManagedOrgAlert]: FALSE,
[FeatureFlag.NewDeviceVerification]: FALSE, [FeatureFlag.NewDeviceVerification]: FALSE,
[FeatureFlag.EnableRiskInsightsNotifications]: FALSE,
} satisfies Record<FeatureFlag, AllowedFeatureFlagTypes>; } satisfies Record<FeatureFlag, AllowedFeatureFlagTypes>;
export type DefaultFeatureFlagValueType = typeof DefaultFeatureFlagValue; export type DefaultFeatureFlagValueType = typeof DefaultFeatureFlagValue;