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

DOI field fixes #401

Closed
lnielsen opened this issue Dec 5, 2021 · 0 comments
Closed

DOI field fixes #401

lnielsen opened this issue Dec 5, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@lnielsen
Copy link
Member

lnielsen commented Dec 5, 2021

The DOI field has several issue.

To test it you need to enable DOI minting:

# my-site/invenio.cfg
DATACITE_ENABLED = True
DATACITE_PREFIX = "10.1234"
DATACITE_USERNAME = "INVALID"
DATACITE_PASSWORD = "INVALID"
DATACITE_TEST_MODE = True

Serialization/Deserialization/Form state

  1. Form initialisation

It should be possible to initialise the form to start either yes or no mode:

# Yes
{"pids": {"doi": {"provider": "external", "identifier": ""}}}
# No
{"pids": {}}

Example: If a new version is created from a previous version with a minted DOI, then we should start in "No" mode.
Example: For a new deposit we start in "Yes"-mode.
The backend should be able to control the initial state based on the data it's sending.

  1. Sending data to the REST API
# Yes with an value (empty string allow)
{"pids": {"doi": {"provider": "external", "identifier": "<value>"}}}
# No - without a reserved DOI
{"pids": {}}
# No - with a reserved DOI
{"pids": {"doi": {"provider": "datacite", "identifier": "<value>", "client": datacite}}}
  1. Receiving data from the REST API

The form should not start modifying the data it receives from the backend. E.g. it looks like that if you send:

{"pids": {"doi": {"provider": "external", "identifier": ""}}} it gets changed to {"pids": {"doi": {"provider": "external"}}}.

Error messages in form feedback

Error messages should be displayed in the FormFeedback with correct label.

Example:
"Digital object identifier: Missing DOI for field."

The API delivers error messages as either (most errors or on the pids.doi):

{"errors": [
        {
            "field": "pids.doi",
            "messages": ["...." ]
        },
        {
            "field": "pids",
            "messages": ["...." ]
        },
]}

Error messages on field

Error messages should be displayed on the field. Note the error can likely be put on the text field for the unmanaged DOI.

Screenshot 2021-12-06 at 00 47 02

vs

Screenshot 2021-12-06 at 00 47 33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants