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

Disable "Save" button when entry has not been changed. #576

Merged
merged 3 commits into from
Sep 15, 2017

Conversation

tech4him1
Copy link
Contributor

- Summary

Fixes #573.
This disables the "Save" button until a user has changed an entry. This also applies to new entries -- the user must modify a field before the "Save" button works.

@erquhart Do you think it is worth naming the prop that is passed to the component something other than hasChanged, kind of like was done for showDelete?

- Test plan

Manually tested using example config.

- Description for the changelog

Disable "Save" button when entry has no changes.

- A picture of a cute animal (not mandatory but encouraged)

@tech4him1 tech4him1 requested a review from erquhart September 3, 2017 01:29
Copy link
Contributor

@erquhart erquhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tech4him1 thanks for this! I agree, changing the prop name makes sense, probably showSave.

You'll also need to update the Jest snapshots so the test passes (use npm test -- -u).

@tech4him1
Copy link
Contributor Author

tech4him1 commented Sep 11, 2017

@erquhart I changed it to enableSave, how does that sound? Also, do you have any better descriptions for the new tests I wrote?

@tech4him1 tech4him1 requested review from Benaiah and removed request for Benaiah September 11, 2017 20:28
Copy link
Contributor

@Benaiah Benaiah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@erquhart erquhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erquhart erquhart merged commit 63b874e into master Sep 15, 2017
@erquhart erquhart deleted the entry-disable-save branch September 15, 2017 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User should not be allowed to save an entry if is has not been changed
3 participants