From d4767bf1724aae9d6a3719be044fc298d58ccc21 Mon Sep 17 00:00:00 2001 From: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com> Date: Fri, 4 Oct 2024 06:35:07 -0700 Subject: [PATCH] revert change to removing send tab (#11394) --- .../layout/popup-tab-navigation.component.ts | 77 +++++++------------ 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/apps/browser/src/platform/popup/layout/popup-tab-navigation.component.ts b/apps/browser/src/platform/popup/layout/popup-tab-navigation.component.ts index 22b3ffbe6d..ced3f6462e 100644 --- a/apps/browser/src/platform/popup/layout/popup-tab-navigation.component.ts +++ b/apps/browser/src/platform/popup/layout/popup-tab-navigation.component.ts @@ -1,41 +1,9 @@ import { CommonModule } from "@angular/common"; import { Component } from "@angular/core"; -import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { RouterModule } from "@angular/router"; -import { filter, map, switchMap } from "rxjs"; -import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; -import { PolicyType } from "@bitwarden/common/admin-console/enums"; -import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction"; import { LinkModule } from "@bitwarden/components"; -const allNavButtons = [ - { - label: "Vault", - page: "/tabs/vault", - iconKey: "lock", - iconKeyActive: "lock-f", - }, - { - label: "Generator", - page: "/tabs/generator", - iconKey: "generate", - iconKeyActive: "generate-f", - }, - { - label: "Send", - page: "/tabs/send", - iconKey: "send", - iconKeyActive: "send-f", - }, - { - label: "Settings", - page: "/tabs/settings", - iconKey: "cog", - iconKeyActive: "cog-f", - }, -]; - @Component({ selector: "popup-tab-navigation", templateUrl: "popup-tab-navigation.component.html", @@ -46,23 +14,30 @@ const allNavButtons = [ }, }) export class PopupTabNavigationComponent { - navButtons = allNavButtons; - constructor( - private policyService: PolicyService, - private sendService: SendService, - ) { - this.policyService - .policyAppliesToActiveUser$(PolicyType.DisableSend) - .pipe( - filter((policyAppliesToActiveUser) => policyAppliesToActiveUser), - switchMap(() => this.sendService.sends$), - map((sends) => sends.length > 0), - takeUntilDestroyed(), - ) - .subscribe((hasSends) => { - this.navButtons = hasSends - ? allNavButtons - : allNavButtons.filter((b) => b.page !== "/tabs/send"); - }); - } + navButtons = [ + { + label: "Vault", + page: "/tabs/vault", + iconKey: "lock", + iconKeyActive: "lock-f", + }, + { + label: "Generator", + page: "/tabs/generator", + iconKey: "generate", + iconKeyActive: "generate-f", + }, + { + label: "Send", + page: "/tabs/send", + iconKey: "send", + iconKeyActive: "send-f", + }, + { + label: "Settings", + page: "/tabs/settings", + iconKey: "cog", + iconKeyActive: "cog-f", + }, + ]; }