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] Single Metric Viewer: Fix job check. #55191

Merged
merged 6 commits into from
Jan 20, 2020

Conversation

walterra
Copy link
Contributor

Summary

Part of #52986.

Fixes switching via navigation to Single Metric Viewer from Anomaly Explorer for a job which isn't supported in the Single Metric Viewer.

  • Moves checkJobSelection() method from timeseriesexplorer.js to a stand-alone function as validateJobSelection() in timeseriesexplorer_utils. This allows us to move the check to <TimeSeriesExplorerUrlStateManager /> further up to this hook based outer component. Based on that we no longer need to pass on some of the still undefined props to the inner components which should result in some less renders and stricter props with less optional attributes. With this in place we now pass on the current job as selectedJobId to timeseriesexplorer.js and not the raw array we get from globalState anymore.
  • Moves TimeSeriesExplorerPage component form timeseriesexplorer.js to its own file to make it reusable.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@walterra walterra added bug Fixes for quality problems that affect the customer experience regression :ml Feature:Anomaly Detection ML anomaly detection v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v7.6.0 labels Jan 17, 2020
@walterra walterra requested a review from a team as a code owner January 17, 2020 15:47
@walterra walterra self-assigned this Jan 17, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@walterra walterra mentioned this pull request Jan 17, 2020
21 tasks
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 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 LGTM ⚡️

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 LGTM

@walterra
Copy link
Contributor Author

@elasticmachine merge upstream

<>
<NavigationMenu tabId="timeseriesexplorer" />
{/* Show animated progress bar while loading */}
{loading === true && (
Copy link
Member

Choose a reason for hiding this comment

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

total nit, this could be a ternary

setGlobalState('ml', { jobIds: [validSelectedJobIds[0]] });
return true;
} else {
// if a group has been loaded
Copy link
Member

@jgowdyelastic jgowdyelastic Jan 19, 2020

Choose a reason for hiding this comment

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

is this else reachable?

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 spot that must have been some quite old code I copied over. When picking a group to display in Anomaly Explorer, the job ids will also be added to the URL. Using the UI and coming to Single Metric Viewer, you cannot have a URL that just has groups but not jobs populated. I cleaned up the code in 6017f59.

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@walterra walterra merged commit bd7f7ab into elastic:master Jan 20, 2020
@walterra walterra deleted the ml-fix-globalstate-job-check branch January 20, 2020 14:37
walterra added a commit to walterra/kibana that referenced this pull request Jan 20, 2020
Fixes switching via navigation to Single Metric Viewer from Anomaly Explorer for a job which isn't supported in the Single Metric Viewer.
walterra added a commit to walterra/kibana that referenced this pull request Jan 20, 2020
Fixes switching via navigation to Single Metric Viewer from Anomaly Explorer for a job which isn't supported in the Single Metric Viewer.
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jan 20, 2020
* upstream/master:
  [ML] Single Metric Viewer: Fix job check. (elastic#55191)
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jan 20, 2020
* master: (108 commits)
  [ML] Single Metric Viewer: Fix job check. (elastic#55191)
  Show error page when accessing unavailable app (elastic#54656)
  [ML] Improving job wizards with datafeed aggregations (elastic#55180)
  remove flaly assetion. a license presence tested anyway (elastic#55289)
  fix commonly used ranges uptime (elastic#54930)
  [SIEM] Use proper icons on Detections view (elastic#55215)
  Fix: invalid translation referenced (elastic#54901)
  [State Management] Remove AppState from edit_index_pattern page (elastic#54104)
  Implements `getStartServices` on server-side (elastic#55156)
  Move vis_vega_type/data_model tests to jest (elastic#55186)
  [SIEM] [Detection Engine] Update status on rule details page (elastic#55201)
  Fix KQL value suggestions for nested fields (elastic#54820)
  Enforce camelCase format for a plugin id (elastic#53759)
  [SIEM] Detection engine cleanup for rule details/creation/edit page (elastic#55069)
  Remove nested root from index pattern (elastic#54978)
  [Reporting/Migration] ReportingSetup, LegacySetup (elastic#54198)
  [SIEM] [Detection Engine] Fixes duplicate rule action (elastic#55252)
  [SIEM] Detections add alert & signal tab (elastic#55127)
  Management API - redirect on disabled app path (elastic#55136)
  [SIEM][Detection Engine] Fixes critical regression on the backend with immutable and tags
  ...
walterra added a commit that referenced this pull request Jan 20, 2020
Fixes switching via navigation to Single Metric Viewer from Anomaly Explorer for a job which isn't supported in the Single Metric Viewer.
walterra added a commit that referenced this pull request Jan 20, 2020
Fixes switching via navigation to Single Metric Viewer from Anomaly Explorer for a job which isn't supported in the Single Metric Viewer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Anomaly Detection ML anomaly detection :ml regression release_note:skip Skip the PR/issue when compiling release notes v7.6.0 v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants