-
Notifications
You must be signed in to change notification settings - Fork 105
Changed new module dialog validator #318
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
if (moduleName.equals(packageName)) { | ||
final String errorMessage = validatorBundle.message( | ||
"validator.moduleNameIsTheSameAsPackage", | ||
MODULE_NAME | ||
); | ||
JOptionPane.showMessageDialog( | ||
null, | ||
errorMessage, | ||
errorTitle, | ||
JOptionPane.ERROR_MESSAGE | ||
); | ||
|
||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This exists to check if the module name and package name are identical and throws an error if so.
- Do we need this check?
- How do we perform this through annotations? Module name field validation needs to access the package name to compare.
I'm unsure on how to proceed with this. Please advise. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There no system restrictions to call module e.g Vendor_Vendor
.
However, this is wrong from the best practices standpoint.
@bohdan-harniuk
How do you think it can be implemented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand @VitaliyBoyko, but just to note: a few modules which I noticed that have the same vendor and module name
- elasticsearch/elasticsearch
- container-interop/container-interop
- cache/cache
- mockery/mockery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This PR adds validation through annotations to the new module dialog and removes the unnecessary
com.magento.idea.magento2plugin.actions.generation.dialog.validator.NewModuleDialogValidator
.Fixed Issues
Questions or comments
There is one validation pending to be refactored into the annotation-type. I have addressed that below. Please advise on how to proceed on that. Thanks!
Contribution checklist