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

Add a combination as-you-go and show-all-on-submit validator #10700

Merged
merged 3 commits into from Jul 31, 2017

Conversation

cvializ
Copy link
Contributor

@cvializ cvializ commented Jul 28, 2017

Closes #9427

I'm open to suggestions for changing the name of the validator. It works, but it's a little verbose.

Copy link
Contributor

@wassgha wassgha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

@@ -351,6 +361,8 @@ export function getFormValidator(form) {
return new AsYouGoValidator(form);
case CustomValidationTypes.ShowAllOnSubmit:
return new ShowAllOnSubmitValidator(form);
case CustomValidationTypes.AsYouGoShowAllOnSubmit:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we make custom-validation-reporting take multiple space-separated values, create a unified validator that takes the type of the validation(s) as a parameter and get rid of InteractAndSubmitValidator. I think the infrastructure is already there for this to happen and that way the syntax would be custom-validation-reporting = 'as-you-go show-all-on-submit'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some combinations may not make sense like show-first-on-submit show-all-on-submit but this would additionally allow show-first-on-submit as-you-go which is nice. @cvializ is this possible/easy to implement?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that should be ok, it would just show all on submit.

@amphtml-team
Copy link

amphtml-team commented Jul 31, 2017 via email

@wassgha
Copy link
Contributor

wassgha commented Jul 31, 2017

I think it's worth it, because once people start using it there's really no way to fix it without breaking pages...

@cvializ
Copy link
Contributor Author

cvializ commented Jul 31, 2017

I don't think it would necessarily break the page, it would just be documented as a deprecated alias for custom-validation="show-all-on-submit as-you-go".

@cvializ
Copy link
Contributor Author

cvializ commented Jul 31, 2017

I am going to merge and open a refactoring issue to track @wassgha's suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants