-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make feature anywhere formatted detector name an assgiend value #506
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,10 +30,10 @@ export function visFeatureListToFormik( | |
} | ||
|
||
export function formikToDetectorName(title) { | ||
const detectorName = | ||
let 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) => { | ||
|
@@ -43,7 +43,8 @@ const getFeatureNameFromVisParams = (id, seriesParams) => { | |
} | ||
}); | ||
|
||
return name.data.label.replace(/[^a-zA-Z0-9-_]/g, '_'); | ||
const formatedFeatureName = name.data.label.replace(/[^a-zA-Z0-9-_]/g, '_'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
return formatedFeatureName | ||
}; | ||
|
||
function visAggregationToFormik(value) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this link just sends to the main opensearch.org doc page There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's because the doc side pr hasn’t merged yet. So the link doesn't exist yet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but it will be the link for feature anywhere documentation page |
||
'https://opensearch.org/docs/latest/observing-your-data/ad/dashboards-anomaly-detection/'; | ||
|
||
export const MAX_DETECTORS = 1000; | ||
|
||
export const MAX_ANOMALIES = 10000; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: what is the reason of changing this to
let
fromconst
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no specific reason, the constant variable vs mutable variable difference doesn't matter here. I was just playing around trying to figure out the constant not getting reassigned issue, didn't change it back after making it work. Changed it back to const