diff --git a/src/plugins/data/public/ui/filter_bar/filter_bar.tsx b/src/plugins/data/public/ui/filter_bar/filter_bar.tsx index fa487be48b846..50ed63a2eb9e5 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_bar.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_bar.tsx @@ -371,6 +371,10 @@ const FilterBarUI = React.memo(function FilterBarUI(props: Props) { onFiltersUpdated(updatedFilters); props?.onMultipleFiltersUpdated?.(updatedMultipleFilters); groupRef.current?.focus(); + const savedFiltersGroupIds = selectedSavedFiltersGroupIds.filter( + (gId) => !groupIds.includes(gId) + ); + setSelectedSavedFiltersGroupIds(savedFiltersGroupIds); } function onUpdateFilterGroup( diff --git a/src/plugins/data/public/ui/query_string_input/edit_filter_modal.tsx b/src/plugins/data/public/ui/query_string_input/edit_filter_modal.tsx index 2ccd144559fb0..1a4aecbb4e0eb 100644 --- a/src/plugins/data/public/ui/query_string_input/edit_filter_modal.tsx +++ b/src/plugins/data/public/ui/query_string_input/edit_filter_modal.tsx @@ -113,9 +113,7 @@ export function EditFilterModal({ const [selectedIndexPattern, setSelectedIndexPattern] = useState( getIndexPatternFromFilter(filter, indexPatterns) ); - const [addFilterMode, setAddFilterMode] = useState( - initialAddFilterMode ?? QUICK_FORM.type - ); + const [addFilterMode, setAddFilterMode] = useState(initialAddFilterMode ?? tabs[0].type); const [customLabel, setCustomLabel] = useState(initialLabel || ''); const [queryDsl, setQueryDsl] = useState( JSON.stringify( @@ -145,7 +143,7 @@ export function EditFilterModal({ ] ); const [groupsCount, setGroupsCount] = useState( - (new Set(localFilters.map(filter => filter.groupId))).size + new Set(localFilters.map((filter) => filter.groupId)).size ); const [savedQueries, setSavedQueries] = useState([]); const [submitDisabled, setSubmitDisabled] = useState(false); diff --git a/src/plugins/data/public/ui/saved_query_form/save_query_form.tsx b/src/plugins/data/public/ui/saved_query_form/save_query_form.tsx index 83cbbb7d4ef79..f2328747d5ed2 100644 --- a/src/plugins/data/public/ui/saved_query_form/save_query_form.tsx +++ b/src/plugins/data/public/ui/saved_query_form/save_query_form.tsx @@ -111,6 +111,9 @@ export function SaveQueryForm({ const onClickSave = useCallback(() => { if (validate()) { + filters?.forEach((f) => { + f.meta.alias = title; + }); onSave({ id: savedQuery?.id, title,