Skip to content

Commit a61de94

Browse files
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 <jkhanjob@gmail.com> * update snapshot Signed-off-by: Jackie Han <jkhanjob@gmail.com> --------- Signed-off-by: Jackie Han <jkhanjob@gmail.com> (cherry picked from commit 646a08e) Co-authored-by: Jackie Han <jkhanjob@gmail.com>
1 parent d199322 commit a61de94

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function CustomResultIndex(props: CustomResultIndexProps) {
9999
disabled={props.isEdit}
100100
onChange={() => {
101101
if (enabled) {
102-
form.setFieldValue('resultIndex', '');
102+
form.setFieldValue('resultIndex', undefined);
103103
}
104104
setEnabled(!enabled);
105105
}}

public/pages/DefineDetector/containers/__tests__/__snapshots__/DefineDetector.test.tsx.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@ exports[`<DefineDetector /> empty creating detector definition renders the compo
15931593
xmlns="http://www.w3.org/2000/svg"
15941594
>
15951595
<path
1596-
d="M7.999 15.999a8 8 0 1 1 0-16 8 8 0 0 1 0 16ZM8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM3.5 5h9a.5.5 0 1 1 0 1h-9a.5.5 0 0 1 0-1Zm2 3h5a.5.5 0 1 1 0 1h-5a.5.5 0 0 1 0-1Zm2 3h1a.5.5 0 1 1 0 1h-1a.5.5 0 1 1 0-1Z"
1596+
d="m9.759 12.652-1.8 2.25-.78-.625 1.8-2.25A.1.1 0 0 0 9 11.965V8.362a1 1 0 0 1 .232-.64l4.631-5.558A.1.1 0 0 0 13.787 2H2.213a.1.1 0 0 0-.077.164l4.631 5.558a1 1 0 0 1 .232.64v5.853a.1.1 0 0 0 .178.062l.781.625c-.65.812-1.959.353-1.959-.687V8.362L1.368 2.804C.771 2.088 1.281 1 2.214 1h11.573c.932 0 1.442 1.088.845 1.804L10 8.362v3.603a1.1 1.1 0 0 1-.241.687Z"
15971597
fill-rule="evenodd"
15981598
/>
15991599
</svg>
@@ -2679,7 +2679,7 @@ exports[`<DefineDetector /> empty editing detector definition renders the compon
26792679
xmlns="http://www.w3.org/2000/svg"
26802680
>
26812681
<path
2682-
d="M7.999 15.999a8 8 0 1 1 0-16 8 8 0 0 1 0 16ZM8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM3.5 5h9a.5.5 0 1 1 0 1h-9a.5.5 0 0 1 0-1Zm2 3h5a.5.5 0 1 1 0 1h-5a.5.5 0 0 1 0-1Zm2 3h1a.5.5 0 1 1 0 1h-1a.5.5 0 1 1 0-1Z"
2682+
d="m9.759 12.652-1.8 2.25-.78-.625 1.8-2.25A.1.1 0 0 0 9 11.965V8.362a1 1 0 0 1 .232-.64l4.631-5.558A.1.1 0 0 0 13.787 2H2.213a.1.1 0 0 0-.077.164l4.631 5.558a1 1 0 0 1 .232.64v5.853a.1.1 0 0 0 .178.062l.781.625c-.65.812-1.959.353-1.959-.687V8.362L1.368 2.804C.771 2.088 1.281 1 2.214 1h11.573c.932 0 1.442 1.088.845 1.804L10 8.362v3.603a1.1 1.1 0 0 1-.241.687Z"
26832683
fill-rule="evenodd"
26842684
/>
26852685
</svg>
@@ -3258,4 +3258,4 @@ exports[`<DefineDetector /> empty editing detector definition renders the compon
32583258
</div>
32593259
</div>
32603260
</div>
3261-
`;
3261+
`;

public/redux/reducers/ad.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,8 @@ export const startHistoricalDetector = (
492492
startTime: number,
493493
endTime: number
494494
): APIAction => {
495-
const baseUrl = `${AD_NODE_API.DETECTOR}/${detectorId}`;
496-
const url = dataSourceId
497-
? `${baseUrl}/${dataSourceId}/start`
498-
: `${baseUrl}/start`;
495+
const baseUrl = `${AD_NODE_API.DETECTOR}/${detectorId}/start`;
496+
const url = dataSourceId ? `${baseUrl}/${dataSourceId}` : baseUrl;
499497

500498
return {
501499
type: START_HISTORICAL_DETECTOR,

0 commit comments

Comments
 (0)