-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Disable 'Save' button when there are no changes #5595
Disable 'Save' button when there are no changes #5595
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bradystroud! Thanks for another UI improvement 🚀
I've added a comment on the implementation.
Also I've noticed 2 issues:
packages/netlify-cms-core/src/components/Editor/EditorToolbar.js
Outdated
Show resolved
Hide resolved
packages/netlify-cms-core/src/components/Editor/EditorToolbar.js
Outdated
Show resolved
Hide resolved
Hi @erezrokah,
I guess it makes sense for it to show up after publishing, but ideally, I think the message should be different for non editorial workflows. e.g. CHANGES PUBLISHED but that should be a seperate issue.
I have fixed this in my latest commit. Screen.Recording.2021-07-12.at.6.22.36.pm.movFigure: No layout shifting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bradystroud, thanks for the follow up.
I would like to confirm the intended behavior before moving forward.
Editorial workflow
-
A published entry with no linked draft -
changes saved
appears only after saving.
-
A published entry with a linked draft -
changes saved
appears all the time including on first editor open.
-
Unpublished draft -
changes saved
appears all the time including on first editor open.
Simple workflow
Is that expected?
Should the behavior be - never show changes saved
on first editor open, then once the user clicks save always show it until the next time the editor is opened (as long as they are no pending changes).
Please let me know what you think
As an additional note, how about separating disabling the |
Hi @erezrokah,
It was not expected - Instead we agree with your suggestion.
Since we agree on the expected behaviour, I don't think that is necessary. I will make these changes today. |
Hi @erezrokah, I believe the expected behaviour is not possible as in the editorial workflows, the editor "reloads" and starts a new session when save is pressed. Do you think this is a problem? When you press save, there is an alert anyway. Alternatively, we could show 'CHANGES SAVED' if there is a saved draft. See this updated expected behaviour: Editorial workflow
Simple workflow
Let me know if any further clarification is needed. Thanks, -Brady |
I'm not sure I understand the problem you're referring to nor the alert. Do you mean the publish alert? Saving doesn't show an alert. Also to confirm - the editor reloads when you publish in simple workflow mode too, correct?
I think those makes senes - I would prefer to have a better indiction if a workflow entry is new or linked to an existing published entry, but that's another issue. |
Hi @erezrokah, I am trying to fix the failing test. I followed https://github.com/netlify/netlify-cms/blob/master/CONTRIBUTING.md#debugging-git-gateway to run the test locally, but it has succeeded. I am using the same config.yml file, so I am not sure why I can't reproduce it. |
Hi @erezrokah,
I don't think this behaviour is possible for the same reasons mentioned in #5595 (comment) There are 2 alternative behaviours for the Simple Workflow Simple workflow - alternative behaviour 1
Simple workflow - alternative behaviour 2 (original behaviour - same as before this PR)
Personally, I prefer Alternative 2. Let me know what you think. |
Yes I prefer that too. Would it make sense to keep this behavior for editorial workflow too for consistency? Also, that test has been flaky on CI (I haven't been able to fix it yet) so if it passes locally you can ignore the failure. |
Yes, I have made this change in my latest commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Summary
Closes #5553.
Test plan
Added a few tests
Figure: When no changes have been made or saved
Figure: When changes have been saved
Checklist
Please add a
x
inside each checkbox:yarn format
.yarn test
.A picture of a cute animal (not mandatory but encouraged)