diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx index ae03a0779edf1..5aa0ccc46a5cd 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx @@ -11,7 +11,7 @@ import { EuiCallOut, EuiPageBody, EuiPanel, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { getNestedProperty } from '@kbn/ml-nested-property'; import { SavedObjectFinder } from '@kbn/saved-objects-finder-plugin/public'; -import type { SavedObjectCommon } from '@kbn/saved-objects-finder-plugin/common'; +import type { FinderAttributes, SavedObjectCommon } from '@kbn/saved-objects-finder-plugin/common'; import { CreateDataViewButton } from '../../../../../components/create_data_view_button'; import { useMlKibana, useNavigateToPath } from '../../../../../contexts/kibana'; import { useToastNotificationService } from '../../../../../services/toast_notification_service'; @@ -22,6 +22,8 @@ import { const fixedPageSize: number = 20; +type SavedObject = SavedObjectCommon; + export const SourceSelection: FC = () => { const { services: { @@ -41,7 +43,7 @@ export const SourceSelection: FC = () => { id: string, type: string, fullName?: string, - savedObject?: SavedObjectCommon + savedObject?: SavedObject ) => { // Kibana data views including `:` are cross-cluster search indices // and are not supported by Data Frame Analytics yet. For saved searches @@ -142,6 +144,9 @@ export const SourceSelection: FC = () => { defaultMessage: 'Saved search', } ), + showSavedObject: (savedObject: SavedObject) => + // ES|QL Based saved searches are not supported in DFA, filter them out + savedObject.attributes.isTextBasedQuery !== true, }, { type: 'index-pattern', diff --git a/x-pack/plugins/ml/public/application/datavisualizer/data_drift/index_patterns_picker.tsx b/x-pack/plugins/ml/public/application/datavisualizer/data_drift/index_patterns_picker.tsx index 04dd9ca764ab0..1f31ce934e442 100644 --- a/x-pack/plugins/ml/public/application/datavisualizer/data_drift/index_patterns_picker.tsx +++ b/x-pack/plugins/ml/public/application/datavisualizer/data_drift/index_patterns_picker.tsx @@ -14,12 +14,16 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { SavedObjectFinder } from '@kbn/saved-objects-finder-plugin/public'; import { type DataViewEditorService as DataViewEditorServiceSpec } from '@kbn/data-view-editor-plugin/public'; import { INDEX_PATTERN_TYPE } from '@kbn/data-views-plugin/public'; +import type { FinderAttributes, SavedObjectCommon } from '@kbn/saved-objects-finder-plugin/common'; import { createPath } from '../../routing/router'; import { ML_PAGES } from '../../../../common/constants/locator'; import { DataDriftIndexPatternsEditor } from './data_drift_index_patterns_editor'; import { MlPageHeader } from '../../components/page_header'; import { useMlKibana, useNavigateToPath } from '../../contexts/kibana'; + +type SavedObject = SavedObjectCommon; + export const DataDriftIndexOrSearchRedirect: FC = () => { const navigateToPath = useNavigateToPath(); const { contentManagement, uiSettings } = useMlKibana().services; @@ -65,6 +69,9 @@ export const DataDriftIndexOrSearchRedirect: FC = () => { defaultMessage: 'Saved search', } ), + showSavedObject: (savedObject: SavedObject) => + // ES|QL Based saved searches are not supported in Data Drift, filter them out + savedObject.attributes.isTextBasedQuery !== true, }, { type: 'index-pattern', diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx index 972b8dc09e3ef..6e630ca61886f 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx @@ -11,6 +11,7 @@ import { EuiFlexGroup, EuiPageBody, EuiPanel } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { SavedObjectFinder } from '@kbn/saved-objects-finder-plugin/public'; +import type { FinderAttributes, SavedObjectCommon } from '@kbn/saved-objects-finder-plugin/common'; import { CreateDataViewButton } from '../../../../components/create_data_view_button'; import { useMlKibana, useNavigateToPath } from '../../../../contexts/kibana'; import { MlPageHeader } from '../../../../components/page_header'; @@ -21,6 +22,8 @@ export interface PageProps { const RESULTS_PER_PAGE = 20; +type SavedObject = SavedObjectCommon; + export const Page: FC = ({ nextStepPath, extraButtons, @@ -69,6 +72,9 @@ export const Page: FC = ({ defaultMessage: 'Saved search', } ), + showSavedObject: (savedObject: SavedObject) => + // ES|QL Based saved searches are not supported across ML, filter them out + savedObject.attributes.isTextBasedQuery !== true, }, { type: 'index-pattern', diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx index 3c6fcc67f0c7e..7c0b03f7b9856 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx @@ -11,6 +11,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import React, { type FC, Fragment } from 'react'; import { SavedObjectFinder } from '@kbn/saved-objects-finder-plugin/public'; +import type { FinderAttributes, SavedObjectCommon } from '@kbn/saved-objects-finder-plugin/common'; import { useAppDependencies } from '../../../../app_dependencies'; interface SearchSelectionProps { @@ -19,6 +20,8 @@ interface SearchSelectionProps { canEditDataView: boolean; } +type SavedObject = SavedObjectCommon; + const fixedPageSize: number = 8; export const SearchSelection: FC = ({ @@ -64,6 +67,9 @@ export const SearchSelection: FC = ({ defaultMessage: 'Saved search', } ), + showSavedObject: (savedObject: SavedObject) => + // ES|QL Based saved searches are not supported in transforms, filter them out + savedObject.attributes.isTextBasedQuery !== true, }, { type: 'index-pattern',