Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-14525] remove member access feature flag #11972

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import {
RouterStateSnapshot,
} from "@angular/router";

import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { ProductTierType } from "@bitwarden/common/billing/enums";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { DialogService } from "@bitwarden/components";

/**
Expand All @@ -31,11 +29,6 @@ export function isEnterpriseOrgGuard(): CanActivateFn {
return router.createUrlTree(["/"]);
}

// TODO: Remove on "MemberAccessReport" feature flag cleanup
if (!canAccessFeature(FeatureFlag.MemberAccessReport)) {
return router.createUrlTree(["/"]);
}

if (org.productTierType != ProductTierType.Enterprise) {
// Users without billing permission can't access billing
if (!org.canEditSubscription) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute, NavigationEnd, Router } from "@angular/router";
import { filter, map, Observable, startWith, concatMap, firstValueFrom } from "rxjs";
import { filter, map, Observable, startWith, concatMap } from "rxjs";

Check warning on line 3 in apps/web/src/app/admin-console/organizations/reporting/reports-home.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/reporting/reports-home.component.ts#L3

Added line #L3 was not covered by tests

import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
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 { ReportVariant, reports, ReportType, ReportEntry } from "../../../tools/reports";

Expand All @@ -17,21 +15,13 @@
reports$: Observable<ReportEntry[]>;
homepage$: Observable<boolean>;

private isMemberAccessReportEnabled: boolean;

constructor(
private route: ActivatedRoute,
private organizationService: OrganizationService,
private router: Router,
private configService: ConfigService,
) {}

async ngOnInit() {
// TODO: Remove on "MemberAccessReport" feature flag cleanup
this.isMemberAccessReportEnabled = await firstValueFrom(
this.configService.getFeatureFlag$(FeatureFlag.MemberAccessReport),
);

this.homepage$ = this.router.events.pipe(
filter((event) => event instanceof NavigationEnd),
map((event) => this.isReportsHomepageRouteUrl((event as NavigationEnd).urlAfterRedirects)),
Expand Down Expand Up @@ -69,17 +59,14 @@
...reports[ReportType.Inactive2fa],
variant: reportRequiresUpgrade,
},
];

if (this.isMemberAccessReportEnabled) {
reportsArray.push({
{
...reports[ReportType.MemberAccessReport],
variant:
productType == ProductTierType.Enterprise
? ReportVariant.Enabled
: ReportVariant.RequiresEnterprise,
});
}
},
];

return reportsArray;
}
Expand Down
2 changes: 0 additions & 2 deletions libs/common/src/enums/feature-flag.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export enum FeatureFlag {
UseTreeWalkerApiForPageDetailsCollection = "use-tree-walker-api-for-page-details-collection",
EmailVerification = "email-verification",
InlineMenuFieldQualification = "inline-menu-field-qualification",
MemberAccessReport = "ac-2059-member-access-report",
TwoFactorComponentRefactor = "two-factor-component-refactor",
EnableTimeThreshold = "PM-5864-dollar-threshold",
InlineMenuPositioningImprovements = "inline-menu-positioning-improvements",
Expand Down Expand Up @@ -61,7 +60,6 @@ export const DefaultFeatureFlagValue = {
[FeatureFlag.UseTreeWalkerApiForPageDetailsCollection]: FALSE,
[FeatureFlag.EmailVerification]: FALSE,
[FeatureFlag.InlineMenuFieldQualification]: FALSE,
[FeatureFlag.MemberAccessReport]: FALSE,
[FeatureFlag.TwoFactorComponentRefactor]: FALSE,
[FeatureFlag.EnableTimeThreshold]: FALSE,
[FeatureFlag.InlineMenuPositioningImprovements]: FALSE,
Expand Down
Loading