-
Notifications
You must be signed in to change notification settings - Fork 19
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
STSMACOM-880: DateRangeFilter
- set the wrongDatesOrder
to false
when the field value changes.
#1546
Conversation
…when the field value changes.
Quality Gate passedIssues Measures |
@@ -169,6 +169,7 @@ const TheComponent = ({ | |||
...filterValue, | |||
errors: { | |||
...filterValue.errors, | |||
wrongDatesOrder: false, // dates order is validated only when the "Apply" button is clicked, not when the field value is changed |
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.
If previously this error was shown on change and now it doesn't - then this change could affect a lot of other modules and their tests, maybe some QA test cases.
Can we follow the approach from <DateFilter>
in stripes-inventory-components
where we listen to reset events and clear inputs by ref?
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.
@BogdanDenis
The approach in stripes-inventory-components
just resets the value, but the state of errors is reset in the handleDateChange
function. The problem is that the error message related to wrongDatesOrder
doesn't disappear, and this is due to the recent change in the handleDateChange
function. It seems that it was changed by accident, because this bug is still fixed. The wrongDatesOrder
was always applied when the "Apply" button was hit, and there was no requirement to change this behavior.
Purpose
DateRangeFilter: Don't display errors after the reset button is hit.
Description
Previously, the
handleDateChange
function setwrongDatesOrder
tofalse
to reset this error and only compare dates order when the "Apply" button is pressed.Issues
STSMACOM-880
Screencasts
2024-12-02_13h55_14.mp4