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

[Logs UI] Use Unified Search Bar: Meta issue #142714

Closed
5 of 6 tasks
Kerry350 opened this issue Oct 5, 2022 · 2 comments
Closed
5 of 6 tasks

[Logs UI] Use Unified Search Bar: Meta issue #142714

Kerry350 opened this issue Oct 5, 2022 · 2 comments
Assignees
Labels
epic Feature:Discover Discover Application Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Milestone

Comments

@Kerry350
Copy link
Contributor

Kerry350 commented Oct 5, 2022

Summary

This is the overall meta issue for using the Unified Search bar within the new Log Explorer. Part of #134412.

ℹ️ Some issues here can be completed before the state refactoring, some will need to be completed after: #142775

Implementation issues

Preview Give feedback
  1. Feature:Discover Feature:Logs UI Team:Infra Monitoring UI - DEPRECATED
    Kerry350
  2. Feature:Discover Feature:Logs UI Team:Infra Monitoring UI - DEPRECATED
    weltenwort
  3. Feature:Discover Feature:Logs UI Team:Infra Monitoring UI - DEPRECATED
    Kerry350 weltenwort
  4. Feature:Logs UI Team:Infra Monitoring UI - DEPRECATED
    Kerry350
  5. Feature:Logs UI Team:Infra Monitoring UI - DEPRECATED
  6. Feature:Discover Feature:Logs UI Team:obs-ux-logs enhancement

Current situation (high level)

The stream currently uses a simplified search bar.

Screenshot 2022-10-04 at 16 47 44

The hierarchy is comprised of a LogsToolbar component which wraps the QueryStringInput component from the Unified Search plugin.

The goal of this issue is to switch over to using the full Search Bar component from the Unified Search plugin.

This component adds extra functionality:

Screenshot 2022-10-04 at 16 59 04

We gain access to data view, saved queries, and filter functionality.

The current set of props handed to the QueryStringInput component is relatively simple:

 <QueryStringInput
  disableLanguageSwitcher={true}
  iconType="search"
  indexPatterns={[derivedDataView as DataView]}
  isInvalid={!isFilterQueryDraftValid}
  onChange={(query: Query) => {
    setSurroundingLogsId(null);
    setLogFilterQueryDraft(query);
  }}
  onSubmit={(query: Query) => {
    setSurroundingLogsId(null);
    applyLogFilterQuery(query);
  }}
  placeholder={i18n.translate('xpack.infra.logsPage.toolbar.kqlSearchFieldPlaceholder', {
    defaultMessage: 'Search for log entries… (e.g. host.name:host-1)',
  })}
  query={filterQueryDraft}
  appName={i18n.translate('xpack.infra.appName', {
    defaultMessage: 'Infra logs',
  })}
  deps={{ unifiedSearch, notifications, http, docLinks, uiSettings, data, storage }}
/>

The Search Bar props are understandably more complex as there is more functionality to take in to account.

Implications with regards to state

The current implementation only really concerns itself with the page state with regards to storing the filter state. All of the filtering context is handled via the useLogFilterState hook.

Moving forward with a more powerful Unified Search experience the state needs will need to expand and will be linked in with the state refactoring efforts.

We will take an approach that switches to the Search Bar for the query input and date / time / stream live functionality first, then we will refactor the page and URL state, and then we will implement the remaining Search Bar functionality (that covers "new state").

Interaction with services

Our implementation will make use of ui.SearchBar from the start contract of the Unified Search plugin. This is a pre-wrapped / pre-injected version of the SearchBar that calls createSearchBar for us. This means that in our own code we can interact directly with things like the FilterManager service, rather than having to handle ad-hoc callbacks.

@Kerry350 Kerry350 added Feature:Discover Discover Application Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Oct 5, 2022
@elasticmachine
Copy link
Contributor

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

@smith
Copy link
Contributor

smith commented Jun 26, 2023

Closing out this epic as we've completed most of it and are now focused on other areas. We'll leave the remaining issues open and in the backlog for when we decide to follow up with them later.

@smith smith closed this as completed Jun 26, 2023
@smith smith added this to the 8.7 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Feature:Discover Discover Application Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

No branches or pull requests

4 participants