Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn and save/reset when leaving a settings screen with unsaved changes #8483

Closed
kevinansfield opened this issue May 23, 2017 · 0 comments · Fixed by TryGhost/Admin#871
Closed
Assignees
Labels
affects:admin Anything relating to Ghost Admin bug [triage] something behaving unexpectedly

Comments

@kevinansfield
Copy link
Contributor

Issue Summary

If you change a setting on the "Settings - General" screen then leave the page without saving, when you come back to the screen you'll still see your unsaved changes, if you then refresh the page the old settings will return.

Steps to Reproduce

  1. Click "General" in the Settings area of the side nav
  2. Change one of the settings, e.g. enabling "Dated Permalinks"
  3. Click "Stories" in the sidebar nav
  4. Click "General" again, note that "Dated Permalinks" is still checked
  5. Refresh the page, note that "Dated Permalinks" is now unchecked

When leaving any settings screen, if there are unsaved changes we should warn the user and give them the option to save or continue and reset.

@kevinansfield kevinansfield added the affects:admin Anything relating to Ghost Admin label May 23, 2017
@ErisDS ErisDS removed the post 1.0.0 label Aug 10, 2017
@kirrg001 kirrg001 added the bug [triage] something behaving unexpectedly label Sep 18, 2017
aileen added a commit to aileen/Admin that referenced this issue Sep 27, 2017
refs TryGhost/Ghost#8483

- Adds a new modal component that gets rendered when leaving general/settings after changes have been done but not saved
aileen added a commit to aileen/Admin that referenced this issue Sep 27, 2017
closes TryGhost/Ghost#8483

- Added a new modal component that gets rendered when leaving general/settings after changes have been done but not saved
- Added test
aileen added a commit to aileen/Admin that referenced this issue Sep 28, 2017
closes TryGhost/Ghost#8483

- Added a new modal component that gets rendered when leaving general/settings after changes have been done but not saved
- Added test
aileen added a commit to aileen/Admin that referenced this issue Sep 28, 2017
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 consisten UX
- Added test
aileen added a commit to aileen/Admin that referenced this issue Sep 28, 2017
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 consisten UX
- Added test
aileen added a commit to aileen/Admin that referenced this issue Sep 28, 2017
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 consisten UX
- Added test
aileen added a commit to aileen/Admin that referenced this issue Oct 3, 2017
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 consisten UX
- Added test
aileen added a commit to aileen/Admin that referenced this issue Oct 3, 2017
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 consisten UX
- Added test
kevinansfield pushed a commit to TryGhost/Admin that referenced this issue Oct 4, 2017
… 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
kevinansfield pushed a commit to TryGhost/Admin that referenced this issue Oct 31, 2017
#891)

closes TryGhost/Ghost#9119, refs TryGhost/Ghost#8483

- Apps - AMP
   - Added `leave-settings-modal` component to Settings - Apps - AMP
- Apps - Slack
   - Added `leave-settings-modal` component to Settings - Apps - Slack
   - Added a `triggerDirtyState` action that will uses a new Array with the input data to trigger the dirty state on the parent settings model
- Apps - Unsplash
   - Added `leave-settings-modal` component to Settings - Apps - Unsplash
   - Used manual tracking of changes with using a custom `dirtyAttributes` property and a `rollbackValue` to manually rollback the `isActive` attribute on the model
- Code injection
   - Added `leave-settings-modal` component to Settings - Code injection
- Design
   - Added `leave-settings-modal` component to Settings - Design (only for navigation model)
   - Used manual tracking of changes with using a custom `dirtyAttributes`
   - Added an additional `updateLabel` action to underlying `gh-navitem` component which gets fired on the `focusOut` event, to detect changes on the label
- Team - User
   - Added `leave-settings-modal` component to Team - User
   - Used manual tracking of changes with using a custom `dirtyAttributes` to track changes in slug and role properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:admin Anything relating to Ghost Admin bug [triage] something behaving unexpectedly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants