Skip to content

Commit

Permalink
rename titles variable to cases_toast_messages_titles
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrtj committed Dec 19, 2024
1 parent d73ab5d commit 7f47fad
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' };

Expand Down Expand Up @@ -222,7 +222,10 @@ const FieldPanel: FC<FieldPanelProps> = ({

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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down Expand Up @@ -102,7 +102,7 @@ export const AnomalyContextMenu: FC<AnomalyContextMenuProps> = ({

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -190,7 +190,7 @@ export const AnomalyTimeline: FC<AnomalyTimelineProps> = React.memo(

const openCasesModalCallback = useCasesModal(
ANOMALY_SWIMLANE_EMBEDDABLE_TYPE,
TITLES.ANOMALY_TIMELINE
CASES_TOAST_MESSAGES_TITLES.ANOMALY_TIMELINE
);

const openCasesModal = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -128,7 +128,7 @@ export const TimeSeriesExplorerControls: FC<Props> = ({

const openCasesModalCallback = useCasesModal(
ANOMALY_SINGLE_METRIC_VIEWER_EMBEDDABLE_TYPE,
TITLES.SINGLE_METRIC_VIEWER
CASES_TOAST_MESSAGES_TITLES.SINGLE_METRIC_VIEWER
);

const showControls =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}),
Expand Down

0 comments on commit 7f47fad

Please sign in to comment.