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 #10125

Conversation

jo-pol
Copy link
Contributor

@jo-pol jo-pol commented Nov 17, 2023

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

Have a required field in a metadatablock (e.g. type of article in the journal block) and a custom template that should 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:

@jo-pol jo-pol changed the title metadata parameters in tsv/database are enough to make SelectOneMenu … skip premature validation of required drop downs in mtadata blocks Nov 17, 2023
@jo-pol jo-pol changed the title skip premature validation of required drop downs in mtadata blocks skip premature validation of required drop downs in metadata blocks Nov 17, 2023
@qqmyers qqmyers added the Size: 3 A percentage of a sprint. 2.1 hours. label Nov 17, 2023
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.

Nice find! As discussed, this change fixes a clear bug. I'll note it also aligns the single value case with the multi-value one (which already has no required attribute). I've also tested this at QDR and seen that it resolves the issue.

@qqmyers qqmyers added the GDCC: DANS related to GDCC work for DANS label Nov 17, 2023
@jo-pol jo-pol closed this Jan 4, 2024
@jo-pol jo-pol deleted the premature-validation-blocks-template-switch branch January 4, 2024 10:24
@qqmyers
Copy link
Member

qqmyers commented Jan 4, 2024

@jo-pol - why did you close this?

@jo-pol jo-pol restored the premature-validation-blocks-template-switch branch January 5, 2024 08:13
@jo-pol
Copy link
Contributor Author

jo-pol commented Jan 5, 2024

I cleaned up in Intellij and wasn't aware this wasn't a stale branch. Thanks for the heads up.

@jo-pol jo-pol deleted the premature-validation-blocks-template-switch branch January 5, 2024 08:19
@jo-pol
Copy link
Contributor Author

jo-pol commented Jan 5, 2024

Reopened with #10210 Sorry for the inconvenience of going through the review process again. I marked the branch name to reduce the chance it happens again.

@qqmyers qqmyers removed GDCC: DANS related to GDCC work for DANS Size: 3 A percentage of a sprint. 2.1 hours. labels Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
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
2 participants