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

Issue #1781 - Update 'Save' button behavior on view-only pages (Case-… #1960

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

gcheung-SF
Copy link
Contributor

…Control, Proband Individual, and Experimental Data).

@gcheung-SF
Copy link
Contributor Author

Steps to test #1781 in different evidences:

To test "Save" button is disabled when nothing can be changed.

  1. Log in as yourself.
  2. Create a new Gene-Disease Record.
  3. Add an article by PMIDs.
  4. Create a case-control evidence, select value for "Study Type" field but do not score.
  5. Return to Gene-Disease Curation page.
  6. Click the View/Score link in case-control evidence created in Gene Disease Input #4.
  7. Scroll down to see no select is allowed for Score field and the "Save" button is disabled.

To test warning message if no change is made when "Save" button is clicked.

  1. Continue from above, return to the same record Gene-Disease Curation page.
  2. Edit the case-control evidence, select a score, and save the evidence.
  3. From Gene-Disease Curation page, View/Score the same case-control evidence.
  4. Select a different score and click "Save" button. See the change is saved.
  5. Report Load Gene names and synonyms #3.
  6. Select a different score, then select the same original score, click "Save" button.
  7. This time see message 'Cannot save because score is not changed. Please select a new score then save.'.

To test same behavior for Proland Individual evidence;

  • Disable "Save" button when nothing can be changed.
  1. Log in as yourself.
  2. Create a new Gene-Disease Record.
  3. Add an article by PMIDs.
  4. Create an Individual evidence, select "Yes" for "Is this Individual a proband" field but do not select an variant so cannot score.
  5. Return to Gene-Disease Curation page.
  6. Click the View/Score link in individual evidence created in Gene Disease Input #4.
  7. Scroll down to see no select is allowed for "Select Status" field and the "Save" button is disabled.
  • Display warning message if no change is made when "Save" button is clicked.
  1. Continue from above, return to the same record Gene-Disease Curation page.
  2. Edit the Individual evidence, select an variant, score and save the evidence.
  3. From Gene-Disease Curation page, View/Score the same Individual evidence.
  4. Made some changes and Click "Save" button. See the change is saved.
  5. Report Load Gene names and synonyms #3.
  6. Make changes, then set back to original values, click "Save" button.
  7. This time see message 'Cannot save because no field has been modified. Please make your changes then save.'

To test same behavior for Experimental Data:

  • Display warning message if no change is made when "Save" button is clicked.
  1. Log in as yourself.
  2. Create a new Gene-Disease Record.
  3. Add an article by PMIDs.
  4. Create an Experimental evidence, select any value for required fields, either make selection for "Select Status" field or not.
  5. From Gene-Disease Curation page, View/Score the same Experimental evidence.
  6. Made some changes and Click "Save" button. See the change is saved.
  7. Report Load Gene names and synonyms #3.
  8. Make changes, then set back to original values, click "Save" button.
  9. This time see message 'Cannot save because no field has been modified. Please make your changes then save.'

@bryanwulf bryanwulf self-requested a review October 30, 2019 22:33
@markmandell markmandell self-requested a review October 30, 2019 23:28
@markmandell
Copy link
Contributor

Steps to test #1781 in different evidences:

To test "Save" button is disabled when nothing can be changed.

  1. Log in as yourself.
  2. Create a new Gene-Disease Record.
  3. Add an article by PMIDs.
  4. Create a case-control evidence, select value for "Study Type" field but do not score.
  5. Return to Gene-Disease Curation page.
  6. Click the View/Score link in case-control evidence created in Gene Disease Input #4.
  7. Scroll down to see no select is allowed for Score field and the "Save" button is disabled.

Just wanted to clarify for others testing this, although maybe I am missing something. I was successfully able to view the disabled Score input and Save button by completing all of the required fields and NOT selecting a study type.

Looks great from there :)

this.state.modifiedScore === 'none' && this.state.origScore === null) &&
(this.state.scoreExplanation === this.state.origScoreExplanation ||
this.state.scoreExplanation === '' && this.state.origScoreExplanation === null)) {
this.setState({scoreError: true, scoreErrorMsg: 'Cannot save because no field has been modified. Please make your changes then save.'});
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about changing the scoreErrorMsg to 'Cannot save because the score/explanation has not been modified..'

Just a small suggestion for clarity!

markmandell
markmandell previously approved these changes Nov 1, 2019
Copy link
Contributor

@markmandell markmandell left a comment

Choose a reason for hiding this comment

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

No errors or issues when testing the UI. Let me know what you think about the error text!

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.

None yet

2 participants