Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

268 Parsing an existing DOI #283

Merged
merged 18 commits into from
Jan 19, 2024
Merged

268 Parsing an existing DOI #283

merged 18 commits into from
Jan 19, 2024

Conversation

fostermh
Copy link
Member

#268

update doiCreationStatus on page load/refresh if datasetIdentifier is set

@fostermh fostermh linked an issue Nov 29, 2023 that may be closed by this pull request
Copy link

github-actions bot commented Nov 30, 2023

Copy link

github-actions bot commented Dec 6, 2023

Visit the preview URL for this PR (updated for commit e650531):

https://cioos-metadata-form--pr283-268-parsing-an-exist-iv7oqumk.web.app

(expires Sun, 18 Feb 2024 04:40:56 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 57eda2a7622dc877ccadb675a0532261c52b09fd

@n-a-t-e
Copy link
Member

n-a-t-e commented Dec 13, 2023

Does this do a DOI prefix check? I tried the PR preview link and pasted a random DOI and it seems to let me click the Update button.

Screen Shot 2023-12-13 at 9 09 09 AM

After clicking "Update DOI":
Screen Shot 2023-12-13 at 9 09 38 AM

added: Also noticing button appears in CIOOS Pacific form, where only Hakai and IYS currently have Datacite connection info

@fostermh
Copy link
Member Author

currently it only checks when handeling the the status response.
https://github.com/cioos-siooc/metadata-entry-form/blob/268-parsing-an-existing-doi/firebase-functions/functions/datacite.js/#L153

good point on the update. We could disable the buttons if they do not match. Currently the request is sent and datactite would respond with an erorr which is then handled in the could function

@fostermh
Copy link
Member Author

This appears to be working as expected. If someone would like to double check it would be appreciated.

@Br-Johnson
Copy link
Contributor

Br-Johnson commented Dec 21, 2023

It's telling me I have an invalid DOI, assumedly because I don't have the DOI prefix, but the status checking and look up still worked surprisingly. Might be better for the status check and updateability to not work if the doi is entered without the prefix?

image

When I added the https://doi.org prefix to the URL the Status momentarily went to 'unknown' but then to findable. Could it just display nothing, or 'checking...' while it's working through the API call?

It did manage to update the DOI successfully...confirmed that in DataCite.

It won't show the status of a this DOI registered outside of Hakai DataCite. This particular DOI was registered with CrossRef and the DataCite REST API does not index those DOIs. For that, the DataCite GraphQL API would be needed. So, any time someone enters a DOI not minted by DataCite, we wont know the status. Maybe that's fine though.
image

@fostermh
Copy link
Member Author

hmmm I get not found when I try to search for that second doi. could be a it's not 'findable' yet

Screenshot 2023-12-21 at 3 38 28 PM

@Br-Johnson
Copy link
Contributor

there's an extra dash in your url. should be https://doi.org/10.1046/j.1365-294x.1998.00324.x

@fostermh
Copy link
Member Author

fostermh commented Dec 22, 2023 via email

@Br-Johnson
Copy link
Contributor

Br-Johnson commented Dec 22, 2023 via email

@fostermh
Copy link
Member Author

ok, well that would do it then.

@Br-Johnson
Copy link
Contributor

Yeah. Not sure if it matters we can't get the status of those. Would be nice I guess but doesn't seem critical?

@fostermh
Copy link
Member Author

it also looks like we can only get 'findable' doi's via the QraphQL endpoint. Is that your expereince also? In order to get both datacite private doi's and all public we would need two api calls every time. for now I'm happy to stick with what we have.

@Br-Johnson
Copy link
Contributor

Yeah that would make sense GraphQL api is only for findable DOIs. I'm happy with what we have too

This was referenced Jan 16, 2024
@fostermh
Copy link
Member Author

fostermh commented Jan 19, 2024

I was inspired by @sorochak work with the resource URL checks and changed the status message to show up in the 'help text' for the doi field.

Screenshot 2024-01-19 at 9 38 14 AM

Unless someone has an issue with this, I think we are ready to merge this one

@Br-Johnson
Copy link
Contributor

Looks great to me. It even handles the case when I delete the draft DOI directly in DataCite and return to the form to find "DOI Not Found" and the ability to modify the DOI.

Looks ready to merge to me too

@fostermh fostermh merged commit d082ad8 into main Jan 19, 2024
3 checks passed
@fostermh fostermh deleted the 268-parsing-an-existing-doi branch January 19, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Parsing an existing DOI
3 participants