ES-DOC / esdoc-questionnaire

ES-DOC Questionnaire (webform generator for creating CIM Documents). POC: @allynt
Other
2 stars 1 forks source link

Rendering of document version is not being updated upon save. #547

Closed allynt closed 7 years ago

allynt commented 7 years ago

WHO: @davidhassell

Rendering of document version is not being updated upon save. That is, the document version is correctly incremented, but the rendering of that version that appears in the lower right corner of the page only gets changed on a page refresh.

allynt commented 7 years ago

D'oh! There is a simple reason for this. Upon a successful save, the JS code does the following:

if (old_realization_id != realization_id) {
  $scope.reset_urls();
  window.location = $scope.view_url;
}
else {
  check_msg();
 }

So, the page is only refreshed when the id changes which only happens when a new document is saved.

allynt commented 7 years ago

134ce8da75c0247c991c874201570c912425f7a2 fixed this in 2 ways:

  1. correct a bug setting view_url_dirname in the q_edit_existing view (to not include the model id)
  2. explicitly reset the id & version of the JSON model object upon a successful call to the QModelReaizationDetail#put view in "q_ng_edit.js"