#165 ensure ordering of MDBs with Citation first#8772
Conversation
pdurbin
left a comment
There was a problem hiding this comment.
I didn't run the code but this looks fine to me. Metadata blocks should now be sorted by id and since the citation block is added first, it should appear at the top.
We don't have a "display sort" field but if we really need one in the future, we could add it.
I don't know why but Jenkins decided to do another test run despite there only being one commit on this PR. Maybe it's because I fixed the link to the issue that gets closed? The timing is about right. Anyway, the first test run was fine so I think we're good: https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-8772/1/testReport/
|
The code doesn't actually rely on the citation block being added first. It relies on the name being citation, similar to the way isRequired is applied to metadata blocks. |
|
Right, for the purposes of sorting, it looks for a block called "citation" and gives it a an id of negative one. The rest of the metadata blocks depend on the order in which they were added. |
What this PR does / why we need it: For at least one dataset users are seeing custom metadata blocks appear before the Citation block on dataset view and edit. We always want to display the Citation block first among all mdbs.
Which issue(s) this PR closes:
Closes IQSS/dataverse.harvard.edu#165 When creating, editing and viewing datasets in the NegotiationDataRepository collection, its custom metadatablock appears above the Citation metadatablock
Special notes for your reviewer: This fix relies on the name of the citation block similar to the "isRequired" on the metadata block object. There is no display order field so the sort for custom mdbs is id.
Suggestions on how to test this: verify that the citation block is always rendered first.
Does this PR introduce a user interface change? If mockups are available, please link/include them here: no
Is there a release notes update needed for this change?: no
Additional documentation: none