metacatui
metacatui copied to clipboard
Fixing a pop-up window that causes confusion after submitting a dataset
Describe the bug After clicking "Submit Dataset" on the site, green text appears stating, "Thank you, your changes have been saved. Your data set is under review by the Arctic Data Center team." However, if you click "View your dataset," a small pop-up window appears saying that if you leave the page, any unsaved changes will be lost. This may confuse PIs because they may be unsure if their data is actually saved or not. I think the pop-up window should be deleted or say something different.
To Reproduce Steps to reproduce the behavior:
- Click on any dataset at ADC and click "Edit"
- Make any edits
- Click "Submit dataset" when you're done
- Click "View your dataset"
- Pop-up window should appear saying that if you leave the page, any unsaved changes will be lost.
Additional context A PI was confused when this happened to her here: https://support.nceas.ucsb.edu/rt/Ticket/Display.html?id=20184
@laurenwalker this seems to have caused some confusion again on a separate ticket
@laijasmine Thank you
Documenting another case raised in RT.
The same issue, except in portals: https://github.com/NCEAS/metacatui/issues/1267
Notes from looking into this:
- In
EML211EditorView, the "unsaved changes will be lost" popup shows when thehasUnsavedChangesmethod returns true. EML211EditorView.hasUnsavedChangesreturns true ifMetacatUI.rootDataPackage.getQueue()has any items in the queue (length > 0).DataPackage.getQueue()simply filters the models in the collection for any that haveuploadStatusset toq(queuing) orp(in progress).- In my tests, the metadata document in the package did in fact have
uploadStatusset toq(thus giving a queue length of 1), even though it was already successfully uploaded. - So the fix involves investigating why that status doesn't change after a successful upload.