mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
[PM-13930] - add cancel button to multiple screens (#13705)
* add cancel button to multiple screens * revert changes to view-v2 * remove unnecessary props * add cancel button to blocked domains
This commit is contained in:
@@ -76,5 +76,8 @@
|
|||||||
>
|
>
|
||||||
{{ "save" | i18n }}
|
{{ "save" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
|
<button (click)="goBack()" bitButton type="button" buttonType="secondary">
|
||||||
|
{{ "cancel" | i18n }}
|
||||||
|
</button>
|
||||||
</popup-footer>
|
</popup-footer>
|
||||||
</popup-page>
|
</popup-page>
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import { PopOutComponent } from "../../../platform/popup/components/pop-out.comp
|
|||||||
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";
|
||||||
|
import { PopupRouterCacheService } from "../../../platform/popup/view-cache/popup-router-cache.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-blocked-domains",
|
selector: "app-blocked-domains",
|
||||||
@@ -88,6 +89,7 @@ export class BlockedDomainsComponent implements AfterViewInit, OnDestroy {
|
|||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
|
private popupRouterCacheService: PopupRouterCacheService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
get domainForms() {
|
get domainForms() {
|
||||||
@@ -220,6 +222,10 @@ export class BlockedDomainsComponent implements AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async goBack() {
|
||||||
|
await this.popupRouterCacheService.back();
|
||||||
|
}
|
||||||
|
|
||||||
trackByFunction(index: number, _: string) {
|
trackByFunction(index: number, _: string) {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,5 +72,8 @@
|
|||||||
>
|
>
|
||||||
{{ "save" | i18n }}
|
{{ "save" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
|
<button (click)="goBack()" bitButton type="button" buttonType="secondary">
|
||||||
|
{{ "cancel" | i18n }}
|
||||||
|
</button>
|
||||||
</popup-footer>
|
</popup-footer>
|
||||||
</popup-page>
|
</popup-page>
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import { PopOutComponent } from "../../../platform/popup/components/pop-out.comp
|
|||||||
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";
|
||||||
|
import { PopupRouterCacheService } from "../../../platform/popup/view-cache/popup-router-cache.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-excluded-domains",
|
selector: "app-excluded-domains",
|
||||||
@@ -90,6 +91,7 @@ export class ExcludedDomainsComponent implements AfterViewInit, OnDestroy {
|
|||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
|
private popupRouterCacheService: PopupRouterCacheService,
|
||||||
) {
|
) {
|
||||||
this.accountSwitcherEnabled = enableAccountSwitching();
|
this.accountSwitcherEnabled = enableAccountSwitching();
|
||||||
}
|
}
|
||||||
@@ -150,6 +152,10 @@ export class ExcludedDomainsComponent implements AfterViewInit, OnDestroy {
|
|||||||
await this.fieldChange();
|
await this.fieldChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async goBack() {
|
||||||
|
await this.popupRouterCacheService.back();
|
||||||
|
}
|
||||||
|
|
||||||
async fieldChange() {
|
async fieldChange() {
|
||||||
if (this.dataIsPristine) {
|
if (this.dataIsPristine) {
|
||||||
this.dataIsPristine = false;
|
this.dataIsPristine = false;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<popup-header
|
<popup-header
|
||||||
slot="header"
|
slot="header"
|
||||||
[pageTitle]="headerText"
|
[pageTitle]="headerText"
|
||||||
[backAction]="handleBackButton.bind(this)"
|
[backAction]="handleBackButton"
|
||||||
showBackButton
|
showBackButton
|
||||||
>
|
>
|
||||||
<app-pop-out slot="end" />
|
<app-pop-out slot="end" />
|
||||||
@@ -27,6 +27,10 @@
|
|||||||
{{ "save" | i18n }}
|
{{ "save" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button (click)="handleBackButton()" bitButton type="button" buttonType="secondary">
|
||||||
|
{{ "cancel" | i18n }}
|
||||||
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
slot="end"
|
slot="end"
|
||||||
*ngIf="canDeleteCipher$ | async"
|
*ngIf="canDeleteCipher$ | async"
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ export class AddEditV2Component implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Handle back button
|
* Handle back button
|
||||||
*/
|
*/
|
||||||
async handleBackButton() {
|
handleBackButton = async () => {
|
||||||
if (this.inFido2PopoutWindow) {
|
if (this.inFido2PopoutWindow) {
|
||||||
this.popupCloseWarningService.disable();
|
this.popupCloseWarningService.disable();
|
||||||
BrowserFido2UserInterfaceSession.abortPopout(this.fido2PopoutSessionData.sessionId);
|
BrowserFido2UserInterfaceSession.abortPopout(this.fido2PopoutSessionData.sessionId);
|
||||||
@@ -225,7 +225,7 @@ export class AddEditV2Component implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await this.popupRouterCacheService.back();
|
await this.popupRouterCacheService.back();
|
||||||
}
|
};
|
||||||
|
|
||||||
async onCipherSaved(cipher: CipherView) {
|
async onCipherSaved(cipher: CipherView) {
|
||||||
if (BrowserPopupUtils.inPopout(window)) {
|
if (BrowserPopupUtils.inPopout(window)) {
|
||||||
|
|||||||
@@ -20,5 +20,8 @@
|
|||||||
>
|
>
|
||||||
{{ "upload" | i18n }}
|
{{ "upload" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
|
<button (click)="navigateBack()" bitButton type="button" buttonType="secondary">
|
||||||
|
{{ "cancel" | i18n }}
|
||||||
|
</button>
|
||||||
</popup-footer>
|
</popup-footer>
|
||||||
</popup-page>
|
</popup-page>
|
||||||
|
|||||||
Reference in New Issue
Block a user