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

[Infrastructure UI] Hosts View: Unified Search bar with auto-refresh enabled #157011

Conversation

jennypavlova
Copy link
Member

@jennypavlova jennypavlova commented May 8, 2023

Closes #156690

Summary

This PR adds a flag (isAutoRefreshDisabled) to disable the default auto-refresh option in the unified search.

Background

The auto refresh is added by default when using a unified search bar in defaultOnRefreshChange and it appeared on the host view page when currently the auto-refresh option is not supported.

with isAutoRefreshDisabled (true) without isAutoRefreshDisabled (false/undefined)
image image

@jennypavlova jennypavlova added Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to the previous minor version (i.e. one version back from main) labels May 8, 2023
@jennypavlova jennypavlova self-assigned this May 8, 2023
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@jennypavlova jennypavlova marked this pull request as ready for review May 8, 2023 16:31
@jennypavlova jennypavlova requested review from a team as code owners May 8, 2023 16:31
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

Copy link
Contributor

@mohamedhamed-ahmed mohamedhamed-ahmed left a comment

Choose a reason for hiding this comment

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

LGTM!

@stratoula
Copy link
Contributor

@jennypavlova can you add a storybook story about this new flag? Thanx

@jennypavlova
Copy link
Member Author

@stratoula Storybook added (also removed a duplicate one):

Off On
Screenshot 2023-05-11 at 10 39 48 Screenshot 2023-05-11 at 10 42 00

@jennypavlova
Copy link
Member Author

@elasticmachine merge upstream

@@ -218,7 +221,7 @@ export function createSearchBar({
filters={filters}
query={query}
onFiltersUpdated={defaultFiltersUpdated(data.query, props.onFiltersUpdated)}
onRefreshChange={defaultOnRefreshChange(data.query)}
onRefreshChange={defaultOnRefreshChange(data.query, props.isAutoRefreshDisabled)}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that there is no need to pass it to the function, just dont run the function if this prop is set to true

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it to set undefined there if we have isAutoRefreshDisabled set to true otherwise it will use the function.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking something like onRefreshChange={!props.isAutoRefreshDisabled ? defaultOnRefreshChange(data.query) : undefined}

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see, this is what you need. This is a nit but can you add the undefined as the else clause? As I have it on my comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, thanks for checking that! 🙂 I changed the condition to return the function if we don't have isAutoRefreshDisabled and otherwise to be undefined. Is that what you mean?

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Unified search changes LGTM!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
infra 2.0MB 2.0MB +25.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
unifiedSearch 33.9KB 33.9KB +31.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 410 414 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 491 495 +4
total +6

History

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

cc @jennypavlova

@stratoula
Copy link
Contributor

@jennypavlova is it necessary to backport to the prev minor?

@jennypavlova
Copy link
Member Author

@jennypavlova is it necessary to backport to the prev minor?

@stratoula I added it because there we saw the issue with the hosts view data picker there and the backport will fix it

@jennypavlova jennypavlova merged commit 77d864e into elastic:main Jun 13, 2023
@jennypavlova jennypavlova deleted the 156690-infrastructure-ui-hosts-view-unified-search-bar-with-auto-refresh-enabled branch June 13, 2023 08:08
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 13, 2023
…enabled (elastic#157011)

Closes elastic#156690

## Summary

This PR adds a flag (`isAutoRefreshDisabled`) to disable the default
auto-refresh option in the unified search.

## Background

The auto refresh is added by default when using a unified search bar in
[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)
and it appeared on the host view page when currently the auto-refresh
option is not supported.

| with `isAutoRefreshDisabled` (true) | without `isAutoRefreshDisabled`
(false/undefined) |
| ------------------------------------ |
-------------------------------------------------- |
| <img width="200" alt="image"
src="https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png">
| <img width="200" alt="image"
src="https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png">
|

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
(cherry picked from commit 77d864e)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.8

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 13, 2023
…fresh enabled (#157011) (#159543)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Infrastructure UI] Hosts View: Unified Search bar with auto-refresh
enabled (#157011)](#157011)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"jennypavlova","email":"dzheni.pavlova@elastic.co"},"sourceCommit":{"committedDate":"2023-06-13T08:07:58Z","message":"[Infrastructure
UI] Hosts View: Unified Search bar with auto-refresh enabled
(#157011)\n\nCloses #156690 \r\n\r\n## Summary\r\n\r\nThis PR adds a
flag (`isAutoRefreshDisabled`) to disable the default\r\nauto-refresh
option in the unified search.\r\n\r\n## Background\r\n\r\nThe auto
refresh is added by default when using a unified search bar
in\r\n[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)\r\nand
it appeared on the host view page when currently the
auto-refresh\r\noption is not supported.\r\n\r\n\r\n| with
`isAutoRefreshDisabled` (true) | without
`isAutoRefreshDisabled`\r\n(false/undefined) |\r\n|
------------------------------------
|\r\n-------------------------------------------------- |\r\n| <img
width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png\">\r\n|
<img width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png\">\r\n|\r\n\r\n---------\r\n\r\nCo-authored-by:
Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"77d864e4ff04027f800789259fd6c6194b51c59a","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Infra
Monitoring
UI","release_note:skip","backport:prev-minor","v8.9.0"],"number":157011,"url":"#157011
UI] Hosts View: Unified Search bar with auto-refresh enabled
(#157011)\n\nCloses #156690 \r\n\r\n## Summary\r\n\r\nThis PR adds a
flag (`isAutoRefreshDisabled`) to disable the default\r\nauto-refresh
option in the unified search.\r\n\r\n## Background\r\n\r\nThe auto
refresh is added by default when using a unified search bar
in\r\n[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)\r\nand
it appeared on the host view page when currently the
auto-refresh\r\noption is not supported.\r\n\r\n\r\n| with
`isAutoRefreshDisabled` (true) | without
`isAutoRefreshDisabled`\r\n(false/undefined) |\r\n|
------------------------------------
|\r\n-------------------------------------------------- |\r\n| <img
width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png\">\r\n|
<img width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png\">\r\n|\r\n\r\n---------\r\n\r\nCo-authored-by:
Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"77d864e4ff04027f800789259fd6c6194b51c59a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"#157011
UI] Hosts View: Unified Search bar with auto-refresh enabled
(#157011)\n\nCloses #156690 \r\n\r\n## Summary\r\n\r\nThis PR adds a
flag (`isAutoRefreshDisabled`) to disable the default\r\nauto-refresh
option in the unified search.\r\n\r\n## Background\r\n\r\nThe auto
refresh is added by default when using a unified search bar
in\r\n[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)\r\nand
it appeared on the host view page when currently the
auto-refresh\r\noption is not supported.\r\n\r\n\r\n| with
`isAutoRefreshDisabled` (true) | without
`isAutoRefreshDisabled`\r\n(false/undefined) |\r\n|
------------------------------------
|\r\n-------------------------------------------------- |\r\n| <img
width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png\">\r\n|
<img width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png\">\r\n|\r\n\r\n---------\r\n\r\nCo-authored-by:
Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"77d864e4ff04027f800789259fd6c6194b51c59a"}}]}]
BACKPORT-->

Co-authored-by: jennypavlova <dzheni.pavlova@elastic.co>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 13, 2023
* main: (199 commits)
  [Lens] Add custom formatter within the Lens editor (elastic#158468)
  [Uptime] Hide app if no data is available (elastic#159118)
  [CodeEditor] Add grok highlighting (elastic#159334)
  Expose decoded cloudId components from the cloud plugin's contract (elastic#159442)
  [Profiling] Use collector and symbolizer integrations in the add data page (elastic#159481)
  [Infrastructure UI] Hosts View: Unified Search bar with auto-refresh enabled (elastic#157011)
  [APM] Add feature flag for not available apm schema (elastic#158911)
  [Lens] Remove deprecated componentWillReceiveProps usage (elastic#159502)
  [api-docs] 2023-06-13 Daily api_docs build (elastic#159536)
  [data views] Use versioned router for REST routes (elastic#158608)
  [maps] fix geo line source not loaded unless maps application is opened (elastic#159432)
  [Enterprise Search][Search application]Fix Create Api key url (elastic#159519)
  [Security Solution] Increase timeout for indexing hosts (elastic#159518)
  dashboard Reset button disable (elastic#159430)
  [Security Solution] Unskip Endpoint API tests after package fix (elastic#159484)
  [Synthetics] adjust alert timing (elastic#159511)
  [ResponseOps][rule registry] Remove usages of `refresh: true` (elastic#159252)
  Revert "Remove unused package (elastic#158597)"
  [Serverless] Adding config to disable authentication on task manager background worker utilization API (elastic#159505)
  Remove unused package (elastic#158597)
  ...
saarikabhasi pushed a commit to saarikabhasi/kibana that referenced this pull request Jun 13, 2023
…enabled (elastic#157011)

Closes elastic#156690 

## Summary

This PR adds a flag (`isAutoRefreshDisabled`) to disable the default
auto-refresh option in the unified search.

## Background

The auto refresh is added by default when using a unified search bar in
[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)
and it appeared on the host view page when currently the auto-refresh
option is not supported.


| with `isAutoRefreshDisabled` (true) | without `isAutoRefreshDisabled`
(false/undefined) |
| ------------------------------------ |
-------------------------------------------------- |
| <img width="200" alt="image"
src="https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png">
| <img width="200" alt="image"
src="https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png">
|

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
saarikabhasi pushed a commit to saarikabhasi/kibana that referenced this pull request Jun 13, 2023
…enabled (elastic#157011)

Closes elastic#156690 

## Summary

This PR adds a flag (`isAutoRefreshDisabled`) to disable the default
auto-refresh option in the unified search.

## Background

The auto refresh is added by default when using a unified search bar in
[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)
and it appeared on the host view page when currently the auto-refresh
option is not supported.


| with `isAutoRefreshDisabled` (true) | without `isAutoRefreshDisabled`
(false/undefined) |
| ------------------------------------ |
-------------------------------------------------- |
| <img width="200" alt="image"
src="https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png">
| <img width="200" alt="image"
src="https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png">
|

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
saarikabhasi pushed a commit to saarikabhasi/kibana that referenced this pull request Jun 14, 2023
…enabled (elastic#157011)

Closes elastic#156690 

## Summary

This PR adds a flag (`isAutoRefreshDisabled`) to disable the default
auto-refresh option in the unified search.

## Background

The auto refresh is added by default when using a unified search bar in
[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)
and it appeared on the host view page when currently the auto-refresh
option is not supported.


| with `isAutoRefreshDisabled` (true) | without `isAutoRefreshDisabled`
(false/undefined) |
| ------------------------------------ |
-------------------------------------------------- |
| <img width="200" alt="image"
src="https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png">
| <img width="200" alt="image"
src="https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png">
|

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.8.2 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Infrastructure UI] Hosts View: Unified Search bar with auto-refresh enabled
7 participants