[Logs UI] Refactor query bar state to hooks#52656
Conversation
|
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
weltenwort
left a comment
There was a problem hiding this comment.
👀 Reviewing on behalf of @elastic/logs-metrics-ui...
afgomez
left a comment
There was a problem hiding this comment.
Did a quick shallow pass before I saw @weltenwort's comment. I've only seen minor things, but please wait for his review :)
| ); | ||
|
|
||
| export const LogHighlightsBridge = ({ indexPattern }: { indexPattern: any }) => ( | ||
| export const LogHighlightsBridge = () => ( |
There was a problem hiding this comment.
I guess we can get rid of this component altogether
There was a problem hiding this comment.
In #50398 we can get rid of it, the log position state still needs the bridge right now though
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/index.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/index.ts
Outdated
Show resolved
Hide resolved
weltenwort
left a comment
There was a problem hiding this comment.
It's nice to see the redux state dwindle 👍
As I commented below I think this can be simplified even more. We'd just have to be careful how and where to access dependencies like the kuery parser.
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/index.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/containers/logs/with_log_filter.tsx
Outdated
Show resolved
Hide resolved
…g-filters # Conflicts: # x-pack/legacy/plugins/infra/public/containers/logs/log_highlights/redux_bridges.tsx
|
@elasticmachine merge upstream |
weltenwort
left a comment
There was a problem hiding this comment.
Nice, this seems to work and looks even better ❤️ I just left a few comments on style and TS idioms below. 😇
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts
Outdated
Show resolved
Hide resolved
…g-filters # Conflicts: # x-pack/test/functional/apps/infra/link_to.ts
|
Running into some major issues with the
|
|
As per Slack conversation with @weltenwort, we're going to handle the |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
💚 Build SucceededTo update your PR or re-run it, just comment with: |
|
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* [Logs UI] Refactor query bar state to hooks * Update typedef * Typecheck fix * Typecheck fix * Simplify log filter state * Remove WithLogFilter HOC and simplify hook further * Rename js to ts * Fix redirect imports * Fix link-to test accuracy * Fix link-to test * Simplify destructuring signature * Stylistic fixes * Move URL state to hook * Fix log filter URL state infinite loop * Revert "Fix log filter URL state infinite loop" This reverts commit 43302b3. * Revert "Move URL state to hook" This reverts commit c61f5b1. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: increase delay to make sure license refetched (elastic#53882) Allow custom NP plugin paths in production (elastic#53562) [Maps] show custom color ramps in legend (elastic#53780) [Lens] Expression type on document can be null (elastic#53883) [SIEM] [Detection engine] Add user permission to detection engine (elastic#53778) Update dependency @elastic/charts to v16.0.2 (elastic#52619) Set consistent EOL symbol in core API docs (elastic#53815) [Logs UI] Refactor query bar state to hooks (elastic#52656) [Maps] pass getFieldFormatter to DynamicTextProperty (elastic#53937) Invalidate alert API Key when generating a new one (elastic#53732) [Logs UI] HTTP API for log entries (elastic#53798)
* master: increase delay to make sure license refetched (elastic#53882) Allow custom NP plugin paths in production (elastic#53562) [Maps] show custom color ramps in legend (elastic#53780) [Lens] Expression type on document can be null (elastic#53883) [SIEM] [Detection engine] Add user permission to detection engine (elastic#53778) Update dependency @elastic/charts to v16.0.2 (elastic#52619) Set consistent EOL symbol in core API docs (elastic#53815) [Logs UI] Refactor query bar state to hooks (elastic#52656) [Maps] pass getFieldFormatter to DynamicTextProperty (elastic#53937) Invalidate alert API Key when generating a new one (elastic#53732) [Logs UI] HTTP API for log entries (elastic#53798) [kbn/pm] add caching to bootstrap (elastic#53622) adds createdAt and updatedAt fields to alerting (elastic#53793)
* master: increase delay to make sure license refetched (elastic#53882) Allow custom NP plugin paths in production (elastic#53562) [Maps] show custom color ramps in legend (elastic#53780) [Lens] Expression type on document can be null (elastic#53883) [SIEM] [Detection engine] Add user permission to detection engine (elastic#53778) Update dependency @elastic/charts to v16.0.2 (elastic#52619) Set consistent EOL symbol in core API docs (elastic#53815) [Logs UI] Refactor query bar state to hooks (elastic#52656) [Maps] pass getFieldFormatter to DynamicTextProperty (elastic#53937) Invalidate alert API Key when generating a new one (elastic#53732) [Logs UI] HTTP API for log entries (elastic#53798) [kbn/pm] add caching to bootstrap (elastic#53622) adds createdAt and updatedAt fields to alerting (elastic#53793) [SR] Enable component integration tests (elastic#53893)
…nsole-dependencies * 'master' of github.com:elastic/kibana: (33 commits) adds strict types to Alerting Client (elastic#53821) [Dashboard] Empty screen redesign (elastic#53681) Migrate config deprecations and `ShieldUser` functionality to the New Platform (elastic#53768) increase delay to make sure license refetched (elastic#53882) Allow custom NP plugin paths in production (elastic#53562) [Maps] show custom color ramps in legend (elastic#53780) [Lens] Expression type on document can be null (elastic#53883) [SIEM] [Detection engine] Add user permission to detection engine (elastic#53778) Update dependency @elastic/charts to v16.0.2 (elastic#52619) Set consistent EOL symbol in core API docs (elastic#53815) [Logs UI] Refactor query bar state to hooks (elastic#52656) [Maps] pass getFieldFormatter to DynamicTextProperty (elastic#53937) Invalidate alert API Key when generating a new one (elastic#53732) [Logs UI] HTTP API for log entries (elastic#53798) [kbn/pm] add caching to bootstrap (elastic#53622) adds createdAt and updatedAt fields to alerting (elastic#53793) [SR] Enable component integration tests (elastic#53893) Move index patterns: src/legacy/core_plugins/data 👉 src/plugins/data (elastic#53794) moved Task Manager server code under "server" directory (elastic#53777) Rename `/api/security/oidc` to `/api/security/oidc/callback`. (elastic#53886) ... # Conflicts: # yarn.lock
Summary
Fixes #50397
Moves the Log Filter state handling out of Redux and into a hook.
This is a fairly straightforward refactor.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] Unit or functional tests were updated or added to match the most common scenarios[ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers