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

Url state #36663

Merged
merged 20 commits into from
May 21, 2019
Merged

Url state #36663

merged 20 commits into from
May 21, 2019

Conversation

stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented May 20, 2019

Uses url parameters to store timerange and kql data. Also tracks whether the timerange is locked or not

I have a couple more tests to write but wanted to get the PR up.

Happy path manual tests:

  • change the datepicker
  • check that the url has updated
  • refresh the page, ensure that timerange remains
  • add a kql query
  • check that the url has updated
  • refresh the page, ensure that kql query remains

1a

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

Pinging @elastic/secops

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@angorayc
Copy link
Contributor

Thanks for taking care of this @stephmilovic! I followed the past above but found that the status for date-picker persisted well, but my kql query is unable to remain after refreshing page. Please let me know if you can reproduce it.
url-state

@stephmilovic
Copy link
Contributor Author

@angorayc thanks for reviewing. Can you please post the full url? it might be because the kql query does not persist between pages, only on the page it was set

@angorayc
Copy link
Contributor

This is what I've got, seems that kql is not a part of it. Hope it helps

http://localhost:5601/app/siem#/hosts?_g=()&timerange=(global:(from:1558195200000,fromStr:now%2Fw,kind:relative,linkTo:!(timeline),to:1558799999999,toStr:now%2Fw),timeline:(from:1558195200000,fromStr:now%2Fw,kind:relative,linkTo:!(global),to:1558799999999,toStr:now%2Fw))

@XavierM
Copy link
Contributor

XavierM commented May 21, 2019

I think we should have an empty state URL on initialization. So an user can still share their URL and show what they saw at this time

@XavierM
Copy link
Contributor

XavierM commented May 21, 2019

@angorayc I think that you found a usability bug, we should link the refresh button to apply the KQL search in the KQL bar.

if (globalRange.linkTo.length === 0) {
this.props.toggleTimelineLinkTo({ linkToId: 'global' });
}
// @ts-ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are 2 remaining ts issues, this is one of them. I've spent the better part of the past 6 hours trying to figure this out. May need to merge and come back. Even after adding UrlStateMappedToActionsType and wrapping it in another if, it still gives this error:
Screen Shot 2019-05-21 at 9 42 41 AM

toggleTimelineLinkTo: inputsActions.toggleTimelineLinkTo,
}
// @ts-ignore
)(UrlStateComponents);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are 2 remaining ts issues, this is one of them. I've spent the better part of the past 6 hours trying to figure this out. May need to merge and come back. Both @spong and @XavierM have spent time pairing on this, it's a toughy:
Screen Shot 2019-05-21 at 10 11 18 AM

Copy link
Contributor

@XavierM XavierM left a comment

Choose a reason for hiding this comment

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

LGTM, and please create issues so we can track these problems

@stephmilovic
Copy link
Contributor Author

Opened this issue for the remaining work: https://github.com/elastic/ingest-dev/issues/447

@stephmilovic stephmilovic merged commit d4c51ff into elastic:master May 21, 2019
stephmilovic added a commit to stephmilovic/kibana that referenced this pull request May 21, 2019
- track SIEM app state in url
stephmilovic added a commit that referenced this pull request May 21, 2019
@spong spong added the release_note:skip Skip the PR/issue when compiling release notes label May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:SIEM v7.2.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants