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

[SIEM] Fix bug on url + inspect functionality on hosts/hostDetails page #44671

Merged
merged 16 commits into from
Sep 5, 2019

Conversation

XavierM
Copy link
Contributor

@XavierM XavierM commented Sep 3, 2019

Summary

  • Refactor code to only use react-router to figure out where we are in the app
  • Fix inspect functionality on hosts and host detail page https://github.com/elastic/siem-team/issues/450
  • Fix to keep the search query string in sync when switching tab or sub-tab
  • Fix url to access details page like that http://localhost:5601/app/siem#/hosts/MatBook-Pro.local
  • Need to update link of the breadcrumb to keep track of the search query string from our redux state
  • update unit test
  • Need to addunit and cypress test

Checklist

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

For maintainers

@XavierM XavierM added bug Fixes for quality problems that affect the customer experience Team:SIEM v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.4.0 labels Sep 3, 2019
@XavierM XavierM self-assigned this Sep 3, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem

@XavierM XavierM added the WIP Work in progress label Sep 3, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

@spong spong added the v7.5.0 label Sep 4, 2019
@XavierM XavierM force-pushed the siem-fix-url-sub-tab branch from 90a4559 to ecfe07a Compare September 4, 2019 03:36
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@XavierM XavierM force-pushed the siem-fix-url-sub-tab branch from ecfe07a to 7bb962a Compare September 4, 2019 19:51
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@stephmilovic stephmilovic left a comment

Choose a reason for hiding this comment

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

Checked out, tested locally, ran cypress tests, and performed code review. There are a few comments I'd like addressed, but nothing blocking. Great work and nice 🐛 squashing! LGTM 🚀

RouteComponentProps & TabNavigationProps
> {
public shouldComponentUpdate(nextProps: Readonly<RouteComponentProps>): boolean {
export class SiemNavigationComponent extends React.Component<TabNavigationProps & RouteSpyState> {
Copy link
Contributor

Choose a reason for hiding this comment

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

We could refactor this to use hooks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure about that because we still need to be connected to the redux connect. I think that it can be converted to a hook when will update our redux to use hook

: ''
: convertKueryToElasticSearchQuery(
`${filterQueryExpression} ${
hostName ? `and host.name: "${escapeQueryValue(hostName)}"` : ''
Copy link
Contributor

Choose a reason for hiding this comment

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

we're going to have to look out for conflicts between this and my escape query PR: #43030

</>
)}
/>
<Route
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way we can simplify this? it's a lot of repeated code. perhaps put all this route data in an object and map over that object, returning the <Route>s you need

@XavierM XavierM force-pushed the siem-fix-url-sub-tab branch from 7bb962a to 0ee232a Compare September 5, 2019 01:17
@XavierM XavierM added review and removed WIP Work in progress labels Sep 5, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@angorayc
Copy link
Contributor

angorayc commented Sep 5, 2019

Nice clean up and thanks for fixing the bug! Sorry that I did a fix for cyclic deps without asking for your permission, please feel free to fix in other solution. I just found it might be upset to see the red light in the morning...

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@XavierM
Copy link
Contributor Author

XavierM commented Sep 5, 2019

Nice clean up and thanks for fixing the bug! Sorry that I did a fix for cyclic deps without asking for your permission, please feel free to fix in other solution. I just found it might be upset to see the red light in the morning...

@angorayc Please do not be sorry I appreciate it the help.

Copy link
Contributor

@FrankHassanabad FrankHassanabad left a comment

Choose a reason for hiding this comment

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

I worked off this branch personally and have nothing but the nicest things to say about it. Appreciate all the effort from all the people that have gone into this and the Cypress tests as well.

Using my best Hermione voice, I approve using this latin phrase

Haec est magna viverra enim omnis petitionem habere!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@XavierM XavierM merged commit a712751 into elastic:master Sep 5, 2019
XavierM added a commit to XavierM/kibana that referenced this pull request Sep 5, 2019
…ge (elastic#44671)

* refactor code to use react-router params instead of regex inside of use-url-state
Fix inspect in hosts/host details page
Fix some url state issue too

* add search in breadcrumb + fix existing unit testing

* refactor code to use react-router params instead of regex inside of use-url-state
Fix inspect in hosts/host details page
Fix some url state issue too

* add search in breadcrumb + fix existing unit testing

* fix bug by doing cypress test

* clean up + unit testing

* review I

* [SIEM] Fixes the Anomalies table paging to work again

* Updated to look more like the PR in flight to have a smaller diff

* fix cyclic deps

* remove redundant comment

* review II

* review II + fix circular dependency

* fix host url
XavierM added a commit to XavierM/kibana that referenced this pull request Sep 5, 2019
…ge (elastic#44671)

* refactor code to use react-router params instead of regex inside of use-url-state
Fix inspect in hosts/host details page
Fix some url state issue too

* add search in breadcrumb + fix existing unit testing

* refactor code to use react-router params instead of regex inside of use-url-state
Fix inspect in hosts/host details page
Fix some url state issue too

* add search in breadcrumb + fix existing unit testing

* fix bug by doing cypress test

* clean up + unit testing

* review I

* [SIEM] Fixes the Anomalies table paging to work again

* Updated to look more like the PR in flight to have a smaller diff

* fix cyclic deps

* remove redundant comment

* review II

* review II + fix circular dependency

* fix host url
XavierM added a commit that referenced this pull request Sep 5, 2019
…ge (#44671) (#44911)

* refactor code to use react-router params instead of regex inside of use-url-state
Fix inspect in hosts/host details page
Fix some url state issue too

* add search in breadcrumb + fix existing unit testing

* refactor code to use react-router params instead of regex inside of use-url-state
Fix inspect in hosts/host details page
Fix some url state issue too

* add search in breadcrumb + fix existing unit testing

* fix bug by doing cypress test

* clean up + unit testing

* review I

* [SIEM] Fixes the Anomalies table paging to work again

* Updated to look more like the PR in flight to have a smaller diff

* fix cyclic deps

* remove redundant comment

* review II

* review II + fix circular dependency

* fix host url
XavierM added a commit that referenced this pull request Sep 5, 2019
…ge (#44671) (#44912)

* refactor code to use react-router params instead of regex inside of use-url-state
Fix inspect in hosts/host details page
Fix some url state issue too

* add search in breadcrumb + fix existing unit testing

* refactor code to use react-router params instead of regex inside of use-url-state
Fix inspect in hosts/host details page
Fix some url state issue too

* add search in breadcrumb + fix existing unit testing

* fix bug by doing cypress test

* clean up + unit testing

* review I

* [SIEM] Fixes the Anomalies table paging to work again

* Updated to look more like the PR in flight to have a smaller diff

* fix cyclic deps

* remove redundant comment

* review II

* review II + fix circular dependency

* fix host url
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 6, 2019
…ete-for-distance_feature

* 'master' of github.com:elastic/kibana: (89 commits)
  Replace TSVB timeseries charts with elastic-charts (elastic#33558)
  [TSVB][Top N aggregation] Unable to deal with negative values (elastic#43581)
  [alerting] Adds Action Type configuration support and whitelisting (elastic#44483)
  FTR: fix WebDriver Actions calls (elastic#44605)
  [Code] add NodeRepositoriesService to watch new repositories on local node (elastic#44677)
  [skip-ci][Maps] Improve Maps intro page (elastic#44721)
  [Maps] Update titles and descriptions for data sources (elastic#44833)
  Types + Extract Integration Util (elastic#44433)
  Downgrade log level from info to debug for cases when we cannot handle authentication attempt. (elastic#44933)
  [Reporting] Remove Chome stdout/stderr observables, Add Browser Logger observable (elastic#44359)
  Update Jest script to output coverage (elastic#44447)
  [ftr] support --kibana-install-dir flag (elastic#44552)
  [WATCHER] Allow user to set a threshold value of 0 (elastic#44810)
  Remove injectI18n in dashboard plugin. (elastic#44580)
  [Graph] Save modal (elastic#44261)
  Use external script for the OIDC Implicit flow handler page. (elastic#44866)
  disable router prefixing with pluginId (elastic#44855)
  [SIEM] Fix bug on url + inspect functionality on hosts/hostDetails page (elastic#44671)
  [ML] File data viz limiting uploaded doc chunk size (elastic#44768)
  [code] Append go env variable 'GOCACHE' to go lsp spawn command. (elastic#44864)
  ...
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 6, 2019
…plate

* 'master' of github.com:elastic/kibana: (91 commits)
  [APM] Make number of x ticks responsive to the plot width (elastic#44870)
  [ML] Single metric viewer: Fix top nav refresh behaviour. (elastic#44860)
  Replace TSVB timeseries charts with elastic-charts (elastic#33558)
  [TSVB][Top N aggregation] Unable to deal with negative values (elastic#43581)
  [alerting] Adds Action Type configuration support and whitelisting (elastic#44483)
  FTR: fix WebDriver Actions calls (elastic#44605)
  [Code] add NodeRepositoriesService to watch new repositories on local node (elastic#44677)
  [skip-ci][Maps] Improve Maps intro page (elastic#44721)
  [Maps] Update titles and descriptions for data sources (elastic#44833)
  Types + Extract Integration Util (elastic#44433)
  Downgrade log level from info to debug for cases when we cannot handle authentication attempt. (elastic#44933)
  [Reporting] Remove Chome stdout/stderr observables, Add Browser Logger observable (elastic#44359)
  Update Jest script to output coverage (elastic#44447)
  [ftr] support --kibana-install-dir flag (elastic#44552)
  [WATCHER] Allow user to set a threshold value of 0 (elastic#44810)
  Remove injectI18n in dashboard plugin. (elastic#44580)
  [Graph] Save modal (elastic#44261)
  Use external script for the OIDC Implicit flow handler page. (elastic#44866)
  disable router prefixing with pluginId (elastic#44855)
  [SIEM] Fix bug on url + inspect functionality on hosts/hostDetails page (elastic#44671)
  ...
@XavierM XavierM deleted the siem-fix-url-sub-tab branch June 4, 2020 16:06
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 release_note:skip Skip the PR/issue when compiling release notes review Team:SIEM v7.4.0 v7.5.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants