From fb3766b6c1cbd1c153b157e39b377a244a03bdc8 Mon Sep 17 00:00:00 2001 From: Daniel James Smith <2670567+djsmith85@users.noreply.github.com> Date: Thu, 9 May 2024 22:36:42 +0200 Subject: [PATCH 1/2] [CL-282] Make `app-pop-out` standalone (#9106) * Move pop-out.component into platform ownership * Make pop-out.component standalone * Fix no-floating-promises --------- Co-authored-by: Daniel James Smith --- .../popup/components/pop-out.component.html | 0 .../popup/components/pop-out.component.ts | 12 +++++++----- apps/browser/src/popup/app.module.ts | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) rename apps/browser/src/{ => platform}/popup/components/pop-out.component.html (100%) rename apps/browser/src/{ => platform}/popup/components/pop-out.component.ts (64%) diff --git a/apps/browser/src/popup/components/pop-out.component.html b/apps/browser/src/platform/popup/components/pop-out.component.html similarity index 100% rename from apps/browser/src/popup/components/pop-out.component.html rename to apps/browser/src/platform/popup/components/pop-out.component.html diff --git a/apps/browser/src/popup/components/pop-out.component.ts b/apps/browser/src/platform/popup/components/pop-out.component.ts similarity index 64% rename from apps/browser/src/popup/components/pop-out.component.ts rename to apps/browser/src/platform/popup/components/pop-out.component.ts index d60936a235..154bb55a0c 100644 --- a/apps/browser/src/popup/components/pop-out.component.ts +++ b/apps/browser/src/platform/popup/components/pop-out.component.ts @@ -1,12 +1,16 @@ +import { CommonModule } from "@angular/common"; import { Component, Input, OnInit } from "@angular/core"; +import { JslibModule } from "@bitwarden/angular/jslib.module"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -import BrowserPopupUtils from "../../platform/popup/browser-popup-utils"; +import BrowserPopupUtils from "../browser-popup-utils"; @Component({ selector: "app-pop-out", templateUrl: "pop-out.component.html", + standalone: true, + imports: [CommonModule, JslibModule], }) export class PopOutComponent implements OnInit { @Input() show = true; @@ -24,9 +28,7 @@ export class PopOutComponent implements OnInit { } } - expand() { - // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. - // eslint-disable-next-line @typescript-eslint/no-floating-promises - BrowserPopupUtils.openCurrentPagePopout(window); + async expand() { + await BrowserPopupUtils.openCurrentPagePopout(window); } } diff --git a/apps/browser/src/popup/app.module.ts b/apps/browser/src/popup/app.module.ts index e33a690aa8..05158d3295 100644 --- a/apps/browser/src/popup/app.module.ts +++ b/apps/browser/src/popup/app.module.ts @@ -41,6 +41,7 @@ import { AutofillComponent } from "../autofill/popup/settings/autofill.component import { ExcludedDomainsComponent } from "../autofill/popup/settings/excluded-domains.component"; import { NotifcationsSettingsComponent } from "../autofill/popup/settings/notifications.component"; import { PremiumComponent } from "../billing/popup/settings/premium.component"; +import { PopOutComponent } from "../platform/popup/components/pop-out.component"; import { HeaderComponent } from "../platform/popup/header.component"; import { PopupFooterComponent } from "../platform/popup/layout/popup-footer.component"; import { PopupHeaderComponent } from "../platform/popup/layout/popup-header.component"; @@ -81,7 +82,6 @@ import { VaultSettingsComponent } from "../vault/popup/settings/vault-settings.c import { AppRoutingModule } from "./app-routing.module"; import { AppComponent } from "./app.component"; -import { PopOutComponent } from "./components/pop-out.component"; import { UserVerificationComponent } from "./components/user-verification.component"; import { ServicesModule } from "./services/services.module"; import { HelpAndFeedbackComponent } from "./settings/help-and-feedback.component"; @@ -118,6 +118,7 @@ import "../platform/popup/locales"; AccountComponent, ButtonModule, ExportScopeCalloutComponent, + PopOutComponent, PopupPageComponent, PopupTabNavigationComponent, PopupFooterComponent, @@ -157,7 +158,6 @@ import "../platform/popup/locales"; GeneratorComponent, PasswordGeneratorHistoryComponent, PasswordHistoryComponent, - PopOutComponent, PremiumComponent, RegisterComponent, SendAddEditComponent, From 8e97c1c8e4c486744ceacd8ec891b09a4ff557ed Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Fri, 10 May 2024 10:50:34 +1000 Subject: [PATCH 2/2] [AC-2500] Update inline menu for collections based on collection permissions (#9080) * Add view collection options to collection row menus * Prevent DeleteAnyCollection custom users from viewing collections --- .../vault-items/vault-cipher-row.component.ts | 2 +- .../vault-collection-row.component.html | 32 +++++++---- .../vault-collection-row.component.ts | 10 ++-- .../vault-items/vault-item-event.ts | 6 +-- .../vault-items/vault-items.component.html | 8 +-- .../vault-items/vault-items.component.ts | 5 ++ .../vault/core/views/collection-admin.view.ts | 16 ++++++ .../vault/individual-vault/vault.component.ts | 2 +- .../vault-header/vault-header.component.html | 54 +++++++++++++------ .../vault-header/vault-header.component.ts | 15 ++++-- .../app/vault/org-vault/vault.component.html | 2 +- .../app/vault/org-vault/vault.component.ts | 8 +-- apps/web/src/locales/en/messages.json | 6 +++ .../src/vault/models/view/collection.view.ts | 7 +++ 14 files changed, 126 insertions(+), 47 deletions(-) diff --git a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts index ea75743a8c..bdb25cae44 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts @@ -58,7 +58,7 @@ export class VaultCipherRowComponent { } protected editCollections() { - this.onEvent.emit({ type: "viewCollections", item: this.cipher }); + this.onEvent.emit({ type: "viewCipherCollections", item: this.cipher }); } protected events() { diff --git a/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.html b/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.html index 897d360b4b..7bad783f19 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.html +++ b/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.html @@ -63,7 +63,7 @@ - - + + + + + + + + - + + + - - {{ "editInfo" | i18n }} - - + + +