-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[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
[Fixed] Reset feature does not clear the date #23007
Conversation
Hi @niravkrish. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @VladimirZaets, thank you for the review. |
With PR changes date is always cleared by Reset button.
Result: |
@@ -339,6 +339,7 @@ define([ | |||
*/ | |||
reset: function () { | |||
this.source.trigger('data.reset'); | |||
$('._has-datepicker').val(''); |
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.
Business logic must not rely on CSS classes, see Code Demarcation Standard. Please add appropriate data attributes instead.
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.
@orlangur updated.
@orlangur please review changes. |
@@ -339,6 +339,7 @@ define([ | |||
*/ | |||
reset: function () { | |||
this.source.trigger('data.reset'); | |||
$('[data-index$="_date"] input').val(''); |
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.
We must not rely on input
tag name. Please omit unnecessary quotes ""
.
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.
@orlangur updated.
Hi @orlangur, thank you for the review. |
✔️ QA passed |
Hi @niravkrish, thank you for your contribution! |
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)
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 (*)
Expected result (*)
All fields should be blank.
Actual result (*)
Contribution checklist (*)