Skip to content

9376 - Fix the order of metadatablocks in templates#9377

Merged
kcondon merged 1 commit intodevelopfrom
9376-metadatablock-order-templates
Feb 9, 2023
Merged

9376 - Fix the order of metadatablocks in templates#9377
kcondon merged 1 commit intodevelopfrom
9376-metadatablock-order-templates

Conversation

@scolapasta
Copy link
Contributor

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:

@coveralls
Copy link

Coverage Status

Coverage: 20.009%. Remained the same when pulling 87cc21f on 9376-metadatablock-order-templates into ceffb6f on develop.

Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@scolapasta
Copy link
Contributor Author

@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.

@qqmyers
Copy link
Member

qqmyers commented Feb 9, 2023

Yep - no change requested...

@kcondon kcondon self-assigned this Feb 9, 2023
@kcondon
Copy link
Contributor

kcondon commented Feb 9, 2023

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.

@kcondon kcondon merged commit 9554eaa into develop Feb 9, 2023
@pdurbin pdurbin added this to the 5.13 milestone Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix order of metadatablocks when creating and editing dataset templates in NDR collection

5 participants