Skip to content
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

Merged
merged 5 commits into from
Jan 25, 2022

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Jan 20, 2022

Summary

Related meta issue: #123492

  • adds partition field to tooltip
  • updates layer name to 'typical to actual'
  • simplifies results fetch

image

Checklist

Delete any items that are not applicable to this PR.

@alvarezmelissa87 alvarezmelissa87 added [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation :ml release_note:skip Skip the PR/issue when compiling release notes v8.1.0 labels Jan 20, 2022
@alvarezmelissa87 alvarezmelissa87 self-assigned this Jan 20, 2022
@alvarezmelissa87 alvarezmelissa87 requested a review from a team as a code owner January 20, 2022 22:19
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

Copy link
Contributor

@peteharverson peteharverson left a 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'
Copy link
Member

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

Copy link
Contributor Author

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';
Copy link
Member

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?

Copy link
Contributor Author

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' },
Copy link
Member

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?

Copy link
Contributor Author

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: {},
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 2321384

Copy link
Contributor

@peteharverson peteharverson left a 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'
Copy link
Member

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?

Copy link
Contributor Author

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') {
Copy link
Member

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

Copy link
Contributor Author

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

@qn895
Copy link
Member

qn895 commented Jan 24, 2022

Code LGTM. Just left a few small comments 🎉

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 3.5MB 3.5MB +1.4KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @alvarezmelissa87

@alvarezmelissa87 alvarezmelissa87 merged commit 2ebc8d2 into elastic:main Jan 25, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jan 25, 2022
@alvarezmelissa87 alvarezmelissa87 deleted the ml-maps-follow-up-one branch January 25, 2022 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation :ml release_note:skip Skip the PR/issue when compiling release notes v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants