Skip to content

Commit

Permalink
Update date range advisory text to display no matter what range is se…
Browse files Browse the repository at this point in the history
…lected (#477)

* Removes conditional and variables so that text is displayed all the time; adds top margin class

* Update DateFilter test snapshot

---------

Co-authored-by: Bill Whorton <>
Co-authored-by: Chris Contolini <contolini@users.noreply.github.com>
  • Loading branch information
wwhorton and contolini committed Nov 6, 2023
1 parent 6099278 commit 06888a7
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 26 deletions.
6 changes: 3 additions & 3 deletions dist/ccdb5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ccdb5.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/actions/filter.js
@@ -1,7 +1,7 @@
import { REQUERY_ALWAYS } from '../constants';

export const DATE_INTERVAL_CHANGED = 'DATE_INTERVAL_CHANGED';
export const DATE_RANGE_CHANGED = 'DATE_RANGE_CHANGED';
export const DATE_INTERVAL_CHANGED = 'changeDateInterval';
export const DATE_RANGE_CHANGED = 'changeDateRange';
export const DATES_CHANGED = 'DATES_CHANGED';
export const FILTER_ALL_REMOVED = 'FILTER_ALL_REMOVED';
export const FILTER_CHANGED = 'FILTER_CHANGED';
Expand Down
32 changes: 13 additions & 19 deletions src/components/Filters/DateFilter.js
Expand Up @@ -40,10 +40,6 @@ export const DateFilter = () => {
const [throughDate, setThroughDate] = useState(initialThroughDate);
const dispatch = useDispatch();

const from = fromDate || minDate;
const through = throughDate || maxDate;

const showWarning = dayjs('2017-04-23').isBetween(from, through, 'day');
const errorMessageText = "'From' date must be less than 'through' date";

const fromRef = useRef();
Expand Down Expand Up @@ -211,22 +207,20 @@ export const DateFilter = () => {
</span>
</>
) : null}
{showWarning ? (
<p>
{' '}
{WARN_SERIES_BREAK}
<a
href={LEARN_SERIES_BREAK}
target="_blank"
rel="noopener noreferrer"
aria-label="Learn more about Product and
<p className="u-mt15">
{' '}
{WARN_SERIES_BREAK}
<a
href={LEARN_SERIES_BREAK}
target="_blank"
rel="noopener noreferrer"
aria-label="Learn more about Product and
Issue changes (opens in new window)"
>
{' '}
Learn More
</a>
</p>
) : null}
>
{' '}
Learn More
</a>
</p>
</div>
</CollapsibleFilter>
);
Expand Down
Expand Up @@ -151,7 +151,9 @@ exports[`component::DateFilter snapshot shows a warning for April 2017 1`] = `
All
</button>
</section>
<p>
<p
className="u-mt15"
>
CFPB updated product and issue options in April 2017 and August 2023
<a
Expand Down Expand Up @@ -330,6 +332,21 @@ exports[`component::DateFilter snapshot shows errors 1`] = `
error-round.svg
</svg>
</span>
<p
className="u-mt15"
>
CFPB updated product and issue options in April 2017 and August 2023
<a
aria-label="Learn more about Product and Issue changes (opens in new window)"
href="https://www.consumerfinance.gov/data-research/consumer-complaints/#past-changes"
rel="noopener noreferrer"
target="_blank"
>
Learn More
</a>
</p>
</div>
</div>
</section>
Expand Down Expand Up @@ -486,6 +503,21 @@ exports[`component::DateFilter snapshot supports no dates in the Redux Store 1`]
All
</button>
</section>
<p
className="u-mt15"
>
CFPB updated product and issue options in April 2017 and August 2023
<a
aria-label="Learn more about Product and Issue changes (opens in new window)"
href="https://www.consumerfinance.gov/data-research/consumer-complaints/#past-changes"
rel="noopener noreferrer"
target="_blank"
>
Learn More
</a>
</p>
</div>
</div>
</section>
Expand Down

0 comments on commit 06888a7

Please sign in to comment.