1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01:00

[SM-1031] Remove SecretsManager & showDDG compile flags (#8610)

Remove old compile flags which should no longer be required, and may even cause issues. secretsManager: false hides the app switcher which is now used for more than just secrets manager.
This commit is contained in:
Oscar Hinton 2024-04-08 17:46:24 +02:00 committed by GitHub
parent d1a0a20daa
commit 7064b595da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 24 additions and 51 deletions

View File

@ -38,9 +38,7 @@ const config: StorybookConfig = {
}, },
env: (config) => ({ env: (config) => ({
...config, ...config,
FLAGS: JSON.stringify({ FLAGS: JSON.stringify({}),
secretsManager: true,
}),
}), }),
webpackFinal: async (config, { configType }) => { webpackFinal: async (config, { configType }) => {
if (config.resolve) { if (config.resolve) {

View File

@ -11,13 +11,13 @@ import { GroupPolicyEnvironment } from "../admin-console/types/group-policy-envi
import { BrowserApi } from "./browser/browser-api"; import { BrowserApi } from "./browser/browser-api";
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type Flags = { export type Flags = {
accountSwitching?: boolean; accountSwitching?: boolean;
} & SharedFlags; } & SharedFlags;
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type DevFlags = { export type DevFlags = {
storeSessionDecrypted?: boolean; storeSessionDecrypted?: boolean;
managedEnvironment?: GroupPolicyEnvironment; managedEnvironment?: GroupPolicyEnvironment;

View File

@ -7,11 +7,11 @@ import {
} from "@bitwarden/common/platform/misc/flags"; } from "@bitwarden/common/platform/misc/flags";
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type Flags = {} & SharedFlags; export type Flags = {} & SharedFlags;
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type DevFlags = {} & SharedDevFlags; export type DevFlags = {} & SharedDevFlags;
export function flagEnabled(flag: keyof Flags): boolean { export function flagEnabled(flag: keyof Flags): boolean {

View File

@ -1,7 +1,6 @@
{ {
"devFlags": {}, "devFlags": {},
"flags": { "flags": {
"showDDGSetting": true,
"enableCipherKeyEncryption": false "enableCipherKeyEncryption": false
} }
} }

View File

@ -1,6 +1,5 @@
{ {
"flags": { "flags": {
"showDDGSetting": true,
"enableCipherKeyEncryption": false "enableCipherKeyEncryption": false
} }
} }

View File

@ -24,7 +24,6 @@ import { DialogService } from "@bitwarden/components";
import { SetPinComponent } from "../../auth/components/set-pin.component"; import { SetPinComponent } from "../../auth/components/set-pin.component";
import { DesktopAutofillSettingsService } from "../../autofill/services/desktop-autofill-settings.service"; import { DesktopAutofillSettingsService } from "../../autofill/services/desktop-autofill-settings.service";
import { flagEnabled } from "../../platform/flags";
import { DesktopSettingsService } from "../../platform/services/desktop-settings.service"; import { DesktopSettingsService } from "../../platform/services/desktop-settings.service";
@Component({ @Component({
@ -146,7 +145,7 @@ export class SettingsComponent implements OnInit {
this.startToTrayDescText = this.i18nService.t(startToTrayKey + "Desc"); this.startToTrayDescText = this.i18nService.t(startToTrayKey + "Desc");
// DuckDuckGo browser is only for macos initially // DuckDuckGo browser is only for macos initially
this.showDuckDuckGoIntegrationOption = flagEnabled("showDDGSetting") && isMac; this.showDuckDuckGoIntegrationOption = isMac;
this.vaultTimeoutOptions = [ this.vaultTimeoutOptions = [
// { name: i18nService.t('immediately'), value: 0 }, // { name: i18nService.t('immediately'), value: 0 },

View File

@ -7,13 +7,11 @@ import {
} from "@bitwarden/common/platform/misc/flags"; } from "@bitwarden/common/platform/misc/flags";
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type Flags = { export type Flags = {} & SharedFlags;
showDDGSetting?: boolean;
} & SharedFlags;
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type DevFlags = {} & SharedDevFlags; export type DevFlags = {} & SharedDevFlags;
export function flagEnabled(flag: keyof Flags): boolean { export function flagEnabled(flag: keyof Flags): boolean {

View File

@ -11,7 +11,6 @@
"allowedHosts": "auto" "allowedHosts": "auto"
}, },
"flags": { "flags": {
"secretsManager": false,
"showPasswordless": false, "showPasswordless": false,
"enableCipherKeyEncryption": false "enableCipherKeyEncryption": false
} }

View File

@ -17,7 +17,6 @@
"proxyNotifications": "https://notifications.bitwarden.com" "proxyNotifications": "https://notifications.bitwarden.com"
}, },
"flags": { "flags": {
"secretsManager": true,
"showPasswordless": true, "showPasswordless": true,
"enableCipherKeyEncryption": false "enableCipherKeyEncryption": false
} }

View File

@ -20,7 +20,6 @@
} }
], ],
"flags": { "flags": {
"secretsManager": true,
"showPasswordless": true, "showPasswordless": true,
"enableCipherKeyEncryption": false "enableCipherKeyEncryption": false
}, },

View File

@ -11,7 +11,6 @@
"buttonAction": "https://www.paypal.com/cgi-bin/webscr" "buttonAction": "https://www.paypal.com/cgi-bin/webscr"
}, },
"flags": { "flags": {
"secretsManager": true,
"showPasswordless": true, "showPasswordless": true,
"enableCipherKeyEncryption": false "enableCipherKeyEncryption": false
} }

View File

@ -21,7 +21,6 @@
} }
], ],
"flags": { "flags": {
"secretsManager": true,
"showPasswordless": true "showPasswordless": true
} }
} }

View File

@ -27,7 +27,6 @@
} }
], ],
"flags": { "flags": {
"secretsManager": true,
"showPasswordless": true, "showPasswordless": true,
"enableCipherKeyEncryption": false "enableCipherKeyEncryption": false
} }

View File

@ -7,7 +7,6 @@
"port": 8081 "port": 8081
}, },
"flags": { "flags": {
"secretsManager": true,
"showPasswordless": true, "showPasswordless": true,
"enableCipherKeyEncryption": false "enableCipherKeyEncryption": false
} }

View File

@ -5,7 +5,6 @@
"scim": "https://scim.usdev.bitwarden.pw" "scim": "https://scim.usdev.bitwarden.pw"
}, },
"flags": { "flags": {
"secretsManager": true,
"showPasswordless": true "showPasswordless": true
} }
} }

View File

@ -52,7 +52,6 @@ import { Collection } from "@bitwarden/common/vault/models/domain/collection";
import { CollectionDetailsResponse } from "@bitwarden/common/vault/models/response/collection.response"; import { CollectionDetailsResponse } from "@bitwarden/common/vault/models/response/collection.response";
import { DialogService, SimpleDialogOptions } from "@bitwarden/components"; import { DialogService, SimpleDialogOptions } from "@bitwarden/components";
import { flagEnabled } from "../../../../utils/flags";
import { openEntityEventsDialog } from "../../../admin-console/organizations/manage/entity-events.component"; import { openEntityEventsDialog } from "../../../admin-console/organizations/manage/entity-events.component";
import { BasePeopleComponent } from "../../common/base.people.component"; import { BasePeopleComponent } from "../../common/base.people.component";
import { GroupService } from "../core"; import { GroupService } from "../core";
@ -148,9 +147,7 @@ export class PeopleComponent
shareReplay({ refCount: true, bufferSize: 1 }), shareReplay({ refCount: true, bufferSize: 1 }),
); );
this.canUseSecretsManager$ = organization$.pipe( this.canUseSecretsManager$ = organization$.pipe(map((org) => org.useSecretsManager));
map((org) => org.useSecretsManager && flagEnabled("secretsManager")),
);
const policies$ = organization$.pipe( const policies$ = organization$.pipe(
switchMap((organization) => { switchMap((organization) => {

View File

@ -1,4 +1,3 @@
<ng-template [ngIf]="isEnabled">
<button <button
type="button" type="button"
bitIconButton="bwi bwi-fw bwi-filter" bitIconButton="bwi bwi-fw bwi-filter"
@ -7,4 +6,3 @@
[attr.aria-label]="'switchProducts' | i18n" [attr.aria-label]="'switchProducts' | i18n"
></button> ></button>
<product-switcher-content #content></product-switcher-content> <product-switcher-content #content></product-switcher-content>
</ng-template>

View File

@ -1,16 +1,11 @@
import { AfterViewInit, ChangeDetectorRef, Component, Input } from "@angular/core"; import { AfterViewInit, ChangeDetectorRef, Component, Input } from "@angular/core";
import { IconButtonType } from "@bitwarden/components/src/icon-button/icon-button.component"; import { IconButtonType } from "@bitwarden/components/src/icon-button/icon-button.component";
import { flagEnabled } from "../../../utils/flags";
@Component({ @Component({
selector: "product-switcher", selector: "product-switcher",
templateUrl: "./product-switcher.component.html", templateUrl: "./product-switcher.component.html",
}) })
export class ProductSwitcherComponent implements AfterViewInit { export class ProductSwitcherComponent implements AfterViewInit {
protected isEnabled = flagEnabled("secretsManager");
/** /**
* Passed to the product switcher's `bitIconButton` * Passed to the product switcher's `bitIconButton`
*/ */

View File

@ -7,14 +7,13 @@ import {
} from "@bitwarden/common/platform/misc/flags"; } from "@bitwarden/common/platform/misc/flags";
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type Flags = { export type Flags = {
secretsManager?: boolean;
showPasswordless?: boolean; showPasswordless?: boolean;
} & SharedFlags; } & SharedFlags;
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable-next-line @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type DevFlags = {} & SharedDevFlags; export type DevFlags = {} & SharedDevFlags;
export function flagEnabled(flag: keyof Flags): boolean { export function flagEnabled(flag: keyof Flags): boolean {

View File

@ -2,7 +2,6 @@ import { NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router"; import { RouterModule, Routes } from "@angular/router";
import { AuthGuard } from "@bitwarden/angular/auth/guards"; import { AuthGuard } from "@bitwarden/angular/auth/guards";
import { buildFlaggedRoute } from "@bitwarden/web-vault/app/oss-routing.module";
import { organizationEnabledGuard } from "./guards/sm-org-enabled.guard"; import { organizationEnabledGuard } from "./guards/sm-org-enabled.guard";
import { canActivateSM } from "./guards/sm.guard"; import { canActivateSM } from "./guards/sm.guard";
@ -17,7 +16,7 @@ import { OrgSuspendedComponent } from "./shared/org-suspended.component";
import { TrashModule } from "./trash/trash.module"; import { TrashModule } from "./trash/trash.module";
const routes: Routes = [ const routes: Routes = [
buildFlaggedRoute("secretsManager", { {
path: "", path: "",
children: [ children: [
{ {
@ -86,7 +85,7 @@ const routes: Routes = [
], ],
}, },
], ],
}), },
]; ];
@NgModule({ @NgModule({

View File

@ -1,5 +1,5 @@
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type SharedFlags = { export type SharedFlags = {
multithreadDecryption: boolean; multithreadDecryption: boolean;
showPasswordless?: boolean; showPasswordless?: boolean;
@ -7,7 +7,7 @@ export type SharedFlags = {
}; };
// required to avoid linting errors when there are no flags // required to avoid linting errors when there are no flags
/* eslint-disable @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/ban-types
export type SharedDevFlags = { export type SharedDevFlags = {
noopNotifications: boolean; noopNotifications: boolean;
}; };