DMPRoadmap / roadmap

DCC/UC3 collaboration for a data management planning tool
MIT License
102 stars 109 forks source link

Plan edit does not save answer if note is added immediately #181

Closed briri closed 7 years ago

briri commented 7 years ago
  1. Go to the edit plan page and click on the phase tab to start editing
  2. Enter an answer to one of the questions
  3. Click save (the messaging below the answer indicates that the answer was saved)
  4. Enter a note/comment for the same question
  5. Save the note
  6. When the page reloads you answer will be gone
raycarrick-ed commented 7 years ago

checked old dmponline v4 and bug exists in code there. In roadmap there also seems to be bugs in adding more than one note

briri commented 7 years ago

Saving answers works sometimes. I didn't test extensively but it looked like it was saving the answer only if the question had a note first. To recreate the issue:

This page had some weirdness in the original DMPonline_v4 code where it was always auto-creating answers. I am wondering if the process of adding the note causes it to create an empty answer. That way the second attempt to add an answer is actually an update rather than insert.

raycarrick-ed commented 7 years ago

The fundamental issue here is that saving answers and notes use two different approaches. Saving answers does it as an AJAX call and saving notes as a post and redraw the whole page. I think we need to change to both being AJAX calls. However, this is complicated by the fact that the HTML is significantly different depending on whether there is guidance or not. Will require quite a bit of reworking.

raycarrick-ed commented 7 years ago

Some of this is fixed in https://github.com/DigitalCurationCentre/roadmap/commit/ea71f05769f349664752efeabca17df9c7dbb1cd but there is more to do. Answer text wasn't always saving properly. But the note saving still need rewritten as AJAX to avoid the clashing save mechanisms.

xsrust commented 7 years ago

Tested the two use cases posted above and I was unable to produce any unexpected behavior around saving notes or answers.
This appears to be fixed

stephaniesimms commented 7 years ago

Tested the use cases above as well and everything working as expected.