This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Added confirmation dialog when leaving settings screen with unsaved…
… changes (#871) closes TryGhost/Ghost#8483 - Added a new modal component that gets rendered when leaving general/settings after changes have been done but not saved - Removed independent saving logic for social URL for consistent UX
- Loading branch information
1 parent
7f8d924
commit bbbe603
Showing
6 changed files
with
139 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import ModalComponent from 'ghost-admin/components/modal-base'; | ||
import {invokeAction} from 'ember-invoke-action'; | ||
|
||
export default ModalComponent.extend({ | ||
actions: { | ||
confirm() { | ||
invokeAction(this, 'confirm').finally(() => { | ||
this.send('closeModal'); | ||
}); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<header class="modal-header"> | ||
<h1>Are you sure you want to leave this page?</h1> | ||
</header> | ||
<a class="close" href="" title="Close" {{action "closeModal"}}>{{inline-svg "close"}}<span class="hidden">Close</span></a> | ||
|
||
<div class="modal-body"> | ||
<p> | ||
Hey there! It looks like you didn't save the changes you made. | ||
</p> | ||
|
||
<p>Save before you go!</p> | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button {{action "closeModal"}} class="gh-btn" data-test-stay-button><span>Stay</span></button> | ||
<button {{action "confirm"}} class="gh-btn gh-btn-red" data-test-leave-button><span>Leave</span></button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters