1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 06:43:35 +00:00

Move SendAddEditDialog from web to bitwarden/send-ui (#13679)

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith
2025-03-04 19:24:00 +01:00
committed by GitHub
parent 3bd60786b1
commit 2b29bf8c23
5 changed files with 21 additions and 14 deletions

View File

@@ -8,9 +8,7 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions";
import { SendType } from "@bitwarden/common/tools/send/enums/send-type"; import { SendType } from "@bitwarden/common/tools/send/enums/send-type";
import { BadgeModule, ButtonModule, DialogService, MenuModule } from "@bitwarden/components"; import { BadgeModule, ButtonModule, DialogService, MenuModule } from "@bitwarden/components";
import { DefaultSendFormConfigService } from "@bitwarden/send-ui"; import { DefaultSendFormConfigService, SendAddEditDialogComponent } from "@bitwarden/send-ui";
import { SendAddEditComponent } from "../send-add-edit.component";
@Component({ @Component({
selector: "tools-new-send-dropdown", selector: "tools-new-send-dropdown",
@@ -60,6 +58,6 @@ export class NewSendDropdownComponent {
const formConfig = await this.addEditFormConfigService.buildConfig("add", undefined, type); const formConfig = await this.addEditFormConfigService.buildConfig("add", undefined, type);
await SendAddEditComponent.open(this.dialogService, { formConfig }); await SendAddEditDialogComponent.open(this.dialogService, { formConfig });
} }
} }

View File

@@ -23,13 +23,18 @@ import {
TableDataSource, TableDataSource,
ToastService, ToastService,
} from "@bitwarden/components"; } from "@bitwarden/components";
import { DefaultSendFormConfigService, NoSendsIcon, SendFormConfig } from "@bitwarden/send-ui"; import {
DefaultSendFormConfigService,
NoSendsIcon,
SendFormConfig,
SendAddEditDialogComponent,
SendItemDialogResult,
} from "@bitwarden/send-ui";
import { HeaderModule } from "../../layouts/header/header.module"; import { HeaderModule } from "../../layouts/header/header.module";
import { SharedModule } from "../../shared"; import { SharedModule } from "../../shared";
import { NewSendDropdownComponent } from "./new-send/new-send-dropdown.component"; import { NewSendDropdownComponent } from "./new-send/new-send-dropdown.component";
import { SendAddEditComponent, SendItemDialogResult } from "./send-add-edit.component";
const BroadcasterSubscriptionId = "SendComponent"; const BroadcasterSubscriptionId = "SendComponent";
@@ -140,7 +145,7 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro
return; return;
} }
this.sendItemDialogRef = SendAddEditComponent.open(this.dialogService, { this.sendItemDialogRef = SendAddEditDialogComponent.open(this.dialogService, {
formConfig, formConfig,
}); });

View File

@@ -19,7 +19,8 @@ import {
ToastService, ToastService,
DialogModule, DialogModule,
} from "@bitwarden/components"; } from "@bitwarden/components";
import { SendFormConfig, SendFormMode, SendFormModule } from "@bitwarden/send-ui";
import { SendFormConfig, SendFormMode, SendFormModule } from "../send-form";
export interface SendItemDialogParams { export interface SendItemDialogParams {
/** /**
@@ -49,8 +50,7 @@ export enum SendItemDialogResult {
* Component for adding or editing a send item. * Component for adding or editing a send item.
*/ */
@Component({ @Component({
selector: "tools-send-add-edit", templateUrl: "send-add-edit-dialog.component.html",
templateUrl: "send-add-edit.component.html",
standalone: true, standalone: true,
imports: [ imports: [
CommonModule, CommonModule,
@@ -64,7 +64,7 @@ export enum SendItemDialogResult {
DialogModule, DialogModule,
], ],
}) })
export class SendAddEditComponent { export class SendAddEditDialogComponent {
/** /**
* The header text for the component. * The header text for the component.
*/ */
@@ -169,8 +169,11 @@ export class SendAddEditComponent {
* @returns The dialog result. * @returns The dialog result.
*/ */
static open(dialogService: DialogService, params: SendItemDialogParams) { static open(dialogService: DialogService, params: SendItemDialogParams) {
return dialogService.open<SendItemDialogResult, SendItemDialogParams>(SendAddEditComponent, { return dialogService.open<SendItemDialogResult, SendItemDialogParams>(
SendAddEditDialogComponent,
{
data: params, data: params,
}); },
);
} }
} }

View File

@@ -1,6 +1,7 @@
export * from "./icons"; export * from "./icons";
export * from "./send-form"; export * from "./send-form";
export { NewSendDropdownComponent } from "./new-send-dropdown/new-send-dropdown.component"; export { NewSendDropdownComponent } from "./new-send-dropdown/new-send-dropdown.component";
export * from "./add-edit/send-add-edit-dialog.component";
export { SendListItemsContainerComponent } from "./send-list-items-container/send-list-items-container.component"; export { SendListItemsContainerComponent } from "./send-list-items-container/send-list-items-container.component";
export { SendItemsService } from "./services/send-items.service"; export { SendItemsService } from "./services/send-items.service";
export { SendSearchComponent } from "./send-search/send-search.component"; export { SendSearchComponent } from "./send-search/send-search.component";