Skip to content

Added new validation for new ViewModel dialog #307

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

Conversation

bohdan-harniuk
Copy link
Collaborator

@bohdan-harniuk bohdan-harniuk commented Oct 9, 2020

Description (*)
This PR adds validation through annotations to the new ViewModel dialogue. Related issue: #302
I've removed requested validator: com.magento.idea.magento2plugin.actions.generation.dialog.validator.NewViewModelValidator

There were 4 validation rules on top of the view model name field and 2 on top of the view model parent dir field.
All validation rules transferred to the new validation principle successfully, without adding new validation rules:
image

View model name field - Not empty rule:
image
image

View model name field - Should be valid PHP Class rule:
image
image

View model name field - Should contains alphanumerical characters rule:
image
image

View model name field - Should starts with a number or capital letter rule:
image
image

View model parent dir field - Not empty rule:
image
image

View model parent dir field - Should has valid directory name rule:
image
image

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with integration/functional tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@VitaliyBoyko VitaliyBoyko merged commit 85448f7 into magento:2.0.0-develop Oct 10, 2020
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.

2 participants