From 2a1e8b748ba3fec0d021171889c30d8bc5be24c9 Mon Sep 17 00:00:00 2001 From: Laura Whitaker Date: Thu, 7 Sep 2023 11:55:29 -0600 Subject: [PATCH] UI updates to WorkflowFilterSearch (#1613) * Remove on:blur from TextFilter * Add close button button to filters * Update DatetimeFilter UI * Update TimePicker to allow for 24 hour clock * Disabled Apply when invalid or unspecified relative time * Add check for selected prop to MenuItem * Refactor SearchAttributeMenu * Use close icon and ghost variant for close filter button * Use IconButton for CloseFilter * Update snapshot * fix icon button so it stays rounded * Disable relative vs absolute inputs --------- Co-authored-by: Ross Edfort --- .../filter-search/boolean-filter.svelte | 7 +- .../filter-search/close-filter-button.svelte | 17 ++ .../filter-search/datetime-filter.svelte | 281 ++++++++++-------- .../workflow/filter-search/index.svelte | 96 +----- .../filter-search/number-filter.svelte | 1 + .../search-attribute-menu.svelte | 114 +++++++ .../workflow/filter-search/text-filter.svelte | 4 +- .../table-header-cell.test.ts.snap | 2 +- src/lib/holocene/date-picker.svelte | 2 + src/lib/holocene/icon-button.svelte | 15 +- src/lib/holocene/menu/menu-item.svelte | 20 +- src/lib/holocene/time-picker.svelte | 25 +- 12 files changed, 343 insertions(+), 241 deletions(-) create mode 100644 src/lib/components/workflow/filter-search/close-filter-button.svelte create mode 100644 src/lib/components/workflow/filter-search/search-attribute-menu.svelte diff --git a/src/lib/components/workflow/filter-search/boolean-filter.svelte b/src/lib/components/workflow/filter-search/boolean-filter.svelte index 6690cd784..eb80f2623 100644 --- a/src/lib/components/workflow/filter-search/boolean-filter.svelte +++ b/src/lib/components/workflow/filter-search/boolean-filter.svelte @@ -23,7 +23,12 @@ - + {selectedLabel} diff --git a/src/lib/components/workflow/filter-search/close-filter-button.svelte b/src/lib/components/workflow/filter-search/close-filter-button.svelte new file mode 100644 index 000000000..860bec117 --- /dev/null +++ b/src/lib/components/workflow/filter-search/close-filter-button.svelte @@ -0,0 +1,17 @@ + + + diff --git a/src/lib/components/workflow/filter-search/datetime-filter.svelte b/src/lib/components/workflow/filter-search/datetime-filter.svelte index fdde145a5..e88558cef 100644 --- a/src/lib/components/workflow/filter-search/datetime-filter.svelte +++ b/src/lib/components/workflow/filter-search/datetime-filter.svelte @@ -1,6 +1,4 @@ @@ -136,9 +122,9 @@ =', label: translate('after').toUpperCase() }, + { value: '<=', label: translate('before') }, + { value: 'BETWEEN', label: translate('between') }, + { value: '>=', label: translate('after') }, ]} /> @@ -155,80 +141,10 @@ class="w-[25rem] !overflow-visible" > {#if isTimeRange} -
- - - - -
- -
-
- {:else} -
-
-

{translate('relative')}

-
-
- - -
- -
-
- -
+ +
-
- + + + +
+ + +
+
+ {:else} + (type = 'relative')}> +
+ +
+ + +
+
+
+ + (type = 'absolute')}> +
+ +
+ +
-
+ {/if} - +
+ +
+