mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Add possibility to disable syncing controls with local storage
This commit is contained in:
parent
bc0970e8ce
commit
24bab210b0
6 changed files with 8 additions and 1 deletions
|
@ -60,6 +60,7 @@ export const FilterGroup = (props: PropsWithChildren<FilterGroupProps>) => {
|
|||
Storage,
|
||||
ruleTypeIds,
|
||||
storageKey,
|
||||
disableLocalStorageSync = false,
|
||||
} = props;
|
||||
|
||||
const filterChangedSubscription = useRef<Subscription>();
|
||||
|
@ -105,7 +106,7 @@ export const FilterGroup = (props: PropsWithChildren<FilterGroupProps>) => {
|
|||
} = useControlGroupSyncToLocalStorage({
|
||||
Storage,
|
||||
storageKey: localStoragePageFilterKey,
|
||||
shouldSync: isViewMode,
|
||||
shouldSync: !disableLocalStorageSync && isViewMode,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -74,4 +74,5 @@ export interface FilterGroupProps extends Pick<ControlGroupRuntimeState, 'chaini
|
|||
ControlGroupRenderer: typeof ControlGroupRenderer;
|
||||
Storage: typeof Storage;
|
||||
storageKey?: string;
|
||||
disableLocalStorageSync?: boolean;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ const toastTitle = i18n.translate('xpack.observability.alerts.searchBar.invalidQ
|
|||
export function ObservabilityAlertSearchBar({
|
||||
appName,
|
||||
defaultFilters = EMPTY_FILTERS,
|
||||
disableLocalStorageSync,
|
||||
onEsQueryChange,
|
||||
onKueryChange,
|
||||
onRangeFromChange,
|
||||
|
@ -168,6 +169,7 @@ export function ObservabilityAlertSearchBar({
|
|||
filters={[...filters, ...defaultFilters]}
|
||||
onFiltersChange={onFilterControlsChange}
|
||||
storageKey={filterControlsStorageKey}
|
||||
disableLocalStorageSync={disableLocalStorageSync}
|
||||
services={{
|
||||
http,
|
||||
notifications,
|
||||
|
|
|
@ -63,6 +63,7 @@ export interface ObservabilityAlertSearchBarProps
|
|||
onFilterControlsChange: (controlConfigs: Filter[]) => void;
|
||||
savedQuery?: SavedQuery;
|
||||
showFilterBar?: boolean;
|
||||
disableLocalStorageSync?: boolean;
|
||||
}
|
||||
|
||||
export interface AlertSearchBarContainerState {
|
||||
|
|
|
@ -129,6 +129,7 @@ export function InternalRelatedAlerts({ alert }: Props) {
|
|||
onEsQueryChange={setEsQuery}
|
||||
urlStorageKey={SEARCH_BAR_URL_STORAGE_KEY}
|
||||
defaultFilters={defaultFilters.current}
|
||||
disableLocalStorageSync={true}
|
||||
defaultState={{
|
||||
...defaultState,
|
||||
kuery,
|
||||
|
|
|
@ -92,6 +92,7 @@ export function RuleDetailsTabs({
|
|||
onEsQueryChange={onEsQueryChange}
|
||||
urlStorageKey={RULE_DETAILS_SEARCH_BAR_URL_STORAGE_KEY}
|
||||
defaultFilters={ruleFilters.current}
|
||||
disableLocalStorageSync={true}
|
||||
/>
|
||||
<EuiSpacer size="s" />
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue