1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 13:23:34 +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 { SendType } from "@bitwarden/common/tools/send/enums/send-type";
import { BadgeModule, ButtonModule, DialogService, MenuModule } from "@bitwarden/components";
import { DefaultSendFormConfigService } from "@bitwarden/send-ui";
import { SendAddEditComponent } from "../send-add-edit.component";
import { DefaultSendFormConfigService, SendAddEditDialogComponent } from "@bitwarden/send-ui";
@Component({
selector: "tools-new-send-dropdown",
@@ -60,6 +58,6 @@ export class NewSendDropdownComponent {
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,
ToastService,
} 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 { SharedModule } from "../../shared";
import { NewSendDropdownComponent } from "./new-send/new-send-dropdown.component";
import { SendAddEditComponent, SendItemDialogResult } from "./send-add-edit.component";
const BroadcasterSubscriptionId = "SendComponent";
@@ -140,7 +145,7 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro
return;
}
this.sendItemDialogRef = SendAddEditComponent.open(this.dialogService, {
this.sendItemDialogRef = SendAddEditDialogComponent.open(this.dialogService, {
formConfig,
});

View File

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

View File

@@ -1,6 +1,7 @@
export * from "./icons";
export * from "./send-form";
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 { SendItemsService } from "./services/send-items.service";
export { SendSearchComponent } from "./send-search/send-search.component";