Skip to content

Conversation

drpayyne
Copy link
Contributor

@drpayyne drpayyne commented Oct 23, 2020

Description

Changed validator for com.magento.idea.magento2plugin.actions.generation.dialog.NewCronjobDialog

Fixed Issues

  1. Change validation for the new cron job dialog window #299: Change validation for the injection of new cron job dialog window

Additional Changes

  • Added a new rule BoxNotEmptyRule to validate if an option from the dropdown is selected. This can be ported to validate module list dropdown and theme list dropdown as well, while implementing filtering. So we end up getting a validation of 'an option from the pre-populated list is selected' and a filtering the list with an editable field.

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)

Comment on lines -257 to -281
final String moduleName = dialog.getCronjobModule();
final NamespaceBuilder namespaceBuilder = new NamespaceBuilder(
moduleName,
cronjobClassName,
cronjobDirectory
);
final PhpClass cronjobClassFile = GetPhpClassByFQN.getInstance(project).execute(
namespaceBuilder.getClassFqn()
);

if (cronjobClassFile != null) {
final String errorMessage = validatorBundle.message(
"validator.file.alreadyExists",
"Cronjob Class"
);

JOptionPane.showMessageDialog(
null,
errorMessage,
errorTitle,
JOptionPane.ERROR_MESSAGE
);

return false;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is yet to be implemented. Similar to checking if PHP class exists already.

Copy link
Contributor

@VitaliyBoyko VitaliyBoyko left a comment

Choose a reason for hiding this comment

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

👍

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.

3 participants