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 Inspect query 'request timestamp' value changes when curso… #54223

Merged

Conversation

patrykkopycinski
Copy link
Contributor

@patrykkopycinski patrykkopycinski commented Jan 8, 2020

…r leaves modal

Summary

Fixes #54196

Switched from useState based approach to css, also extracted logic to a separate component, so there is no more need to set up state and callbacks in every component
Refactored couple components to a new approach for React.memo to properly propagate displayName
Fixed https://github.com/elastic/kibana/pull/54223/files#diff-203bd20c5fdd5ee6229bc376a8a586b9L23 so now the icon will be hidden by default, ; was missing

Checklist

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

For maintainers

@patrykkopycinski patrykkopycinski added Team:SIEM v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.6.0 labels Jan 8, 2020
@patrykkopycinski patrykkopycinski self-assigned this Jan 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

@patrykkopycinski patrykkopycinski requested a review from spong January 8, 2020 14:04
Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

Great stuff! 👍to the CSS approach for showing/hiding, that's much cleaner.

Fixing the "hide until hovered" behavior on those buttons is huge! There's much less visual clutter on our dashboards now (although our panels look a little bare now! 😦).

I think we could move those CSS unit tests into dedicated InspectButtonContainer unit tests, but other than that this is awesome. Thanks for updating those components re: displayName as you touched them, too. I'll try to do the same.

One other thing I noticed in review: the timestamp value still changes when the browser is resized. I'm not sure whether this is expected (do we have some kind of global re-render on window resize?) or whether we want to fix it, but I figured it was worth mentioning.

x-pack/package.json Outdated Show resolved Hide resolved
.first()
.exists()
).toBe(true);
expect(wrapper.find(`InspectButtonContainer`)).toHaveStyleRule('opacity', '0', {
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like these tests should live in inspect.index.test.tsx, no? If we truly want a test for the integration here, I would just keep the exists() check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then we won't need to pass around BUTTON_CLASS, either.

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 was thinking about that as well, please let me know if it was done how you thought so :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks great! I'd love to get rid of the BUTTON_CLASS constant entirely but I couldn't immediately think of a way to get that to work. I was hoping we could use the css helper described here, but no such luck.

…ect-modal-rerender

# Conflicts:
#	x-pack/legacy/plugins/siem/public/components/inspect/index.tsx
#	x-pack/legacy/plugins/siem/public/components/stat_items/__snapshots__/index.test.tsx.snap
Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

@patrykkopycinski things look good, thanks for making these changes. Just a summary of what's left:

  • yarn.lock changes
  • The issue I mentioned earlier about timestamp changing on resize. Is that expected? Do we care about that?

@patrykkopycinski
Copy link
Contributor Author

@rylnd Fixed yarn.lock issue. In terms of resizing there is a PR open for refactoring AutoSizer to hooks, which should fix the issue with unnecessary re-renders #47120

Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

Sounds good RE the Autosizer stuff. The rerender only happens on some pages, and even then it's not something we'd expect to happen all the time. 👍

@patrykkopycinski
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@patrykkopycinski patrykkopycinski merged commit 7c4a531 into elastic:master Jan 14, 2020
@patrykkopycinski patrykkopycinski deleted the fix/siem-inspect-modal-rerender branch January 14, 2020 07:50
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jan 14, 2020
* upstream/master: (26 commits)
  Take page offset into account too (elastic#54567)
  [APM] Support error.{log,exception}.stacktrace.classname (elastic#54577)
  Np migration tsvb route validation (elastic#51850)
  [ML] MML calculator enhancements for multi-metric job wizard  (elastic#54573)
  [SIEM] Fix Inspect query 'request timestamp' value changes when curso… (elastic#54223)
  Fix chromeless NP apps not using full page width (elastic#54550)
  Remove extraneous public import to prevent failing Kibana startup (elastic#54676)
  [Uptime] Temporarily skip flakey tests (elastic#54675)
  Skip failing uptime tests
  Create UI for alerting and actions plugin (elastic#48959)
  [dev/build/sass] build stylesheets for disabled plugins too (elastic#54654)
  [SIEM] Use bulk actions API when updating or deleting rules (elastic#54521)
  Support "Deprecated" label in advanced settings (elastic#54539)
  [Maps] add text halo color and width style properties (elastic#53827)
  Service Map Data API at Runtime (elastic#54027)
  [SIEM] Detection Engine Create Rule Design Review #1 (elastic#54442)
  Skip flaky test
  [Canvas] Enable Embeddable maps (elastic#53971)
  [SIEM][Detection Engine] Increases the number or rules you can view on a single page (elastic#54628)
  uiSettings - use validation field for image field maxSize (elastic#54522)
  ...
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.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SIEM] Inspect query 'request timestamp' value changes when cursor leaves modal
5 participants