Closed magicalmary closed 1 month ago
Looks like the user successfully registered a DMP ID but the code is now failing when trying to build the link to the DMP ID landing page on this line.
It's looking for the pages in the draft_data portion of the JSON record but it is either null of does not conform to the DOI regex for some reason. Will investigate and try to get something out with the changes for issue #565
Rails is sending the following in the draft_data
block to the React page:
{"landing_page"=>"https://doi.org/10.48321/D14F38aa13", "narrative"=>{"file_name"=>"DMP_Calkins_Proposal.pdf", "url"=>"https://dmptool.org//rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBaDBNIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--2e4787779b246e33ab823f9a40ccaf712db9e9b4/DMP_Calkins_Proposal.pdf"}}
Note that in prod, we're using the actual DOIs instead of the server names, so https://doi.org/10.48321/D14F38aa13
instead of https://dmphub.uc3prd.cdlib.net/dmps/10.48321/D14F38aa13
but the regex is looking for the pattern/dmps/
so its failing. I'm not sure what the best solution is. We could I guess check the environment to see if we're in prod but I'm not sure how to do that in JS or maybe we can have it match either /dmps
or doi.org/
?
@jupiter007 can you check the JS code to see which approach would be the most appropriate?
User at Northwestern reports the same issue: "I went back to my saved but not registered plan from yesterday. I removed the outputs and tried to register the plan. I received an error again, visual attached. Hopefully the draft plan is still there, since I can’t move beyond this screen!"
Screenshot of message attached.
Yes, the draft plans are still there and it was successfully registered. The error is related to trying to display the DMP ID on that dashboard page. we are working on it and hope to have a fix out this afternoon. @jupiter007 this one is related. If you cannot see the Upload dashboard when you change your affiliation in production, Mary might be able to show you
@magicalmary and @briri,
I created a PR for the bug fix: https://github.com/CDLUC3/dmptool/pull/568
As Brian mentioned, we are extracting the DMP ID for the Uploads table from a property called landingPageUrl
by using a regular expression. That regular expression needed to be different for production, since the path is different.
@briri it looks like DockerFile is setting the NODE_ENV for production, so I added a different regEx for when either the hostname = "dmptool.org" or when the NODE_ENV is production
.
Excellent! I can verify that the uploaded plans now appear in the table, along with a 'registered' status and DMP ID, for both Boulder and Northwestern.
As an administrator member of the University of Colorado Boulder institution, the 'Upload Plan' page shows an error message and does not allow you to proceed.
To Reproduce Steps to reproduce the behavior:
Additional context This is the same user that noted the error when trying to register his uploaded plan, related to not having a repository URL. After I informed him of this, he stated "I just deleted the output we had entered, and tried to complete the upload process again, and this time I got a different error message (see attached screenshot)."
Also, when I change my institution from Boulder to another, the 'Upload Plan' page appears as expected with no error messages.