From 7f47fad4323c3b3555c29d229b95e093bd1eadb8 Mon Sep 17 00:00:00 2001 From: rbrtj Date: Thu, 19 Dec 2024 13:57:17 +0100 Subject: [PATCH] rename titles variable to cases_toast_messages_titles --- .../plugins/shared/aiops/public/cases/constants.ts | 2 +- .../components/change_point_detection/fields_config.tsx | 7 +++++-- .../components/log_categorization/attachments_menu.tsx | 4 ++-- .../log_rate_analysis_attachments_menu.tsx | 4 ++-- .../public/application/explorer/anomaly_context_menu.tsx | 4 ++-- .../ml/public/application/explorer/anomaly_timeline.tsx | 4 ++-- .../timeseriesexplorer_controls.tsx | 4 ++-- .../platform/plugins/shared/ml/public/cases/constants.ts | 2 +- 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/x-pack/platform/plugins/shared/aiops/public/cases/constants.ts b/x-pack/platform/plugins/shared/aiops/public/cases/constants.ts index 844ed7ec78861..547734955cbbb 100644 --- a/x-pack/platform/plugins/shared/aiops/public/cases/constants.ts +++ b/x-pack/platform/plugins/shared/aiops/public/cases/constants.ts @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; /** * Titles for the cases toast messages */ -export const TITLES = { +export const CASES_TOAST_MESSAGES_TITLES = { CHANGE_POINT_DETECTION: (viewType: ChangePointDetectionViewType, chartsCount: number) => viewType === 'table' ? i18n.translate('xpack.aiops.cases.changePointDetectionTableTitle', { diff --git a/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/fields_config.tsx b/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/fields_config.tsx index 319c8e9236d9d..226eb6fbbc2fc 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/fields_config.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/fields_config.tsx @@ -56,7 +56,7 @@ import { import { useChangePointResults } from './use_change_point_agg_request'; import { useSplitFieldCardinality } from './use_split_field_cardinality'; import { ViewTypeSelector } from './view_type_selector'; -import { TITLES } from '../../cases/constants'; +import { CASES_TOAST_MESSAGES_TITLES } from '../../cases/constants'; const selectControlCss = { width: '350px' }; @@ -222,7 +222,10 @@ const FieldPanel: FC = ({ const openCasesModalCallback = useCasesModal( EMBEDDABLE_CHANGE_POINT_CHART_TYPE, - TITLES.CHANGE_POINT_DETECTION(caseAttachment.viewType, selectedPartitions.length) + CASES_TOAST_MESSAGES_TITLES.CHANGE_POINT_DETECTION( + caseAttachment.viewType, + selectedPartitions.length + ) ); const caseAttachmentButtonDisabled = diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/attachments_menu.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/attachments_menu.tsx index eb4ebe8aa25c0..a82e1a4b087ed 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/attachments_menu.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/attachments_menu.tsx @@ -34,7 +34,7 @@ import type { PatternAnalysisEmbeddableState } from '../../embeddables/pattern_a import type { RandomSamplerOption, RandomSamplerProbability } from './sampling_menu/random_sampler'; import { useCasesModal } from '../../hooks/use_cases_modal'; import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; -import { TITLES } from '../../cases/constants'; +import { CASES_TOAST_MESSAGES_TITLES } from '../../cases/constants'; const SavedObjectSaveModalDashboard = withSuspense(LazySavedObjectSaveModalDashboard); @@ -69,7 +69,7 @@ export const AttachmentsMenu = ({ const openCasesModalCallback = useCasesModal( EMBEDDABLE_PATTERN_ANALYSIS_TYPE, - TITLES.PATTERN_ANALYSIS + CASES_TOAST_MESSAGES_TITLES.PATTERN_ANALYSIS ); const timeRange = useTimeRangeUpdates(); diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_attachments_menu.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_attachments_menu.tsx index 57c876cf51a8a..def6721c2adb3 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_attachments_menu.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_attachments_menu.tsx @@ -28,7 +28,7 @@ import { } from '@elastic/eui'; import type { WindowParameters } from '@kbn/aiops-log-rate-analysis/window_parameters'; import type { SignificantItem } from '@kbn/ml-agg-utils'; -import { TITLES } from '../../../cases/constants'; +import { CASES_TOAST_MESSAGES_TITLES } from '../../../cases/constants'; import { useCasesModal } from '../../../hooks/use_cases_modal'; import { useDataSource } from '../../../hooks/use_data_source'; import type { LogRateAnalysisEmbeddableState } from '../../../embeddables/log_rate_analysis/types'; @@ -63,7 +63,7 @@ export const LogRateAnalysisAttachmentsMenu = ({ const openCasesModalCallback = useCasesModal( EMBEDDABLE_LOG_RATE_ANALYSIS_TYPE, - TITLES.LOG_RATE_ANALYSIS + CASES_TOAST_MESSAGES_TITLES.LOG_RATE_ANALYSIS ); const canEditDashboards = capabilities.dashboard.createNew; diff --git a/x-pack/platform/plugins/shared/ml/public/application/explorer/anomaly_context_menu.tsx b/x-pack/platform/plugins/shared/ml/public/application/explorer/anomaly_context_menu.tsx index b66ec7dc2ed7d..ccee7f8fa1be5 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/explorer/anomaly_context_menu.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/explorer/anomaly_context_menu.tsx @@ -52,7 +52,7 @@ import { useMlKibana } from '../contexts/kibana'; import type { AppStateSelectedCells, ExplorerJob } from './explorer_utils'; import { getSelectionInfluencers, getSelectionTimeRange } from './explorer_utils'; import { getDefaultExplorerChartsPanelTitle } from '../../embeddables/anomaly_charts/utils'; -import { TITLES } from '../../cases/constants'; +import { CASES_TOAST_MESSAGES_TITLES } from '../../cases/constants'; interface AnomalyContextMenuProps { selectedJobs: ExplorerJob[]; @@ -102,7 +102,7 @@ export const AnomalyContextMenu: FC = ({ const openCasesModal = useCasesModal( ANOMALY_EXPLORER_CHARTS_EMBEDDABLE_TYPE, - TITLES.ANOMALY_CHARTS(maxSeriesToPlot) + CASES_TOAST_MESSAGES_TITLES.ANOMALY_CHARTS(maxSeriesToPlot) ); const canEditDashboards = capabilities.dashboard?.createNew ?? false; diff --git a/x-pack/platform/plugins/shared/ml/public/application/explorer/anomaly_timeline.tsx b/x-pack/platform/plugins/shared/ml/public/application/explorer/anomaly_timeline.tsx index 7e00191366f62..e70ca44772ed8 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/explorer/anomaly_timeline.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/explorer/anomaly_timeline.tsx @@ -66,7 +66,7 @@ import { useAnomalyExplorerContext } from './anomaly_explorer_context'; import { getTimeBoundsFromSelection } from './hooks/use_selected_cells'; import { SwimLaneWrapper } from './alerts'; import { Y_AXIS_LABEL_WIDTH } from './constants'; -import { TITLES } from '../../cases/constants'; +import { CASES_TOAST_MESSAGES_TITLES } from '../../cases/constants'; import type { ExplorerState } from './explorer_data'; import { useJobSelection } from './hooks/use_job_selection'; @@ -190,7 +190,7 @@ export const AnomalyTimeline: FC = React.memo( const openCasesModalCallback = useCasesModal( ANOMALY_SWIMLANE_EMBEDDABLE_TYPE, - TITLES.ANOMALY_TIMELINE + CASES_TOAST_MESSAGES_TITLES.ANOMALY_TIMELINE ); const openCasesModal = useCallback( diff --git a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_controls/timeseriesexplorer_controls.tsx b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_controls/timeseriesexplorer_controls.tsx index 301d8e8e9596d..5857846354fcf 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_controls/timeseriesexplorer_controls.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_controls/timeseriesexplorer_controls.tsx @@ -27,7 +27,7 @@ import { } from '@kbn/presentation-util-plugin/public'; import { useTimeRangeUpdates } from '@kbn/ml-date-picker'; import type { MlJobState } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { TITLES } from '../../../../cases/constants'; +import { CASES_TOAST_MESSAGES_TITLES } from '../../../../cases/constants'; import type { CombinedJobWithStats } from '../../../../../server/shared'; import type { JobId } from '../../../../../common/types/anomaly_detection_jobs/job'; import { useMlKibana } from '../../../contexts/kibana'; @@ -128,7 +128,7 @@ export const TimeSeriesExplorerControls: FC = ({ const openCasesModalCallback = useCasesModal( ANOMALY_SINGLE_METRIC_VIEWER_EMBEDDABLE_TYPE, - TITLES.SINGLE_METRIC_VIEWER + CASES_TOAST_MESSAGES_TITLES.SINGLE_METRIC_VIEWER ); const showControls = diff --git a/x-pack/platform/plugins/shared/ml/public/cases/constants.ts b/x-pack/platform/plugins/shared/ml/public/cases/constants.ts index 01aef113f246a..24f2cf88bccb0 100644 --- a/x-pack/platform/plugins/shared/ml/public/cases/constants.ts +++ b/x-pack/platform/plugins/shared/ml/public/cases/constants.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; /** * Titles for the cases toast messages */ -export const TITLES = { +export const CASES_TOAST_MESSAGES_TITLES = { ANOMALY_TIMELINE: i18n.translate('xpack.ml.cases.anomalyTimelineTitle', { defaultMessage: 'Anomaly timeline', }),