From caece397c68055666b5323aaf02dd7d35a1260b0 Mon Sep 17 00:00:00 2001 From: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:35:12 -0700 Subject: [PATCH] [PM-11927] - File Send popout dialog (#11138) * file popout component * finish file popout dialog * finalize send popout dialog component * fix tests * conditionally provide file popout dialog * simplify send file popout dialog * add file popout dialog container * remove unnecessary modules --- apps/browser/src/_locales/en/messages.json | 11 +++++++ .../add-edit/send-add-edit.component.html | 2 ++ .../add-edit/send-add-edit.component.ts | 2 ++ ...ile-popout-dialog-container.component.html | 0 ...-file-popout-dialog-container.component.ts | 31 +++++++++++++++++++ .../send-file-popout-dialog.component.html | 20 ++++++++++++ .../send-file-popout-dialog.component.ts | 25 +++++++++++++++ .../tools/popup/send-v2/send-v2.component.ts | 5 --- 8 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 apps/browser/src/tools/popup/send-v2/send-file-popout-dialog/send-file-popout-dialog-container.component.html create mode 100644 apps/browser/src/tools/popup/send-v2/send-file-popout-dialog/send-file-popout-dialog-container.component.ts create mode 100644 apps/browser/src/tools/popup/send-v2/send-file-popout-dialog/send-file-popout-dialog.component.html create mode 100644 apps/browser/src/tools/popup/send-v2/send-file-popout-dialog/send-file-popout-dialog.component.ts diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 8c08caec35..49b5eb82bb 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -2504,6 +2504,14 @@ "message": "Send saved", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, + "sendFilePopoutDialogText": { + "message": "Pop out extension?", + "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." + }, + "sendFilePopoutDialogDesc": { + "message": "To create a file Send, you need to pop out te extension to a new window.", + "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." + }, "sendLinuxChromiumFileWarning": { "message": "In order to choose a file, open the extension in the sidebar (if possible) or pop out to a new window by clicking this banner." }, @@ -2513,6 +2521,9 @@ "sendSafariFileWarning": { "message": "In order to choose a file using Safari, pop out to a new window by clicking this banner." }, + "popOut": { + "message": "Pop out" + }, "sendFileCalloutHeader": { "message": "Before you start" }, diff --git a/apps/browser/src/tools/popup/send-v2/add-edit/send-add-edit.component.html b/apps/browser/src/tools/popup/send-v2/add-edit/send-add-edit.component.html index 7f723cc736..e96a0742a0 100644 --- a/apps/browser/src/tools/popup/send-v2/add-edit/send-add-edit.component.html +++ b/apps/browser/src/tools/popup/send-v2/add-edit/send-add-edit.component.html @@ -9,6 +9,8 @@ > + + + + + diff --git a/apps/browser/src/tools/popup/send-v2/send-file-popout-dialog/send-file-popout-dialog.component.ts b/apps/browser/src/tools/popup/send-v2/send-file-popout-dialog/send-file-popout-dialog.component.ts new file mode 100644 index 0000000000..fb21b5bb02 --- /dev/null +++ b/apps/browser/src/tools/popup/send-v2/send-file-popout-dialog/send-file-popout-dialog.component.ts @@ -0,0 +1,25 @@ +import { CommonModule } from "@angular/common"; +import { Component } from "@angular/core"; + +import { JslibModule } from "@bitwarden/angular/jslib.module"; +import { ButtonModule, DialogModule, DialogService, TypographyModule } from "@bitwarden/components"; + +import BrowserPopupUtils from "../../../../platform/popup/browser-popup-utils"; + +@Component({ + selector: "send-file-popout-dialog", + templateUrl: "./send-file-popout-dialog.component.html", + standalone: true, + imports: [JslibModule, CommonModule, DialogModule, ButtonModule, TypographyModule], +}) +export class SendFilePopoutDialogComponent { + constructor(private dialogService: DialogService) {} + + async popOutWindow() { + await BrowserPopupUtils.openCurrentPagePopout(window); + } + + close() { + this.dialogService.closeAll(); + } +} diff --git a/apps/browser/src/tools/popup/send-v2/send-v2.component.ts b/apps/browser/src/tools/popup/send-v2/send-v2.component.ts index 19fff402e2..26a995e8c4 100644 --- a/apps/browser/src/tools/popup/send-v2/send-v2.component.ts +++ b/apps/browser/src/tools/popup/send-v2/send-v2.component.ts @@ -51,17 +51,12 @@ export enum SendState { }) export class SendV2Component implements OnInit, OnDestroy { sendType = SendType; - sendState = SendState; protected listState: SendState | null = null; - protected sends$ = this.sendItemsService.filteredAndSortedSends$; - protected title: string = "allSends"; - protected noItemIcon = NoSendsIcon; - protected noResultsIcon = Icons.NoResults; protected sendsDisabled = false;