Open normon66 opened 3 years ago
Add a save upon leaving pages tab.
Tried a couple of solutions to this problem, but it caused either the spinner to keep spinning or the previous behavior where the Tab transition UI would lock up until the map was ready to load. Real solution will involve:
Refactoring the Pages tab to a CanJS component so we can save during teardown of that component. (hopefully only this)
Possibly upgrading/changing the jointjs map code to be in async
mode, which will be a big refactor as well
saving this branch that used nested promises to try and control for the save, then Map tab load, but caused the UI lag in case any of these ideas are helpful for the full fix: https://github.com/CCALI/a2jauthor/tree/134-save-pre-map
@mikemitchel - instead of forcing a save upon leaving Pages, what about forcing when when entering Map?
@normon66 that's the second solution that caused the UI to hang on larger interviews.
When entering Map mode from Pages mode, an automatic save would be beneficial.
If pages are added while in Pages mode and then you go to Map before forcing a save, the added page(s) will show up in the list of pages (this takes a few seconds), but they do not show up in the Map view itself. Further, if you double-click one of the newly-added pages from the page list, nothing happens, the authoring becomes unresponsive, and the below error is thrown in the console:
Similarly, if a page is deleted while in Pages mode and then the Map mode is entered before a save takes place, that deleted page still shows up in the page list, as well as the Map view itself. Double-clicking either results in a blank popup as seen below, though authoring itself does remain responsive.
There are likely other similar issues resulting from the lag between Pages and Map.