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

Enable client side validation in Create Process form #5519

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

BartChris
Copy link
Collaborator

@BartChris BartChris commented Jan 23, 2023

resolves #3403

As discussed in the linked issue: The current behavior does not seem correct since no client side checking is ever performed during process creation for most field types. Apart from that: the current settings are not consistent since there is validation performed on radio buttons but not on normal text inputs.

My proposal would be to enforce that the user enters required values during process creation, to ensure that only valid processes are created.

I would prefer an even stricter validation on process creation (e.g. checking if the pattern of the field values conforms with the ruleset), but this would require more logic. So it would be good to prevent at least empty values on required fields.

The implemented logic ensures that the client validation is only triggered during process creation, since the element with id editForm exists only in the page layout used during process creation:
item.required and (not empty param['editForm:save'] or not empty param['editForm:saveContinue'])

My implementation reflects my understanding of the issue: There should probably be no enforced client side validation in the editor since that might prevent people from saving whose task is just about structuring the document but not working on the metadata for example. But this could be discussed as well since actually enforcing values in required fields prevents errors earlier in the workflow (although metadata validation is always executed during export)

@andre-hohmann

@solth solth requested a review from IkramMaalej February 16, 2023 13:12
@solth
Copy link
Member

solth commented Feb 20, 2023

@BartChris please rebase against the current master as your PR is the next merge candidate.

@BartChris BartChris force-pushed the enable_client_validation_of_metadata branch from d395649 to 12ee922 Compare February 20, 2023 12:34
@solth solth merged commit 641e0c2 into kitodo:master Feb 21, 2023
@BartChris BartChris deleted the enable_client_validation_of_metadata branch March 10, 2023 17:56
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.

Incomplete validation by creation of new processes
3 participants