diff --git a/public/components/FeatureAnywhereContextMenu/CreateAnomalyDetector/helpers.tsx b/public/components/FeatureAnywhereContextMenu/CreateAnomalyDetector/helpers.tsx index 4a990b67..9bd6de0a 100644 --- a/public/components/FeatureAnywhereContextMenu/CreateAnomalyDetector/helpers.tsx +++ b/public/components/FeatureAnywhereContextMenu/CreateAnomalyDetector/helpers.tsx @@ -32,18 +32,19 @@ export function visFeatureListToFormik( export function formikToDetectorName(title) { const detectorName = title + '_anomaly_detector_' + Math.floor(100000 + Math.random() * 900000); - detectorName.replace(/[^a-zA-Z0-9-_]/g, '_'); - return detectorName; + const formattedName = detectorName.replace(/[^a-zA-Z0-9\-_]/g, '_'); + return formattedName; } const getFeatureNameFromVisParams = (id, seriesParams) => { - let name = find(seriesParams, function (param) { + const name = find(seriesParams, function (param) { if (param.data.id === id) { return true; } }); - return name.data.label.replace(/[^a-zA-Z0-9-_]/g, '_'); + const formattedFeatureName = name.data.label.replace(/[^a-zA-Z0-9-_]/g, '_'); + return formattedFeatureName }; function visAggregationToFormik(value) { diff --git a/public/utils/constants.ts b/public/utils/constants.ts index ce576412..fb2d2c72 100644 --- a/public/utils/constants.ts +++ b/public/utils/constants.ts @@ -59,6 +59,9 @@ export const AD_DOCS_LINK = export const AD_HIGH_CARDINALITY_LINK = 'https://opensearch.org/docs/latest/observing-your-data/ad/index/#optional-set-category-fields-for-high-cardinality'; +export const AD_FEATURE_ANYWHERE_LINK = + 'https://opensearch.org/docs/latest/observing-your-data/ad/dashboards-anomaly-detection/'; + export const MAX_DETECTORS = 1000; export const MAX_ANOMALIES = 10000; diff --git a/public/utils/contextMenu/getActions.tsx b/public/utils/contextMenu/getActions.tsx index 26bf8f06..baf31b70 100644 --- a/public/utils/contextMenu/getActions.tsx +++ b/public/utils/contextMenu/getActions.tsx @@ -13,7 +13,7 @@ import AnywhereParentFlyout from '../../components/FeatureAnywhereContextMenu/An import { Provider } from 'react-redux'; import configureStore from '../../redux/configureStore'; import DocumentationTitle from '../../components/FeatureAnywhereContextMenu/DocumentationTitle/containers/DocumentationTitle'; -import { AD_DOCS_LINK, APM_TRACE } from '../constants'; +import { AD_FEATURE_ANYWHERE_LINK, APM_TRACE } from '../constants'; import { getClient, getOverlays } from '../../../public/services'; import { FLYOUT_MODES } from '../../../public/components/FeatureAnywhereContextMenu/AnywhereParentFlyout/constants'; @@ -80,7 +80,7 @@ export const getActions = () => { icon: 'documentation' as EuiIconType, order: 98, onClick: () => { - window.open(AD_DOCS_LINK, '_blank'); + window.open(AD_FEATURE_ANYWHERE_LINK, '_blank'); }, }, ].map((options) => createADAction({ ...options, grouping }));