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

skip premature validation of required drop downs in metadata blocks #10210

Conversation

jo-pol
Copy link
Contributor

@jo-pol jo-pol commented Jan 5, 2024

…mandatory

What this PR does / why we need it:

It skips a premature validation phase for a metadata block field with a mandatory drop down. This allows proper template change for a blank dataset and gives clearer error messages when saving.

Which issue(s) this PR closes:

Closes #10119

Special notes for your reviewer:

The HTML attribute required triggers a premature validation in metadata blocks. The db-table datasetfieldtype controls the desired validation phase.

Suggestions on how to test this:

  • create a dataverse: https://demo.dataverse.org/ - add data - add dataverse
  • select the dataverse - edit - general information
  • make a field in a metadatablock required (e.g. type of article in the journal block)
  • create a custom template and set a field(s) in the citation block (e.g. title).
  • Create a new dataset, set none of the fields and change to the custom template, the title should be applied. Save the blank dataset and a clear error message appears for the type of article.

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?:

no

Additional documentation:

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.

Same change as in #10125

@qqmyers qqmyers added GDCC: DANS related to GDCC work for DANS Size: 3 A percentage of a sprint. 2.1 hours. labels Jan 5, 2024
@scolapasta
Copy link
Contributor

@jo-pol @qqmyers maybe this is a dumb question, but doesn't the fact that required checks to see if DatasetPage means that required would be false for templates? (at least that's how it reads it's supposed to work)

@qqmyers
Copy link
Member

qqmyers commented Jul 31, 2024

It's been a while, but I think this is a dataset page issue, when using a template.

@jo-pol
Copy link
Contributor Author

jo-pol commented Aug 5, 2024

@qqmyers @janvanmansum @scolapasta

I broke down the "suggestion to test" in smaller steps and therefore went through the procedure again as far as I remembered. Then I found more precise scenarios in #10119 and a relation with #2190

Though the PR is still open, the demo system now shows desired error indication: image

@qqmyers
Copy link
Member

qqmyers commented Sep 26, 2024

Per a note from the author in the issue, it looks like this change has already been added in #10401. So this PR and the issue can be closed.

@qqmyers qqmyers closed this Sep 26, 2024
@jo-pol jo-pol deleted the IQSS-PR-premature-validation-blocks-template-switch branch October 1, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GDCC: DANS related to GDCC work for DANS Size: 3 A percentage of a sprint. 2.1 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Premature validation of dataset metadata (single value drop down) prevents template selection
3 participants