-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add custom Doi
and Orcid
structs and use them to warn of parsing errors as user types
#249
Conversation
…date if parsing succeeds" This reverts commit 0bdcbf4.
…to DB version on save)
…l Contributor/Work/Funder contexts
…erive of defaults
…a valid value had previously been entered
…h Doi/Orcid parsing
…vailable following update to v0.18.0)
…entry of uppercased protocol/resource name letters (the only letter orcid identifiers can contain is uppercase X, and doi identifier constraints already explicitly specify both a-z and A-Z as acceptable)
Changes following review include improving |
@ja573 In fixing merge conflicts, I added |
No, that's fine - leave it there for the time being |
Fixes #233 and #136.
DOIs/ORCIDs are stored in database with the full standardised protocol/resource name (
https://doi.org/
orhttps://orcid.org
). For display in the client, the protocol/resource name are stripped. Editable DOI/ORCID fields are now prepended with a static button containing the standardised protocol/resource name as a prompt to the user.Any entry in the field which can be successfully parsed (e.g. plain correctly constructed DOI/ORCID, DOI with
doi.org/
prepended, ORCID withhttp://ORCiD.org/
prepended) is accepted and converted on save to the display version (i.e. with protocol/resource name stripped). While the field contains a non-parsable entry, a warning tooltip is displayed, and on save, the field reverts to the previous (i.e. stored) value.Also added the wrapper type
Timestamp
forDateTime<Utc>
, facilitated by thediesel-derive-newtype
crate added for creation of theDoi
/Orcid
types, allowing custom defaults and more streamlined code.