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

[ML] Anomaly Detection: Adds 'Add to dashboard' action for Single Metric Viewer #182538

Merged

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented May 2, 2024

Summary

Adds an action to add the Single Metric Viewer to new or existing dashboards.

Related meta issue: #181272

SMV-add-to-dash.mp4

Checklist

Delete any items that are not applicable to this PR.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

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.

Just one minor comment. Otherwise tested and LGTM

defaultMessage="Add to dashboard"
/>
),
icon: 'search',
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this icon is needed. The actions for the anomaly swim lane and anomaly charts only use text.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in eeacd0d

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGMT, one question about the inline styles and naming suggestion


return (
<>
<EuiFlexGroup style={{ float: 'right' }} alignItems="center">
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you just moved this code, but I wonder if we can get rid of the inline styles? Do we need the float here?

Comment on lines 44 to 46
toggleShowModelBoundsHandler: () => void;
toggleShowAnnotationsHandler: () => void;
toggleShowForecastHandler: () => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we follow the naming convention for controlled component?

Suggested change
toggleShowModelBoundsHandler: () => void;
toggleShowAnnotationsHandler: () => void;
toggleShowForecastHandler: () => void;
onShowModelBoundsChange: () => void;
onShowAnnotationsChange: () => void;
onShowForecastChange: () => void;

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 call - updated in eacccc6

@alvarezmelissa87
Copy link
Contributor Author

@elasticmachine merge upstream

@alvarezmelissa87
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #66 / discover/group4 "after all" hook: afterTestSuite.trigger in "discover/group4"
  • [job] [logs] FTR Configs #66 / discover/group4 discover esql view "after all" hook: afterTestSuite.trigger in "discover esql view"
  • [job] [logs] FTR Configs #66 / discover/group4 discover esql view query history "after all" hook: afterTestSuite.trigger for "should add a failed query to the history"
  • [job] [logs] FTR Configs #66 / discover/group4 discover esql view query history "before each" hook for "should select a query from the history and submit it"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ml 2015 2017 +2

Async chunks

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

id before after diff
ml 4.1MB 4.1MB +2.7KB

History

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

cc @alvarezmelissa87

@alvarezmelissa87 alvarezmelissa87 merged commit e2807c3 into elastic:main May 6, 2024
18 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 6, 2024
@alvarezmelissa87 alvarezmelissa87 deleted the ml-smv-embeddable-add-from-smv branch May 6, 2024 18:06
@szabosteve szabosteve changed the title [ML] Anomaly Detection: Add 'Add to dashboard' action for Single Metric Viewer [ML] Anomaly Detection: Adds 'Add to dashboard' action for Single Metric Viewer Jul 31, 2024
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 Feature:Anomaly Detection ML anomaly detection :ml release_note:enhancement v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants