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

STSMACOM-880: DateRangeFilter - set the wrongDatesOrder to false when the field value changes. #1546

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

Dmytro-Melnyshyn
Copy link
Contributor

@Dmytro-Melnyshyn Dmytro-Melnyshyn commented Dec 2, 2024

Purpose

DateRangeFilter: Don't display errors after the reset button is hit.

Description

Previously, the handleDateChange function set wrongDatesOrder to false 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

Copy link

github-actions bot commented Dec 2, 2024

Bigtest Unit Test Results

  1 files  ±0    1 suites  ±0   14s ⏱️ ±0s
509 tests +1  467 ✅ +1  42 💤 ±0  0 ❌ ±0 
511 runs  +1  469 ✅ +1  42 💤 ±0  0 ❌ ±0 

Results for commit 5c250f7. ± Comparison against base commit 01c052f.

Copy link

sonarqubecloud bot commented Dec 2, 2024

@Dmytro-Melnyshyn Dmytro-Melnyshyn requested review from BogdanDenis and a team December 2, 2024 12:15
@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@Dmytro-Melnyshyn Dmytro-Melnyshyn merged commit 93b1068 into master Dec 3, 2024
15 checks passed
@Dmytro-Melnyshyn Dmytro-Melnyshyn deleted the STSMACOM-880 branch December 3, 2024 11:03
zburke pushed a commit that referenced this pull request Dec 10, 2024
…` when the field value changes. (#1546)

(cherry picked from commit 93b1068)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants