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 validation in catalog rule and shopping cart rule form #25172

Conversation

edenduong
Copy link
Contributor

Description (*)

Some fields in Catalog Rule and Shopping Cart Rule form should have more validations (Priority, Uses per Coupon, Uses per Customer, Discount Amount, Maximum Qty Discount is Applied To, Discount Qty Step (Buy X))

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Go to backend
  2. Marketing-> Cart Price Rule -> Add New Rule
    Marketing-> Catalog Price Rule -> Add New Rule
  3. Check validation in some fields (Priority, Uses per Coupon, Uses per Customer, Discount Amount, Maximum Qty Discount is Applied To, Discount Qty Step (Buy X))

Questions or comments

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 unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Oct 20, 2019

Hi @edenduong. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@rodrigowebjump
Copy link
Member

@magento give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @rodrigowebjump. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @rodrigowebjump, here is your new Magento instance.
Admin access: https://pr-25172.instances.magento-community.engineering/admin
Login: admin Password: 123123q

Copy link
Member

@rodrigowebjump rodrigowebjump left a comment

Choose a reason for hiding this comment

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

Hi @edenduong

Thanks for your contribution.

@magento-engcom-team
Copy link
Contributor

Hi @rodrigowebjump, thank you for the review.
ENGCOM-6143 has been created to process this Pull Request
✳️ @rodrigowebjump, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Alfa
Copy link
Contributor

engcom-Alfa commented Oct 22, 2019

Hi @edenduong,
during testing, we faced the issue. We think that the validation for "Priority" should be "validate-digits" instead "validate-numbers" because after saving the rule, the value (2,36 for example) trimmed to an integer (2) for "Priority".

And due to Magento Definition of Done all code must be covered by tests. Please cover your fix by automated tests.

@edenduong Could you take a look?

Thanks!

@engcom-Alfa engcom-Alfa added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Oct 22, 2019
@edenduong
Copy link
Contributor Author

@engcom-Alfa: I have changed the source code and Cover my fix with MFTF Test. Please check it again. Thanks.

@VladimirZaets VladimirZaets added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Progress: needs update and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Progress: ready for testing Progress: needs update labels Nov 6, 2019
@magento-engcom-team
Copy link
Contributor

Hi @VladimirZaets, thank you for the review.
ENGCOM-6143 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

…alidate_catalog_cart_rule

# Conflicts:
#	app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml
#	app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml
@m2-assistant
Copy link

m2-assistant bot commented Nov 26, 2019

Hi @edenduong, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.5 milestone Nov 26, 2019
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.

6 participants