You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Frontend for Custom Result Index Query and Fix Issues (#772)
* Update Frontend for Custom Result Index Query and Fix Issues
This PR finalizes the frontend changes related to PR #1225. The custom result index query now uses an index pattern instead of a single index.
Additionally, this PR addresses an issue where missing custom result indices would appear because the original code checked for the existence of an index name, but now we use it as a prefix. We have updated the logic to perform a prefix search instead of checking for index name equality.
This PR also resolves issue #765 by downgrading the version of jest-canvas-mock.
Testing Done:
* Added unit tests.
* Verified that the custom result index missing callout is not shown.
* Confirmed that the frontend can still display old and new results after a rollover.
Signed-off-by: Kaituo Li <kaituo@amazon.com>
* change to check alias
Signed-off-by: Kaituo Li <kaituo@amazon.com>
* fix warning msg
Signed-off-by: Kaituo Li <kaituo@amazon.com>
---------
Signed-off-by: Kaituo Li <kaituo@amazon.com>
(cherry picked from commit 6513e1b)
Copy file name to clipboardexpand all lines: public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx
+1-1
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ function CustomResultIndex(props: CustomResultIndexProps) {
89
89
<EuiFlexItem>
90
90
<EuiCallOut
91
91
data-test-subj="cannotEditResultIndexCallout"
92
-
title="You can't change the custom result index after creating the detector. You can manage the result index using the following three settings inside Anomaly Detection plugin or with the Index Management plugin."
92
+
title="You can't change the custom result index after creating the detector. You can manage the result index using the following three settings."
// debug message: prints visibleIndices if isResultIndexMissing is true
160
164
if(isResultIndexMissing){
161
-
console.log(`isResultIndexMissing is true, visibleIndices: ${visibleIndices}, detector result index: ${get(detector,'resultIndex','')}`);
165
+
// The JSON.stringify method converts a JavaScript object or value to a JSON string. The optional null parameter is for the replacer function (not used here), and 2 specifies the indentation level for pretty-printing the JSON.
166
+
console.log(`isResultIndexMissing is true, visibleIndices: ${JSON.stringify(visibleIndices,null,2)}, visibleAliases: ${JSON.stringify(visibleAliases,null,2)}, detector result index: ${resultIndexOrAlias}`);
162
167
}
163
168
164
169
// String to set in the modal if the realtime detector and/or historical analysis
0 commit comments