From 64dc52b161e8d9efd9ce3a2c9aae54309485b13c Mon Sep 17 00:00:00 2001 From: Felix Hennig Date: Thu, 4 Jun 2026 12:41:49 +0200 Subject: [PATCH] feat(wasap): make location filter required Show an inline error on the location field and disable the Apply button when the field is empty, preventing users from applying filters without a sampling location selected. Co-Authored-By: Claude Sonnet 4.6 --- .../pageStateSelectors/ApplyFilterButton.tsx | 32 ++++++++++++------- .../wasap/WasapPageStateSelector.tsx | 6 +++- .../wasap/utils/LabeledField.tsx | 11 ++++++- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/website/src/components/pageStateSelectors/ApplyFilterButton.tsx b/website/src/components/pageStateSelectors/ApplyFilterButton.tsx index d3d7b5736..e185514aa 100644 --- a/website/src/components/pageStateSelectors/ApplyFilterButton.tsx +++ b/website/src/components/pageStateSelectors/ApplyFilterButton.tsx @@ -12,10 +12,12 @@ export function ApplyFilterButton({ newPageState, setPageState, className = '', + disabled = false, }: WithClassName<{ pageStateHandler: PageStateHandler; newPageState: PageState; setPageState: Dispatch>; + disabled?: boolean; }>) { const url = pageStateHandler.toUrl(newPageState); const fullUrl = `${window.location.origin}${url}`; @@ -25,18 +27,26 @@ export function ApplyFilterButton({ setPageState(newPageState); }; - return urlTooLong ? ( - <> - - Apply filters - -
- - The URL is too long ({fullUrl.length} characters, maximum {MAX_URL_LENGTH}). Please reduce the - amount of data in the filters. + if (urlTooLong) { + return ( + <> + + Apply filters -
- +
+ + The URL is too long ({fullUrl.length} characters, maximum {MAX_URL_LENGTH}). Please reduce the + amount of data in the filters. + +
+ + ); + } + + return disabled ? ( + + Apply filters + ) : (