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 ListMetadataBlocksCommand to not return fields marked as displayOnCreate=true if there is an input level with include=false #10741

Closed
GPortas opened this issue Aug 5, 2024 · 0 comments · Fixed by #10767
Assignees
Labels
GREI Re-arch Issues related to the GREI Dataverse rearchitecture Original size: 10 Size: 10 A percentage of a sprint. 7 hours. SPA.Q3 Not related to any specific Q3 feature SPA These changes are required for the Dataverse SPA Type: Bug a defect
Milestone

Comments

@GPortas
Copy link
Contributor

GPortas commented Aug 5, 2024

What steps does it take to reproduce the issue?

Create a collection from JSF, in the metadata blocks section, uncheck the option to inherit the metadata blocks from the parent. In citation, deselect the Notes field, which is a field with displayOnCreate=true in the database.

Submit the new collection. When creating a dataset in the new collection, you will see that Notes does not appear, even though the configuration will remain with displayOnCreate=true in the database. The input level with include=false takes precedence over displayOnCreate=true and therefore is not displayed.

The API for collection/{id}/metadata blocks, which uses ListMetadataBlocksCommand, returns this field when displayOnCreate=true.

Since there is an input level with include=false, this field should not be returned from the API.

We need to update the related queries in MetadataBlockServiceBean

  • When does this issue occur?

We detected it on the SPA, since it uses the mentioned endpoint.

  • Which page(s) does it occurs on?

None on JSF

  • What happens?

n/a

  • To whom does it occur (all users, curators, superusers)?

API users

  • What did you expect to happen?

The API for collection/{id}/metadata blocks, which uses ListMetadataBlocksCommand, should not any field with displayOnCreate=true if there is an input level with include=false.

Which version of Dataverse are you using?

latest develop

Any related open or closed issues to this bug report?

@GPortas GPortas added Type: Bug a defect Size: 10 A percentage of a sprint. 7 hours. SPA These changes are required for the Dataverse SPA GREI Re-arch Issues related to the GREI Dataverse rearchitecture labels Aug 5, 2024
@GPortas GPortas changed the title Fix ListMetadataBlocksCommand to not return fields marked as displayOnCreate=true if there is an input levels with include=false Fix ListMetadataBlocksCommand to not return fields marked as displayOnCreate=true if there is an input level with include=false Aug 5, 2024
@GPortas GPortas self-assigned this Aug 8, 2024
GPortas added a commit that referenced this issue Aug 13, 2024
stevenwinship pushed a commit that referenced this issue Aug 20, 2024
…lds marked as displayOnCreate=true if there is an input level with include=false (#10767)

* Fixed: MetadataBlockServiceBean to check for not excluded fields in input levels

* Changed: using queries for obtaining dataset field types based on displaying conditions

* Refactor: json printer method for MetadataBlock

* Added: IT test case for list metadata blocks testing field with include=false and displayOnCreate=true property

* Fixed: removed condition in MetadataBlockServiceBean

* Added: release notes for #10741

* Fixed: displayOnCreate query logic

* Fixed: excluding conditionally required fields when display-on-create is true

* Fixed: query predicate for required-in-dataverse field condition
@pdurbin pdurbin added this to the 6.4 milestone Aug 23, 2024
stevenwinship pushed a commit that referenced this issue Sep 4, 2024
* Fixed: MetadataBlockServiceBean to check for not excluded fields in input levels

* Changed: using queries for obtaining dataset field types based on displaying conditions

* Refactor: json printer method for MetadataBlock

* Added: IT test case for list metadata blocks testing field with include=false and displayOnCreate=true property

* Fixed: removed condition in MetadataBlockServiceBean

* Added: release notes for #10741

* Fixed: displayOnCreate query logic

* Fixed: excluding conditionally required fields when display-on-create is true

* Fixed: query predicate for required-in-dataverse field condition

* Fixed: addDataverse API facetIds field json structure

* Added: docs #10800
@GPortas GPortas added SPA.Q3 Not related to any specific Q3 feature Original size: 10 labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GREI Re-arch Issues related to the GREI Dataverse rearchitecture Original size: 10 Size: 10 A percentage of a sprint. 7 hours. SPA.Q3 Not related to any specific Q3 feature SPA These changes are required for the Dataverse SPA Type: Bug a defect
Projects
Status: No status
2 participants