Remove optional step for DOI creation #150
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the PIDField that takes care of getting a DOI for a record (as a side note, the current InvenioRDM version being developed, version 13, has refactored the PIDField component and associated components considerably).
Default behaviour
The default behaviour for DOIs is to allow for DOIs through Datacite or external (unmanaged) DOIs - a free text field.
The external option is selected by default. Selecting the No radio button disables the input text field and displays a button to "Get a DOI". Clicking the button will submit the submission form with a RESERVE_PID action context.
When the form is submitted and internal PID is created, for example
d8vn9-t2z67
, but the record remains in draft form.Another request is made to the pids endpoint:
/d8vn9-t2z67/draft/pids/doi?expand=1
and the DOI has been reserved. As far as I understand, by reserving the DOI, metadata will be uploaded to Datacite but the DOI won't be published.New behaviour
The notion of an externally managed DOI is removed from config (see here) and the hard-coded preset default values for the form are overwritten (see here).
The user can still get and discard a DOI, regardless two DOIs will be created on publication (as DOIs are set as being mandatory in config). This form element merely allows the user to reserve a DOI and use it's value.
Improvements
This PR can be enhanced by improving label/help text and possibly adding a copy value button. Also, adding documentation about this customisation.
I'm not sure how to approach skipping the button altogether. Submitting the form on condition on load doesn't seem straight forward and neither does overwriting the publish button, moreover, the user would not be apply to see the DOI before publication then.
Developer Checklist
Developers should review and confirm each of these items before requesting review
Reviewer Checklist
Reviewers should review and confirm each of these items before approval
If there are multiple reviewers, this section can be duplicated for each reviewer
Testing
List user test scripts that need to be run
List any non-unit test scripts that need to be run