9376 - Fix the order of metadatablocks in templates#9377
Conversation
qqmyers
left a comment
There was a problem hiding this comment.
Makes sense. A clear parallel with the dataset case. The only minor comment I have is that I'm not sure that interfaces need to all be for a TreeMap - as long as the two constructors change from HashMap, the others could still be Map. That said, the dataset code did the same thing and it's a minor point, so not really worth a change.
|
@qqmyers I agree 100% about the interfaces, but since it was done that way for dataset, I decided to keep in that way here as well. Alternatively, we could switch back to Map and also change the ones in DatasetVersionUI? Not sure if it's worth the effort. |
|
Yep - no change requested... |
|
I'm seeing all blocks, even ones not enabled, appearing when create template in a sub collection. Also, not sure how the ordering in create/edit dataset happens, citation is first but the others can't determine what ordering criteria is used. This was a misunderstanding where on dataset create, only those blocks that have required fields are shown. Otherwise, create template and edit dataset block list are the same. |
What this PR does / why we need it:
This fixes the order of the metadata blocks when viewing or editing templates.
Which issue(s) this PR closes:
Closes #9376
Special notes for your reviewer:
The changes made here were parallel to the changes made in #8772 .
So now, the Maps for metadata blocks in Template.java are TreeMaps. (note: metadata blocks were already made Comparable in that PR, so that change did not need to be carried over)
Suggestions on how to test this:
Create or edit or a template in a dataverse collection for a dataverse that has a custom block. Confirm that the order of the blocks is the same as they appear on the dataset page. (namely that Citation block is first)
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Technically, yes, in that it changes the order the blocks are displayed. But I wouldn't consider that a UI/UX change.
Is there a release notes update needed for this change?:
No
Additional documentation: