From a61de9456c5c3cbbc6ce9c1c3936fac5c3453bb6 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 12:32:49 -0700 Subject: [PATCH] Fix issues in running historical analysis and custom result index section (#889) (#892) * Fix issues in running historical analysis and custom result index Signed-off-by: Jackie Han * update snapshot Signed-off-by: Jackie Han --------- Signed-off-by: Jackie Han (cherry picked from commit 646a08ec2656df5b0597f454fcf4b95f21b513cc) Co-authored-by: Jackie Han --- .../components/CustomResultIndex/CustomResultIndex.tsx | 2 +- .../__tests__/__snapshots__/DefineDetector.test.tsx.snap | 6 +++--- public/redux/reducers/ad.ts | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx b/public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx index f8b8fe50..5e96e06b 100644 --- a/public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx +++ b/public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx @@ -99,7 +99,7 @@ function CustomResultIndex(props: CustomResultIndexProps) { disabled={props.isEdit} onChange={() => { if (enabled) { - form.setFieldValue('resultIndex', ''); + form.setFieldValue('resultIndex', undefined); } setEnabled(!enabled); }} diff --git a/public/pages/DefineDetector/containers/__tests__/__snapshots__/DefineDetector.test.tsx.snap b/public/pages/DefineDetector/containers/__tests__/__snapshots__/DefineDetector.test.tsx.snap index eafc8908..c06b632f 100644 --- a/public/pages/DefineDetector/containers/__tests__/__snapshots__/DefineDetector.test.tsx.snap +++ b/public/pages/DefineDetector/containers/__tests__/__snapshots__/DefineDetector.test.tsx.snap @@ -1593,7 +1593,7 @@ exports[` empty creating detector definition renders the compo xmlns="http://www.w3.org/2000/svg" > @@ -2679,7 +2679,7 @@ exports[` empty editing detector definition renders the compon xmlns="http://www.w3.org/2000/svg" > @@ -3258,4 +3258,4 @@ exports[` empty editing detector definition renders the compon -`; +`; \ No newline at end of file diff --git a/public/redux/reducers/ad.ts b/public/redux/reducers/ad.ts index a1a689d1..9d456912 100644 --- a/public/redux/reducers/ad.ts +++ b/public/redux/reducers/ad.ts @@ -492,10 +492,8 @@ export const startHistoricalDetector = ( startTime: number, endTime: number ): APIAction => { - const baseUrl = `${AD_NODE_API.DETECTOR}/${detectorId}`; - const url = dataSourceId - ? `${baseUrl}/${dataSourceId}/start` - : `${baseUrl}/start`; + const baseUrl = `${AD_NODE_API.DETECTOR}/${detectorId}/start`; + const url = dataSourceId ? `${baseUrl}/${dataSourceId}` : baseUrl; return { type: START_HISTORICAL_DETECTOR,