From 4bd7a3d74388df391ca68cb76b4b95fbdbe17aae Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Thu, 8 Feb 2024 14:00:13 +0100 Subject: [PATCH] [Discover] Rearrange consts --- src/plugins/saved_search/common/constants.ts | 3 --- .../common/content_management/v1/cm_services.ts | 5 ++++- src/plugins/saved_search/common/index.ts | 17 ++++++----------- src/plugins/saved_search_so/common/constants.ts | 2 -- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/plugins/saved_search/common/constants.ts b/src/plugins/saved_search/common/constants.ts index a980bd40e3e26..57e3cfff51ebb 100644 --- a/src/plugins/saved_search/common/constants.ts +++ b/src/plugins/saved_search/common/constants.ts @@ -10,7 +10,4 @@ export const SavedSearchType = 'search'; export const LATEST_VERSION = 1; -export const MIN_SAVED_SEARCH_SAMPLE_SIZE = 1; -export const MAX_SAVED_SEARCH_SAMPLE_SIZE = 10000; - export type SavedSearchContentType = typeof SavedSearchType; diff --git a/src/plugins/saved_search/common/content_management/v1/cm_services.ts b/src/plugins/saved_search/common/content_management/v1/cm_services.ts index 0cbbe69c4bfeb..641b203f0676d 100644 --- a/src/plugins/saved_search/common/content_management/v1/cm_services.ts +++ b/src/plugins/saved_search/common/content_management/v1/cm_services.ts @@ -15,7 +15,10 @@ import { updateOptionsSchema, createResultSchema, } from '@kbn/content-management-utils'; -import { MIN_SAVED_SEARCH_SAMPLE_SIZE, MAX_SAVED_SEARCH_SAMPLE_SIZE } from '../../constants'; +import { + MIN_SAVED_SEARCH_SAMPLE_SIZE, + MAX_SAVED_SEARCH_SAMPLE_SIZE, +} from '@kbn/saved-search-so-plugin/common'; const sortSchema = schema.arrayOf(schema.string(), { maxSize: 2 }); diff --git a/src/plugins/saved_search/common/index.ts b/src/plugins/saved_search/common/index.ts index 0ac92232fb3b8..47ed071e7b085 100644 --- a/src/plugins/saved_search/common/index.ts +++ b/src/plugins/saved_search/common/index.ts @@ -6,6 +6,11 @@ * Side Public License, v 1. */ +export { + VIEW_MODE, + MIN_SAVED_SEARCH_SAMPLE_SIZE, + MAX_SAVED_SEARCH_SAMPLE_SIZE, +} from '@kbn/saved-search-so-plugin/common'; export { getSavedSearchUrl, getSavedSearchFullPathUrl } from './saved_searches_url'; export { fromSavedSearchAttributes } from './saved_searches_utils'; @@ -16,15 +21,5 @@ export type { SavedSearchAttributes, } from './types'; -export enum VIEW_MODE { - DOCUMENT_LEVEL = 'documents', - AGGREGATED_LEVEL = 'aggregated', -} - -export { - SavedSearchType, - LATEST_VERSION, - MIN_SAVED_SEARCH_SAMPLE_SIZE, - MAX_SAVED_SEARCH_SAMPLE_SIZE, -} from './constants'; +export { SavedSearchType, LATEST_VERSION } from './constants'; export { getKibanaContextFn } from './expressions/kibana_context'; diff --git a/src/plugins/saved_search_so/common/constants.ts b/src/plugins/saved_search_so/common/constants.ts index 7a943f9838fa1..aa7387516bb6b 100644 --- a/src/plugins/saved_search_so/common/constants.ts +++ b/src/plugins/saved_search_so/common/constants.ts @@ -6,8 +6,6 @@ * Side Public License, v 1. */ -// TODO: extract into a package? - export const MIN_SAVED_SEARCH_SAMPLE_SIZE = 1; export const MAX_SAVED_SEARCH_SAMPLE_SIZE = 10000;