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:
parent
c11f429ddb
commit
d6e1fe70ca
@ -4,7 +4,7 @@
|
|||||||
<org-switcher [filter]="orgFilter" [hideNewButton]="hideNewOrgButton$ | async"></org-switcher>
|
<org-switcher [filter]="orgFilter" [hideNewButton]="hideNewOrgButton$ | async"></org-switcher>
|
||||||
<bit-nav-group
|
<bit-nav-group
|
||||||
icon="bwi-filter"
|
icon="bwi-filter"
|
||||||
*ngIf="isAccessIntelligenceFeatureEnabled"
|
*ngIf="organization.useRiskInsights"
|
||||||
[text]="'accessIntelligence' | i18n"
|
[text]="'accessIntelligence' | i18n"
|
||||||
>
|
>
|
||||||
<bit-nav-item
|
<bit-nav-item
|
||||||
|
@ -70,10 +70,6 @@ export class OrganizationLayoutComponent implements OnInit {
|
|||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
document.body.classList.remove("layout_frontend");
|
document.body.classList.remove("layout_frontend");
|
||||||
|
|
||||||
this.isAccessIntelligenceFeatureEnabled = await this.configService.getFeatureFlag(
|
|
||||||
FeatureFlag.AccessIntelligence,
|
|
||||||
);
|
|
||||||
|
|
||||||
this.organization$ = this.route.params.pipe(
|
this.organization$ = this.route.params.pipe(
|
||||||
map((p) => p.organizationId),
|
map((p) => p.organizationId),
|
||||||
switchMap((id) => this.organizationService.organizations$.pipe(getById(id))),
|
switchMap((id) => this.organizationService.organizations$.pipe(getById(id))),
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
import { NgModule } from "@angular/core";
|
import { NgModule } from "@angular/core";
|
||||||
import { RouterModule, Routes } from "@angular/router";
|
import { RouterModule, Routes } from "@angular/router";
|
||||||
|
|
||||||
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";
|
import { organizationPermissionsGuard } from "@bitwarden/web-vault/app/admin-console/organizations/guards/org-permissions.guard";
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
|
||||||
|
|
||||||
import { RiskInsightsComponent } from "./risk-insights.component";
|
import { RiskInsightsComponent } from "./risk-insights.component";
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: "risk-insights",
|
path: "risk-insights",
|
||||||
canActivate: [canAccessFeature(FeatureFlag.AccessIntelligence)],
|
canActivate: [organizationPermissionsGuard((org) => org.useRiskInsights)],
|
||||||
component: RiskInsightsComponent,
|
component: RiskInsightsComponent,
|
||||||
data: {
|
data: {
|
||||||
titleId: "RiskInsights",
|
titleId: "RiskInsights",
|
||||||
|
@ -56,6 +56,7 @@ describe("ORGANIZATIONS state", () => {
|
|||||||
allowAdminAccessToAllCollectionItems: false,
|
allowAdminAccessToAllCollectionItems: false,
|
||||||
familySponsorshipLastSyncDate: new Date(),
|
familySponsorshipLastSyncDate: new Date(),
|
||||||
userIsManagedByOrganization: false,
|
userIsManagedByOrganization: false,
|
||||||
|
useRiskInsights: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const result = sut.deserializer(JSON.parse(JSON.stringify(expectedResult)));
|
const result = sut.deserializer(JSON.parse(JSON.stringify(expectedResult)));
|
||||||
|
@ -56,6 +56,7 @@ export class OrganizationData {
|
|||||||
limitCollectionDeletion: boolean;
|
limitCollectionDeletion: boolean;
|
||||||
allowAdminAccessToAllCollectionItems: boolean;
|
allowAdminAccessToAllCollectionItems: boolean;
|
||||||
userIsManagedByOrganization: boolean;
|
userIsManagedByOrganization: boolean;
|
||||||
|
useRiskInsights: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
response?: ProfileOrganizationResponse,
|
response?: ProfileOrganizationResponse,
|
||||||
@ -116,6 +117,7 @@ export class OrganizationData {
|
|||||||
this.limitCollectionDeletion = response.limitCollectionDeletion;
|
this.limitCollectionDeletion = response.limitCollectionDeletion;
|
||||||
this.allowAdminAccessToAllCollectionItems = response.allowAdminAccessToAllCollectionItems;
|
this.allowAdminAccessToAllCollectionItems = response.allowAdminAccessToAllCollectionItems;
|
||||||
this.userIsManagedByOrganization = response.userIsManagedByOrganization;
|
this.userIsManagedByOrganization = response.userIsManagedByOrganization;
|
||||||
|
this.useRiskInsights = response.useRiskInsights;
|
||||||
|
|
||||||
this.isMember = options.isMember;
|
this.isMember = options.isMember;
|
||||||
this.isProviderUser = options.isProviderUser;
|
this.isProviderUser = options.isProviderUser;
|
||||||
|
@ -81,6 +81,7 @@ export class Organization {
|
|||||||
* matches one of the verified domains of that organization, and the user is a member of it.
|
* matches one of the verified domains of that organization, and the user is a member of it.
|
||||||
*/
|
*/
|
||||||
userIsManagedByOrganization: boolean;
|
userIsManagedByOrganization: boolean;
|
||||||
|
useRiskInsights: boolean;
|
||||||
|
|
||||||
constructor(obj?: OrganizationData) {
|
constructor(obj?: OrganizationData) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
@ -137,6 +138,7 @@ export class Organization {
|
|||||||
this.limitCollectionDeletion = obj.limitCollectionDeletion;
|
this.limitCollectionDeletion = obj.limitCollectionDeletion;
|
||||||
this.allowAdminAccessToAllCollectionItems = obj.allowAdminAccessToAllCollectionItems;
|
this.allowAdminAccessToAllCollectionItems = obj.allowAdminAccessToAllCollectionItems;
|
||||||
this.userIsManagedByOrganization = obj.userIsManagedByOrganization;
|
this.userIsManagedByOrganization = obj.userIsManagedByOrganization;
|
||||||
|
this.useRiskInsights = obj.useRiskInsights;
|
||||||
}
|
}
|
||||||
|
|
||||||
get canAccess() {
|
get canAccess() {
|
||||||
|
@ -35,6 +35,7 @@ export class OrganizationResponse extends BaseResponse {
|
|||||||
limitCollectionCreation: boolean;
|
limitCollectionCreation: boolean;
|
||||||
limitCollectionDeletion: boolean;
|
limitCollectionDeletion: boolean;
|
||||||
allowAdminAccessToAllCollectionItems: boolean;
|
allowAdminAccessToAllCollectionItems: boolean;
|
||||||
|
useRiskInsights: boolean;
|
||||||
|
|
||||||
constructor(response: any) {
|
constructor(response: any) {
|
||||||
super(response);
|
super(response);
|
||||||
@ -75,5 +76,6 @@ export class OrganizationResponse extends BaseResponse {
|
|||||||
this.allowAdminAccessToAllCollectionItems = this.getResponseProperty(
|
this.allowAdminAccessToAllCollectionItems = this.getResponseProperty(
|
||||||
"AllowAdminAccessToAllCollectionItems",
|
"AllowAdminAccessToAllCollectionItems",
|
||||||
);
|
);
|
||||||
|
this.useRiskInsights = this.getResponseProperty("UseRiskInsights");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,7 @@ export class ProfileOrganizationResponse extends BaseResponse {
|
|||||||
limitCollectionDeletion: boolean;
|
limitCollectionDeletion: boolean;
|
||||||
allowAdminAccessToAllCollectionItems: boolean;
|
allowAdminAccessToAllCollectionItems: boolean;
|
||||||
userIsManagedByOrganization: boolean;
|
userIsManagedByOrganization: boolean;
|
||||||
|
useRiskInsights: boolean;
|
||||||
|
|
||||||
constructor(response: any) {
|
constructor(response: any) {
|
||||||
super(response);
|
super(response);
|
||||||
@ -117,5 +118,6 @@ export class ProfileOrganizationResponse extends BaseResponse {
|
|||||||
"AllowAdminAccessToAllCollectionItems",
|
"AllowAdminAccessToAllCollectionItems",
|
||||||
);
|
);
|
||||||
this.userIsManagedByOrganization = this.getResponseProperty("UserIsManagedByOrganization");
|
this.userIsManagedByOrganization = this.getResponseProperty("UserIsManagedByOrganization");
|
||||||
|
this.useRiskInsights = this.getResponseProperty("UseRiskInsights");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ export enum FeatureFlag {
|
|||||||
CipherKeyEncryption = "cipher-key-encryption",
|
CipherKeyEncryption = "cipher-key-encryption",
|
||||||
VerifiedSsoDomainEndpoint = "pm-12337-refactor-sso-details-endpoint",
|
VerifiedSsoDomainEndpoint = "pm-12337-refactor-sso-details-endpoint",
|
||||||
PM11901_RefactorSelfHostingLicenseUploader = "PM-11901-refactor-self-hosting-license-uploader",
|
PM11901_RefactorSelfHostingLicenseUploader = "PM-11901-refactor-self-hosting-license-uploader",
|
||||||
AccessIntelligence = "pm-13227-access-intelligence",
|
|
||||||
PM14505AdminConsoleIntegrationPage = "pm-14505-admin-console-integration-page",
|
PM14505AdminConsoleIntegrationPage = "pm-14505-admin-console-integration-page",
|
||||||
CriticalApps = "pm-14466-risk-insights-critical-application",
|
CriticalApps = "pm-14466-risk-insights-critical-application",
|
||||||
TrialPaymentOptional = "PM-8163-trial-payment",
|
TrialPaymentOptional = "PM-8163-trial-payment",
|
||||||
@ -81,7 +80,6 @@ export const DefaultFeatureFlagValue = {
|
|||||||
[FeatureFlag.CipherKeyEncryption]: FALSE,
|
[FeatureFlag.CipherKeyEncryption]: FALSE,
|
||||||
[FeatureFlag.VerifiedSsoDomainEndpoint]: FALSE,
|
[FeatureFlag.VerifiedSsoDomainEndpoint]: FALSE,
|
||||||
[FeatureFlag.PM11901_RefactorSelfHostingLicenseUploader]: FALSE,
|
[FeatureFlag.PM11901_RefactorSelfHostingLicenseUploader]: FALSE,
|
||||||
[FeatureFlag.AccessIntelligence]: FALSE,
|
|
||||||
[FeatureFlag.PM14505AdminConsoleIntegrationPage]: FALSE,
|
[FeatureFlag.PM14505AdminConsoleIntegrationPage]: FALSE,
|
||||||
[FeatureFlag.CriticalApps]: FALSE,
|
[FeatureFlag.CriticalApps]: FALSE,
|
||||||
[FeatureFlag.TrialPaymentOptional]: FALSE,
|
[FeatureFlag.TrialPaymentOptional]: FALSE,
|
||||||
|
Loading…
Reference in New Issue
Block a user