-
Notifications
You must be signed in to change notification settings - Fork 495
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
Fix metadata field type display condition in dataverses/{id}/metadatablocks API endpoint #10642
Fix metadata field type display condition in dataverses/{id}/metadatablocks API endpoint #10642
Conversation
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this looks fine. I have a question as to whether one of the new methods is needed. Depending on the answer there, there could be changes or this could go ahead as is.
The IT test looks OK but a little hard to follow, so making sure manual QA includes the recommended comparison between the JSF UI and API output would be a good confirmation.
src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java
Outdated
Show resolved
Hide resolved
src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java
Outdated
Show resolved
Hide resolved
src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. All comments addressed.
* Initial changes * Update with 4th lvl H * Table of contet change * MD format test * External voc info update * Update 1:04 * First version for PR * a few quick changes to the upgrade instruction #10646 * Update 6.3-release-notes.md * keywordTermURI heading #10646 * removed reExportAll from the upgrade instruction; it's only needed if they choose to perform the optional step of migrating some metadata fields; and it is already mentioned in the instruction on how to do that. #10646 * simplified the jvm options part of the payara upgrade instruction #10646 * moved payara upgrade into the main upgrade instruction #10646 * typos #10646 * added the Solr upgrade instruction #10646 * cosmetic #10646 * cosmetic #10646 * Deleted the solr upgrade note. #10646 * Initial changes * #10646 add note about file access request email update * Add issue number test * add featured collection link * Test issue link * Batch of issues # * Bug fixes issues no * #10646 add issue link * normalize line endings #10646 * various improvments #10646 * reorder #10646 * add Contributor Guide to 6.3 release notes #10646 * incorporate #10637 into release note #10646 * Update 6.3-release-notes.md * Make Hidden HTML fields one more element in the ext. vocab updates * Removing snippets * small tweaks to upgrade instructions #10646 * no need to mention #10637 and #10642 as they were pre-release #10646 * s/safe/supported/ and remove dupe #10646 --------- Co-authored-by: Leonid Andreev <[email protected]> Co-authored-by: qqmyers <[email protected]> Co-authored-by: Stephen Kraffmiller <[email protected]> Co-authored-by: Philip Durbin <[email protected]>
What this PR does / why we need it:
dataverses/{id}/metadatablocks API endpoint has been fixed, since the fields returned for each metadata block when returnDatasetTypes query parameter is set to true was not correct.
Which issue(s) this PR closes:
Closes #10637
Special notes for your reviewer:
The goal of the changes is for the endpoint to return the correct blocks and field types for both the create dataset form (onlyDisplayedOnCreate=true) and the edit dataset form (onlyDisplayedOnCreate=false).
The conditions on the input levels, which are configured when creating or editing the collection, were not working as expected.
Suggestions on how to test this:
New IT tests have been added, but for manual testing, follow these steps:
Create different collections with required or included fields (input levels) using the checkboxes in the metadata fields section.
Then, call the dataverses/{id}/metadatablocks API endpoint using returnDatasetFieldTypes=true, for each collection you created.
First, add onlyDisplayedOnCreate=true to return the fields that should be displayed in the create dataset form. This should match what you see on JSF:
curl -H "X-Dataverse-key:XXXXX" "http://localhost:8080/api/dataverses/{ID}/metadatablocks?returnDatasetFieldTypes=true&returnDatasetFieldTypes=true"
Then, add onlyDisplayedOnCreate=false, to return the fields you see in the edit dataset form. Again, this should match what you see on JSF:
curl -H "X-Dataverse-key:XXXXX" "http://localhost:8080/api/dataverses/{ID}/metadatablocks?returnDatasetFieldTypes=false&returnDatasetFieldTypes=true"
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?:
Yes, attached.
Additional documentation:
None