mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
add popupBackAction to send item and export vault pages (#13363)
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
import { Directive, Optional } from "@angular/core";
|
||||||
|
|
||||||
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
|
import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service";
|
||||||
|
import { BitActionDirective, ButtonLikeAbstraction } from "@bitwarden/components";
|
||||||
|
|
||||||
|
import { PopupRouterCacheService } from "../view-cache/popup-router-cache.service";
|
||||||
|
|
||||||
|
/** Navigate the browser popup to the previous page when the component is clicked. */
|
||||||
|
@Directive({
|
||||||
|
selector: "[popupBackAction]",
|
||||||
|
standalone: true,
|
||||||
|
})
|
||||||
|
export class PopupBackBrowserDirective extends BitActionDirective {
|
||||||
|
constructor(
|
||||||
|
buttonComponent: ButtonLikeAbstraction,
|
||||||
|
private router: PopupRouterCacheService,
|
||||||
|
@Optional() validationService?: ValidationService,
|
||||||
|
@Optional() logService?: LogService,
|
||||||
|
) {
|
||||||
|
super(buttonComponent, validationService, logService);
|
||||||
|
|
||||||
|
// override `bitAction` input; the parent handles the rest
|
||||||
|
this.handler = () => this.router.back();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,9 @@
|
|||||||
<button bitButton type="submit" form="sendForm" buttonType="primary" #submitBtn>
|
<button bitButton type="submit" form="sendForm" buttonType="primary" #submitBtn>
|
||||||
{{ "save" | i18n }}
|
{{ "save" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
|
<button bitButton type="button" buttonType="secondary" popupBackAction>
|
||||||
|
{{ "cancel" | i18n }}
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
*ngIf="config?.mode !== 'add'"
|
*ngIf="config?.mode !== 'add'"
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import {
|
|||||||
SendFormModule,
|
SendFormModule,
|
||||||
} from "@bitwarden/send-ui";
|
} from "@bitwarden/send-ui";
|
||||||
|
|
||||||
|
import { PopupBackBrowserDirective } from "../../../../platform/popup/layout/popup-back.directive";
|
||||||
import { PopupFooterComponent } from "../../../../platform/popup/layout/popup-footer.component";
|
import { PopupFooterComponent } from "../../../../platform/popup/layout/popup-footer.component";
|
||||||
import { PopupHeaderComponent } from "../../../../platform/popup/layout/popup-header.component";
|
import { PopupHeaderComponent } from "../../../../platform/popup/layout/popup-header.component";
|
||||||
import { PopupPageComponent } from "../../../../platform/popup/layout/popup-page.component";
|
import { PopupPageComponent } from "../../../../platform/popup/layout/popup-page.component";
|
||||||
@@ -77,6 +78,7 @@ export type AddEditQueryParams = Partial<Record<keyof QueryParams, string>>;
|
|||||||
SendFilePopoutDialogContainerComponent,
|
SendFilePopoutDialogContainerComponent,
|
||||||
SendFormModule,
|
SendFormModule,
|
||||||
AsyncActionsModule,
|
AsyncActionsModule,
|
||||||
|
PopupBackBrowserDirective,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class SendAddEditComponent {
|
export class SendAddEditComponent {
|
||||||
|
|||||||
@@ -23,5 +23,8 @@
|
|||||||
>
|
>
|
||||||
{{ "exportVault" | i18n }}
|
{{ "exportVault" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
|
<button bitButton type="button" buttonType="secondary" popupBackAction>
|
||||||
|
{{ "cancel" | i18n }}
|
||||||
|
</button>
|
||||||
</popup-footer>
|
</popup-footer>
|
||||||
</popup-page>
|
</popup-page>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { AsyncActionsModule, ButtonModule, DialogModule } from "@bitwarden/compo
|
|||||||
import { ExportComponent } from "@bitwarden/vault-export-ui";
|
import { ExportComponent } from "@bitwarden/vault-export-ui";
|
||||||
|
|
||||||
import { PopOutComponent } from "../../../../platform/popup/components/pop-out.component";
|
import { PopOutComponent } from "../../../../platform/popup/components/pop-out.component";
|
||||||
|
import { PopupBackBrowserDirective } from "../../../../platform/popup/layout/popup-back.directive";
|
||||||
import { PopupFooterComponent } from "../../../../platform/popup/layout/popup-footer.component";
|
import { PopupFooterComponent } from "../../../../platform/popup/layout/popup-footer.component";
|
||||||
import { PopupHeaderComponent } from "../../../../platform/popup/layout/popup-header.component";
|
import { PopupHeaderComponent } from "../../../../platform/popup/layout/popup-header.component";
|
||||||
import { PopupPageComponent } from "../../../../platform/popup/layout/popup-page.component";
|
import { PopupPageComponent } from "../../../../platform/popup/layout/popup-page.component";
|
||||||
@@ -25,6 +26,7 @@ import { PopupPageComponent } from "../../../../platform/popup/layout/popup-page
|
|||||||
PopupFooterComponent,
|
PopupFooterComponent,
|
||||||
PopupHeaderComponent,
|
PopupHeaderComponent,
|
||||||
PopOutComponent,
|
PopOutComponent,
|
||||||
|
PopupBackBrowserDirective,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class ExportBrowserV2Component {
|
export class ExportBrowserV2Component {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export { ButtonType } from "./shared/button-like.abstraction";
|
export { ButtonType, ButtonLikeAbstraction } from "./shared/button-like.abstraction";
|
||||||
export * from "./a11y";
|
export * from "./a11y";
|
||||||
export * from "./async-actions";
|
export * from "./async-actions";
|
||||||
export * from "./avatar";
|
export * from "./avatar";
|
||||||
|
|||||||
Reference in New Issue
Block a user