-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Maps][ML] Integration follow up: adds partition field info to map point tooltip if available #123516
[Maps][ML] Integration follow up: adds partition field info to map point tooltip if available #123516
Conversation
Pinging @elastic/ml-ui (:ml) |
Pinging @elastic/kibana-gis (Team:Geo) |
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.
Tested and overall looks good. Just left one suggestion for the formatting of the row(s) in the tooltip.
@@ -36,7 +36,7 @@ export class LayerSelector extends Component<Props, State> { | |||
const typicalActual: MlAnomalyLayers = selectedOptions[0].value! as | |||
| 'typical' |
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.
Would be good to have these as a constant so they can be used in getSupportedShapeTypes
and other places as well
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.
Added in 2321384
@@ -36,7 +36,7 @@ export class LayerSelector extends Component<Props, State> { | |||
const typicalActual: MlAnomalyLayers = selectedOptions[0].value! as | |||
| 'typical' | |||
| 'actual' | |||
| 'connected'; | |||
| 'typical to actual'; |
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.
Can we not cast this as MlAnomalyLayers
?
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.
Updated to use an enum to be used everywhere 2321384
@@ -58,7 +58,7 @@ export class LayerSelector extends Component<Props, State> { | |||
options={[ | |||
{ value: 'actual', label: 'actual' }, | |||
{ value: 'typical', label: 'typical' }, | |||
{ value: 'connected', label: 'connected' }, | |||
{ value: 'typical to actual', label: 'typical to actual' }, |
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.
Should the labels here be internationalized?
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.
Good catch! Added in 2321384
@@ -40,18 +40,56 @@ export const ANOMALY_SOURCE_FIELDS: Record<string, Record<string, string>> = { | |||
}), | |||
type: 'string', | |||
}, | |||
actual: {}, |
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: suggestion to add a comment to clarify what's the difference between actual
and actualDisplay
here or why this actual
here doesn't need a label.
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.
Added in 2321384
95d79f7
to
690b39d
Compare
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.
Tested latest changes and LGTM
@@ -232,7 +232,7 @@ export class AnomalySource implements IVectorSource { | |||
} | |||
|
|||
async getSupportedShapeTypes(): Promise<VECTOR_SHAPE_TYPE[]> { | |||
return this._descriptor.typicalActual === 'connected' | |||
return this._descriptor.typicalActual === 'typical to actual' |
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: should this be ML_ANOMALY_LAYERS.TYPICAL_TO_ACTUAL?
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.
Updated in 1ae5ddc
type: 'LineString', | ||
coordinates: [result.typical, result.actual], | ||
let geometry: Geometry; | ||
if (locationType === 'typical' || locationType === 'actual') { |
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: I think we can use the new ML_ANOMALY_LAYERS here
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.
Yep - missed it! thanks - 1ae5ddc
Code LGTM. Just left a few small comments 🎉 |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Related meta issue: #123492
Checklist
Delete any items that are not applicable to this PR.