diff --git a/src/plugins/data/public/actions/apply_query_action.ts b/src/plugins/data/public/actions/apply_query_action.ts deleted file mode 100644 index d0295b621912..000000000000 --- a/src/plugins/data/public/actions/apply_query_action.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { i18n } from '@osd/i18n'; -import { ActionByType, createAction } from '../../../ui_actions/public'; -import { Query, TimefilterContract, TimeRange } from '..'; -import { QueryStringContract } from '../query/query_string'; - -export const ACTION_GLOBAL_APPLY_QUERY = 'ACTION_GLOBAL_APPLY_QUERY'; - -export interface ApplyGlobalQueryActionContext { - query: Query; - dateRange?: TimeRange; - timeFieldName?: string; -} - -async function isCompatible(context: ApplyGlobalQueryActionContext) { - return context.query !== undefined; -} - -export function createQueryAction( - queryString: QueryStringContract, - timeFilter: TimefilterContract -): ActionByType { - return createAction({ - type: ACTION_GLOBAL_APPLY_QUERY, - id: ACTION_GLOBAL_APPLY_QUERY, - order: 100, - getIconType: () => 'search', - getDisplayName: () => { - return i18n.translate('data.filter.applyFilterActionTitle', { - defaultMessage: 'Apply query to current view', - }); - }, - isCompatible, - execute: async (context: ApplyGlobalQueryActionContext) => { - queryString.setQuery(context.query); - if (context.dateRange) { - timeFilter.setTime(context.dateRange); - } - }, - }); -} diff --git a/src/plugins/data/public/actions/index.ts b/src/plugins/data/public/actions/index.ts index 525459d43c7f..96807bb2deb8 100644 --- a/src/plugins/data/public/actions/index.ts +++ b/src/plugins/data/public/actions/index.ts @@ -33,11 +33,6 @@ export { createFilterAction, ApplyGlobalFilterActionContext, } from './apply_filter_action'; -export { - ACTION_GLOBAL_APPLY_QUERY, - createQueryAction, - ApplyGlobalQueryActionContext, -} from './apply_query_action'; export { createFiltersFromValueClickAction } from './filters/create_filters_from_value_click'; export { createFiltersFromRangeSelectAction } from './filters/create_filters_from_range_select'; export * from './select_range_action'; diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index c36cc9c536c7..e85c2b279a1d 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -480,11 +480,7 @@ export { export { isTimeRange, isQuery, isFilter, isFilters } from '../common'; -export { - ACTION_GLOBAL_APPLY_FILTER, - ApplyGlobalFilterActionContext, - ApplyGlobalQueryActionContext, -} from './actions'; +export { ACTION_GLOBAL_APPLY_FILTER, ApplyGlobalFilterActionContext } from './actions'; export * from '../common/field_mapping'; diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index c7f80c64f992..f22a61423d1d 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -71,7 +71,6 @@ import { SELECT_RANGE_TRIGGER, VALUE_CLICK_TRIGGER, APPLY_FILTER_TRIGGER, - APPLY_QUERY_TRIGGER, } from '../../ui_actions/public'; import { ACTION_GLOBAL_APPLY_FILTER, @@ -85,9 +84,6 @@ import { ValueClickActionContext, createValueClickAction, createSelectRangeAction, - ACTION_GLOBAL_APPLY_QUERY, - ApplyGlobalQueryActionContext, - createQueryAction, } from './actions'; import { SavedObjectsClientPublicToCommon } from './index_patterns'; @@ -100,7 +96,6 @@ import { DEFAULT_DATA_SOURCE_TYPE } from './data_sources/constants'; declare module '../../ui_actions/public' { export interface ActionContextMapping { - [ACTION_GLOBAL_APPLY_QUERY]: ApplyGlobalQueryActionContext; [ACTION_GLOBAL_APPLY_FILTER]: ApplyGlobalFilterActionContext; [ACTION_SELECT_RANGE]: SelectRangeActionContext; [ACTION_VALUE_CLICK]: ValueClickActionContext; @@ -149,11 +144,6 @@ export class DataPublicPlugin createFilterAction(queryService.filterManager, queryService.timefilter.timefilter) ); - uiActions.addTriggerAction( - APPLY_QUERY_TRIGGER, - createQueryAction(queryService.queryString, queryService.timefilter.timefilter) - ); - uiActions.addTriggerAction( SELECT_RANGE_TRIGGER, createSelectRangeAction(() => ({ diff --git a/src/plugins/ui_actions/public/index.ts b/src/plugins/ui_actions/public/index.ts index 8929d3df794d..489cb5eee363 100644 --- a/src/plugins/ui_actions/public/index.ts +++ b/src/plugins/ui_actions/public/index.ts @@ -55,8 +55,6 @@ export { selectRangeTrigger, VALUE_CLICK_TRIGGER, valueClickTrigger, - APPLY_QUERY_TRIGGER, - applyQueryTrigger, APPLY_FILTER_TRIGGER, applyFilterTrigger, VISUALIZE_FIELD_TRIGGER, diff --git a/src/plugins/ui_actions/public/plugin.ts b/src/plugins/ui_actions/public/plugin.ts index cc571cb43ea9..1980c31d8b25 100644 --- a/src/plugins/ui_actions/public/plugin.ts +++ b/src/plugins/ui_actions/public/plugin.ts @@ -28,13 +28,12 @@ * under the License. */ -import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'src/core/public'; +import { CoreStart, CoreSetup, Plugin, PluginInitializerContext } from 'src/core/public'; import { UiActionsService } from './service'; import { - applyFilterTrigger, - applyQueryTrigger, selectRangeTrigger, valueClickTrigger, + applyFilterTrigger, visualizeFieldTrigger, visualizeGeoFieldTrigger, } from './triggers'; @@ -59,7 +58,6 @@ export class UiActionsPlugin implements Plugin { public setup(core: CoreSetup): UiActionsSetup { this.service.registerTrigger(selectRangeTrigger); this.service.registerTrigger(valueClickTrigger); - this.service.registerTrigger(applyQueryTrigger); this.service.registerTrigger(applyFilterTrigger); this.service.registerTrigger(visualizeFieldTrigger); this.service.registerTrigger(visualizeGeoFieldTrigger); diff --git a/src/plugins/ui_actions/public/triggers/apply_query_trigger.ts b/src/plugins/ui_actions/public/triggers/apply_query_trigger.ts deleted file mode 100644 index 1f99141651bd..000000000000 --- a/src/plugins/ui_actions/public/triggers/apply_query_trigger.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { i18n } from '@osd/i18n'; -import { Trigger } from '.'; - -export const APPLY_QUERY_TRIGGER = 'QUERY_TRIGGER'; -export const applyQueryTrigger: Trigger<'QUERY_TRIGGER'> = { - id: APPLY_QUERY_TRIGGER, - title: i18n.translate('uiActions.triggers.changeQueryTitle', { - defaultMessage: 'Change query', - }), - description: i18n.translate('uiActions.triggers.changeQueryDescription', { - defaultMessage: 'When OpenSearch Dashboards query is changed.', - }), -}; diff --git a/src/plugins/ui_actions/public/triggers/index.ts b/src/plugins/ui_actions/public/triggers/index.ts index 3530074bc5b3..0fcbbc4ee3fa 100644 --- a/src/plugins/ui_actions/public/triggers/index.ts +++ b/src/plugins/ui_actions/public/triggers/index.ts @@ -33,7 +33,6 @@ export * from './trigger_contract'; export * from './trigger_internal'; export * from './select_range_trigger'; export * from './value_click_trigger'; -export * from './apply_query_trigger'; export * from './apply_filter_trigger'; export * from './visualize_field_trigger'; export * from './visualize_geo_field_trigger'; diff --git a/src/plugins/ui_actions/public/types.ts b/src/plugins/ui_actions/public/types.ts index 1d39d317a1f8..0c32a96755fe 100644 --- a/src/plugins/ui_actions/public/types.ts +++ b/src/plugins/ui_actions/public/types.ts @@ -37,13 +37,9 @@ import { VISUALIZE_FIELD_TRIGGER, VISUALIZE_GEO_FIELD_TRIGGER, DEFAULT_TRIGGER, - APPLY_QUERY_TRIGGER, } from './triggers'; import type { RangeSelectContext, ValueClickContext } from '../../embeddable/public'; -import type { - ApplyGlobalQueryActionContext, - ApplyGlobalFilterActionContext, -} from '../../data/public'; +import type { ApplyGlobalFilterActionContext } from '../../data/public'; export type TriggerRegistry = Map>; export type ActionRegistry = Map; @@ -64,7 +60,6 @@ export interface TriggerContextMapping { [DEFAULT_TRIGGER]: TriggerContext; [SELECT_RANGE_TRIGGER]: RangeSelectContext; [VALUE_CLICK_TRIGGER]: ValueClickContext; - [APPLY_QUERY_TRIGGER]: ApplyGlobalQueryActionContext; [APPLY_FILTER_TRIGGER]: ApplyGlobalFilterActionContext; [VISUALIZE_FIELD_TRIGGER]: VisualizeFieldContext; [VISUALIZE_GEO_FIELD_TRIGGER]: VisualizeFieldContext;