-
Notifications
You must be signed in to change notification settings - Fork 500
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
Update Dataverse API removes metadatablocks if optional params are omitted #11144
Update Dataverse API removes metadatablocks if optional params are omitted #11144
Conversation
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. |
dataverse.addInputLevelsMetadataBlocksIfNotPresent(inputLevels); | ||
ctxt.fieldTypeInputLevels().deleteFacetsFor(dataverse); | ||
inputLevels.forEach(inputLevel -> { |
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.
Do we have to worry about incompatible input levels where they might put in a dataset field type that doesn't belong to the installed metadata blocks of the given dataverse"
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.
I'm not sure I understand the question. The new code does exactly what the old code did for inputLevel list that isn't empty. My goal was to remove the resetRelationsOnNullValues flag and implement a way to delete data or ignore the missing data based on the list being empty or null.
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.
Sorry, what I was wondering about is what if you add an input level for a dataset field that isn't already in a metadata block that is part of the dataverse you're updating - the answer is in line 107 - if you add an input level for a dataset field that is not already included in the dataverse then dataverse.addInputLevelsMetadataBlocksIfNotPresent(inputLevels) - will add that metadata block to the dataverse.
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.
This looks good. thanks for adding the tests.
Tests Passing - Merging PR |
What this PR does / why we need it: Better control over updating dataverse metadatablocks - update/delete-inherit
Which issue(s) this PR closes:#11130
Special notes for your reviewer: See discussion in parent issue
Suggestions on how to test this: See DataversesIT. Test different combinations of Json with the three blocks and two flags.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?: Included
Additional documentation: native-api