diff --git a/apps/browser/.gitignore b/apps/browser/.gitignore index 7a689bdb9f..87b21b9730 100644 --- a/apps/browser/.gitignore +++ b/apps/browser/.gitignore @@ -1,3 +1,5 @@ +config/local.json + # Safari dist-safari !src/safari/safari/app/popup/index.html diff --git a/apps/browser/config/base.json b/apps/browser/config/base.json index 348f00d1f3..8a3ccc14d3 100644 --- a/apps/browser/config/base.json +++ b/apps/browser/config/base.json @@ -2,6 +2,7 @@ "dev_flags": {}, "flags": { "showPasswordless": true, - "enableCipherKeyEncryption": false + "enableCipherKeyEncryption": false, + "accountSwitching": false } } diff --git a/apps/browser/src/auth/popup/home.component.html b/apps/browser/src/auth/popup/home.component.html index 6b42033c4b..42fe3106ff 100644 --- a/apps/browser/src/auth/popup/home.component.html +++ b/apps/browser/src/auth/popup/home.component.html @@ -1,3 +1,4 @@ +
diff --git a/apps/browser/src/auth/popup/lock.component.html b/apps/browser/src/auth/popup/lock.component.html index 989dc8a953..08063edfeb 100644 --- a/apps/browser/src/auth/popup/lock.component.html +++ b/apps/browser/src/auth/popup/lock.component.html @@ -1,5 +1,5 @@
-
+

{{ "verifyIdentity" | i18n }} @@ -9,7 +9,7 @@ {{ "unlock" | i18n }}

- +
diff --git a/apps/browser/src/platform/flags.ts b/apps/browser/src/platform/flags.ts index 270835bc6a..f5c17ea7b4 100644 --- a/apps/browser/src/platform/flags.ts +++ b/apps/browser/src/platform/flags.ts @@ -10,7 +10,9 @@ import { GroupPolicyEnvironment } from "../admin-console/types/group-policy-envi // required to avoid linting errors when there are no flags /* eslint-disable-next-line @typescript-eslint/ban-types */ -export type Flags = {} & SharedFlags; +export type Flags = { + accountSwitching?: boolean; +} & SharedFlags; // required to avoid linting errors when there are no flags /* eslint-disable-next-line @typescript-eslint/ban-types */ diff --git a/apps/browser/src/platform/popup/header.component.html b/apps/browser/src/platform/popup/header.component.html new file mode 100644 index 0000000000..5cfdcc9969 --- /dev/null +++ b/apps/browser/src/platform/popup/header.component.html @@ -0,0 +1,14 @@ +
+
+ + + +
+ + + TODO: Current Account + + +
+
+
diff --git a/apps/browser/src/platform/popup/header.component.ts b/apps/browser/src/platform/popup/header.component.ts new file mode 100644 index 0000000000..c32ee60345 --- /dev/null +++ b/apps/browser/src/platform/popup/header.component.ts @@ -0,0 +1,27 @@ +import { Component, Input } from "@angular/core"; +import { Observable, map } from "rxjs"; + +import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; +import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; + +import { flagEnabled } from "../flags"; + +@Component({ + selector: "app-header", + templateUrl: "header.component.html", +}) +export class HeaderComponent { + @Input() noTheme = false; + authedAccounts$: Observable; + constructor(accountService: AccountService) { + this.authedAccounts$ = accountService.accounts$.pipe( + map((accounts) => { + if (!flagEnabled("accountSwitching")) { + return false; + } + + return Object.values(accounts).some((a) => a.status !== AuthenticationStatus.LoggedOut); + }) + ); + } +} diff --git a/apps/browser/src/popup/app.module.ts b/apps/browser/src/popup/app.module.ts index a26eaca8c8..3b8be00804 100644 --- a/apps/browser/src/popup/app.module.ts +++ b/apps/browser/src/popup/app.module.ts @@ -31,6 +31,7 @@ import { SsoComponent } from "../auth/popup/sso.component"; import { TwoFactorOptionsComponent } from "../auth/popup/two-factor-options.component"; import { TwoFactorComponent } from "../auth/popup/two-factor.component"; import { UpdateTempPasswordComponent } from "../auth/popup/update-temp-password.component"; +import { HeaderComponent } from "../platform/popup/header.component"; import { FilePopoutCalloutComponent } from "../tools/popup/components/file-popout-callout.component"; import { GeneratorComponent } from "../tools/popup/generator/generator.component"; import { PasswordGeneratorHistoryComponent } from "../tools/popup/generator/password-generator-history.component"; @@ -121,6 +122,7 @@ import "../platform/popup/locales"; FolderAddEditComponent, FoldersComponent, VaultFilterComponent, + HeaderComponent, HintComponent, HomeComponent, LockComponent, diff --git a/apps/browser/src/popup/scss/base.scss b/apps/browser/src/popup/scss/base.scss index 6cd99abb0d..16cac3352a 100644 --- a/apps/browser/src/popup/scss/base.scss +++ b/apps/browser/src/popup/scss/base.scss @@ -176,15 +176,28 @@ cdk-virtual-scroll-viewport::-webkit-scrollbar-thumb, } header:not(bit-callout header) { - min-height: 44px; max-height: 44px; display: flex; - border-bottom: 1px solid #000000; - @include themify($themes) { - color: themed("headerColor"); - background-color: themed("headerBackgroundColor"); - border-bottom-color: themed("headerBorderColor"); + &:not(.no-theme) { + min-height: 44px; + border-bottom: 1px solid #000000; + + @include themify($themes) { + color: themed("headerColor"); + background-color: themed("headerBackgroundColor"); + border-bottom-color: themed("headerBorderColor"); + } + } + + .header-content { + display: flex; + flex: 1 1 auto; + } + + .header-content > .right, + .header-content > .right > .right { + height: 100%; } .left, @@ -230,11 +243,6 @@ header:not(bit-callout header) { height: 100%; white-space: pre; - @include themify($themes) { - color: themed("headerColor"); - background-color: themed("headerBackgroundColor"); - } - &:hover, &:focus { @include themify($themes) { diff --git a/apps/browser/src/vault/popup/components/vault/vault-filter.component.html b/apps/browser/src/vault/popup/components/vault/vault-filter.component.html index 564cf19f2c..f9ae340a89 100644 --- a/apps/browser/src/vault/popup/components/vault/vault-filter.component.html +++ b/apps/browser/src/vault/popup/components/vault/vault-filter.component.html @@ -1,9 +1,9 @@ -
+

{{ "myVault" | i18n }}

-
+