1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-12 14:56:58 +01:00

PM-15091 Remove client side featureflag.AccessIntelligence and use DB feature flag (#12247)

* PM-15091 remove featureflag.AccessIntelligence

* removed unwanted lines of code

* fixed merge conflict
This commit is contained in:
Vijay Oommen 2024-12-05 11:24:51 -06:00 committed by GitHub
parent c11f429ddb
commit d6e1fe70ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 12 additions and 10 deletions

View File

@ -4,7 +4,7 @@
<org-switcher [filter]="orgFilter" [hideNewButton]="hideNewOrgButton$ | async"></org-switcher>
<bit-nav-group
icon="bwi-filter"
*ngIf="isAccessIntelligenceFeatureEnabled"
*ngIf="organization.useRiskInsights"
[text]="'accessIntelligence' | i18n"
>
<bit-nav-item

View File

@ -70,10 +70,6 @@ export class OrganizationLayoutComponent implements OnInit {
async ngOnInit() {
document.body.classList.remove("layout_frontend");
this.isAccessIntelligenceFeatureEnabled = await this.configService.getFeatureFlag(
FeatureFlag.AccessIntelligence,
);
this.organization$ = this.route.params.pipe(
map((p) => p.organizationId),
switchMap((id) => this.organizationService.organizations$.pipe(getById(id))),

View File

@ -1,15 +1,14 @@
import { NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router";
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { organizationPermissionsGuard } from "@bitwarden/web-vault/app/admin-console/organizations/guards/org-permissions.guard";
import { RiskInsightsComponent } from "./risk-insights.component";
const routes: Routes = [
{
path: "risk-insights",
canActivate: [canAccessFeature(FeatureFlag.AccessIntelligence)],
canActivate: [organizationPermissionsGuard((org) => org.useRiskInsights)],
component: RiskInsightsComponent,
data: {
titleId: "RiskInsights",

View File

@ -56,6 +56,7 @@ describe("ORGANIZATIONS state", () => {
allowAdminAccessToAllCollectionItems: false,
familySponsorshipLastSyncDate: new Date(),
userIsManagedByOrganization: false,
useRiskInsights: false,
},
};
const result = sut.deserializer(JSON.parse(JSON.stringify(expectedResult)));

View File

@ -56,6 +56,7 @@ export class OrganizationData {
limitCollectionDeletion: boolean;
allowAdminAccessToAllCollectionItems: boolean;
userIsManagedByOrganization: boolean;
useRiskInsights: boolean;
constructor(
response?: ProfileOrganizationResponse,
@ -116,6 +117,7 @@ export class OrganizationData {
this.limitCollectionDeletion = response.limitCollectionDeletion;
this.allowAdminAccessToAllCollectionItems = response.allowAdminAccessToAllCollectionItems;
this.userIsManagedByOrganization = response.userIsManagedByOrganization;
this.useRiskInsights = response.useRiskInsights;
this.isMember = options.isMember;
this.isProviderUser = options.isProviderUser;

View File

@ -81,6 +81,7 @@ export class Organization {
* matches one of the verified domains of that organization, and the user is a member of it.
*/
userIsManagedByOrganization: boolean;
useRiskInsights: boolean;
constructor(obj?: OrganizationData) {
if (obj == null) {
@ -137,6 +138,7 @@ export class Organization {
this.limitCollectionDeletion = obj.limitCollectionDeletion;
this.allowAdminAccessToAllCollectionItems = obj.allowAdminAccessToAllCollectionItems;
this.userIsManagedByOrganization = obj.userIsManagedByOrganization;
this.useRiskInsights = obj.useRiskInsights;
}
get canAccess() {

View File

@ -35,6 +35,7 @@ export class OrganizationResponse extends BaseResponse {
limitCollectionCreation: boolean;
limitCollectionDeletion: boolean;
allowAdminAccessToAllCollectionItems: boolean;
useRiskInsights: boolean;
constructor(response: any) {
super(response);
@ -75,5 +76,6 @@ export class OrganizationResponse extends BaseResponse {
this.allowAdminAccessToAllCollectionItems = this.getResponseProperty(
"AllowAdminAccessToAllCollectionItems",
);
this.useRiskInsights = this.getResponseProperty("UseRiskInsights");
}
}

View File

@ -53,6 +53,7 @@ export class ProfileOrganizationResponse extends BaseResponse {
limitCollectionDeletion: boolean;
allowAdminAccessToAllCollectionItems: boolean;
userIsManagedByOrganization: boolean;
useRiskInsights: boolean;
constructor(response: any) {
super(response);
@ -117,5 +118,6 @@ export class ProfileOrganizationResponse extends BaseResponse {
"AllowAdminAccessToAllCollectionItems",
);
this.userIsManagedByOrganization = this.getResponseProperty("UserIsManagedByOrganization");
this.useRiskInsights = this.getResponseProperty("UseRiskInsights");
}
}

View File

@ -31,7 +31,6 @@ export enum FeatureFlag {
CipherKeyEncryption = "cipher-key-encryption",
VerifiedSsoDomainEndpoint = "pm-12337-refactor-sso-details-endpoint",
PM11901_RefactorSelfHostingLicenseUploader = "PM-11901-refactor-self-hosting-license-uploader",
AccessIntelligence = "pm-13227-access-intelligence",
PM14505AdminConsoleIntegrationPage = "pm-14505-admin-console-integration-page",
CriticalApps = "pm-14466-risk-insights-critical-application",
TrialPaymentOptional = "PM-8163-trial-payment",
@ -81,7 +80,6 @@ export const DefaultFeatureFlagValue = {
[FeatureFlag.CipherKeyEncryption]: FALSE,
[FeatureFlag.VerifiedSsoDomainEndpoint]: FALSE,
[FeatureFlag.PM11901_RefactorSelfHostingLicenseUploader]: FALSE,
[FeatureFlag.AccessIntelligence]: FALSE,
[FeatureFlag.PM14505AdminConsoleIntegrationPage]: FALSE,
[FeatureFlag.CriticalApps]: FALSE,
[FeatureFlag.TrialPaymentOptional]: FALSE,