Skip to content

[Fixed] Reset feature does not clear the date #23007

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

Merged
merged 2 commits into from
Jun 8, 2019

Conversation

niravkrish
Copy link
Contributor

Description (*)

Form Reset feature does not clear the UI date field.
I have added code to clear date field in admin UI Forms.

Fixed Issues (if relevant)

  1. Reset feature does not clear the date #22940: Reset feature does not clear the date

Steps to reproduce (*)

Admin > Marketing > Catalog/Cart price rule > Add New Rule > Fill all data with date > now click on reset > Review all the fields are cleared or not

Manual testing scenarios (*)

  1. Manual Testing
  2. I have tested this changes with described steps and it is working fine.

Expected result (*)

All fields should be blank.

Actual result (*)

date-reset-issue

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 May 24, 2019

Hi @niravkrish. 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-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team
Copy link
Contributor

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

@VasylShvorak
Copy link
Contributor

With PR changes date is always cleared by Reset button.
Manual testing scenario:

  • Create Cart price rule with date (fields From and To)
  • Go to Cart price rule edit page
  • Edit Rule Name and Description, but don't touch date
  • Click Reset

Result:
✔️ Rule Name and Description are reset to previous values
❌ Date fields From and To are cleared
Notice: Dates are cleared only visual. If save Cart price rule after Reset button was clicked, dates values are same as before edit
@VladimirZaets Could you you check if it is expected behavior?

@@ -339,6 +339,7 @@ define([
*/
reset: function () {
this.source.trigger('data.reset');
$('._has-datepicker').val('');
Copy link
Contributor

Choose a reason for hiding this comment

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

Business logic must not rely on CSS classes, see Code Demarcation Standard. Please add appropriate data attributes instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

@orlangur updated.

@ghost ghost assigned orlangur May 24, 2019
@p-bystritsky p-bystritsky self-assigned this Jun 5, 2019
@p-bystritsky
Copy link
Contributor

@orlangur please review changes.

@@ -339,6 +339,7 @@ define([
*/
reset: function () {
this.source.trigger('data.reset');
$('[data-index$="_date"] input').val('');
Copy link
Contributor

Choose a reason for hiding this comment

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

We must not rely on input tag name. Please omit unnecessary quotes "".

Copy link
Contributor

Choose a reason for hiding this comment

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

@orlangur updated.

@magento-engcom-team
Copy link
Contributor

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

@VasylShvorak
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Jun 8, 2019

Hi @niravkrish, 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.

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