Skip to content
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

Merged
merged 8 commits into from
Jul 2, 2024

Conversation

GPortas
Copy link
Contributor

@GPortas GPortas commented Jun 19, 2024

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.

Screenshot 2024-06-20 at 09 22 44

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

This comment has been minimized.

1 similar comment

This comment has been minimized.

@coveralls
Copy link

Coverage Status

coverage: 20.655% (-0.006%) from 20.661%
when pulling 9073328 on 10637-metadatablocks-input-levels-extension
into 853965e on develop.

@coveralls
Copy link

Coverage Status

coverage: 20.658% (-0.003%) from 20.661%
when pulling 9073328 on 10637-metadatablocks-input-levels-extension
into 853965e on develop.

This comment has been minimized.

@coveralls
Copy link

Coverage Status

coverage: 20.658% (-0.003%) from 20.661%
when pulling ab2128d on 10637-metadatablocks-input-levels-extension
into 853965e on develop.

@coveralls
Copy link

Coverage Status

coverage: 20.66% (-0.001%) from 20.661%
when pulling 1246d7c on 10637-metadatablocks-input-levels-extension
into 853965e on develop.

This comment has been minimized.

@coveralls
Copy link

Coverage Status

coverage: 20.662% (+0.001%) from 20.661%
when pulling 1606a12 on 10637-metadatablocks-input-levels-extension
into 853965e on develop.

This comment has been minimized.

@GPortas GPortas marked this pull request as ready for review June 20, 2024 08:28
@GPortas GPortas added SPA These changes are required for the Dataverse SPA Size: 3 A percentage of a sprint. 2.1 hours. labels Jun 20, 2024
@qqmyers qqmyers self-assigned this Jun 26, 2024
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.

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.

This comment has been minimized.

1 similar comment

This comment has been minimized.

@coveralls
Copy link

Coverage Status

coverage: 20.627% (-0.03%) from 20.661%
when pulling b1bed76 on 10637-metadatablocks-input-levels-extension
into 853965e on develop.

@coveralls
Copy link

Coverage Status

coverage: 20.627% (-0.03%) from 20.661%
when pulling b1bed76 on 10637-metadatablocks-input-levels-extension
into 853965e on develop.

@coveralls
Copy link

Coverage Status

coverage: 20.662% (+0.001%) from 20.661%
when pulling b1bed76 on 10637-metadatablocks-input-levels-extension
into 853965e on develop.

@coveralls
Copy link

Coverage Status

coverage: 20.662% (+0.001%) from 20.661%
when pulling b8fe59c on 10637-metadatablocks-input-levels-extension
into 853965e on develop.

Copy link

github-actions bot commented Jul 1, 2024

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10637-metadatablocks-input-levels-extension
ghcr.io/gdcc/configbaker:10637-metadatablocks-input-levels-extension

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

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.

Looks good. All comments addressed.

@stevenwinship stevenwinship merged commit b42222f into develop Jul 2, 2024
18 of 19 checks passed
@stevenwinship stevenwinship removed their assignment Jul 2, 2024
@pdurbin pdurbin added this to the 6.3 milestone Jul 2, 2024
stevenwinship pushed a commit that referenced this pull request Jul 2, 2024
* 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 <leonid@hmdc.harvard.edu>
Co-authored-by: qqmyers <qqmyers@hotmail.com>
Co-authored-by: Stephen Kraffmiller <skraffmiller@hmdc.harvard.edu>
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
@GPortas GPortas added SPA.Q3 Not related to any specific Q3 feature Original size: 3 labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA.Q3 Not related to any specific Q3 feature SPA These changes are required for the Dataverse SPA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix dataverses/{id}/metadatablocks API returned dataset field types
5 participants