1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-24 16:43:27 +00:00

[PM-28181] Open send dialog in drawer instead of popup in refreshed UI (#17666)

* [PM-28181] Open send dialog in drawer instead of popup in refreshed UI

* Fix types

* [PM-28181] Use drawer to edit sends with refreshed UI

* [PM-28181] Address bug where multiple Sends could not be navigated between
This commit is contained in:
Mike Amirault
2025-12-16 13:34:31 -05:00
committed by jaasen-livefront
parent 79d95713c3
commit 65dff3713e
5 changed files with 135 additions and 6 deletions

View File

@@ -7,7 +7,9 @@ import { SendComponent as BaseSendComponent } from "@bitwarden/angular/tools/sen
import { NoSendsIcon } from "@bitwarden/assets/svg";
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
@@ -77,6 +79,7 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro
toastService: ToastService,
private addEditFormConfigService: DefaultSendFormConfigService,
accountService: AccountService,
private configService: ConfigService,
) {
super(
sendService,
@@ -144,14 +147,21 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro
* @param formConfig The form configuration.
* */
async openSendItemDialog(formConfig: SendFormConfig) {
// Prevent multiple dialogs from being opened.
if (this.sendItemDialogRef) {
const useRefresh = await this.configService.getFeatureFlag(FeatureFlag.SendUIRefresh);
// Prevent multiple dialogs from being opened but allow drawers since they will prevent multiple being open themselves
if (this.sendItemDialogRef && !useRefresh) {
return;
}
this.sendItemDialogRef = SendAddEditDialogComponent.open(this.dialogService, {
formConfig,
});
if (useRefresh) {
this.sendItemDialogRef = SendAddEditDialogComponent.openDrawer(this.dialogService, {
formConfig,
});
} else {
this.sendItemDialogRef = SendAddEditDialogComponent.open(this.dialogService, {
formConfig,
});
}
const result = await lastValueFrom(this.sendItemDialogRef.closed);
this.sendItemDialogRef = undefined;