Repository navigation
[Uptime] Add Kuery Bar - #43621
[Uptime] Add Kuery Bar#43621
Conversation
|
Pinging @elastic/uptime |
💔 Build Failed |
9240269 to
90936c8
Compare
💔 Build Failed |
90936c8 to
714bb3d
Compare
💔 Build Failed |
714bb3d to
1866861
Compare
💔 Build Failed |
1866861 to
e3eab5d
Compare
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
065b371 to
def4457
Compare
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
f15c89c to
7ffb1e7
Compare
💔 Build Failed |
7ffb1e7 to
48f059e
Compare
💔 Build Failed |
48f059e to
4a38231
Compare
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
|
@shahzad31 @katrin-freihofner can you let me know if you're able to reproduce issues again? I think all your previous feedback is addressed at this point. |
|
jenkins test this |
💔 Build Failed |
💔 Build Failed |
|
@justinkambic looks good to me. I could not reproduce any of the issues. Nice work! |
💚 Build Succeeded |
shahzad31
left a comment
There was a problem hiding this comment.
Issues are resolved and code looks clean now :)
jasonrhodes
left a comment
There was a problem hiding this comment.
@justinkambic looks great to me -- there are a few things that are going to make this not work for infra/logs but we should obviously wait to address those until we build a shared version. This is a great step forward toward that!
@jasonrhodes yeah I'm aware I injected some Uptime-specific logic but like you say, I figure we can refactor/straighten that out in the next phase. Uptime will be better situated to handle that at that point, too! |
|
Checked out the latest version, looks and works great in my browser! |
💚 Build Succeeded |
* Add saved objects provider, auto-creation of index pattern. * Fix outdated import. * Add KueryBar component to Uptime app. * Extract module helper function to higher scope for greater reuse. * Reduce nesting in URL hook. * Update client usage of previously-moved helper function. * Add export for helper function to helper directory. * Add index pattern adapter to client lib. * Add KueryBar to Overview Page. * Add KueryBar and new filter group. * Move new components to appropriate directory. * Fix overview page import. * Delete status filter helper functions. * Remove from list of recommended fields. * Update domain files to use status filter. * Update GraphQL queries to use status filter. * Update GraphQL endpoint to accept status filter. * Delete obsolete component and associated files. * Add custom filter components. * Delete unneeded code. * Update adapters to accept statusFilter parameter. * Remove obsolete code. * Alphabetize object declaration. * Add index pattern helper function. * Update Overview handling of filters/user search. * Update GraphQL inferred types. * Delete obsolete component. * Update outdated unit test for stringify_url_params. * Add index file to new adapter directory. * Update test framework files to satisfy new typing requirements. * Update test snapshot for useUrlParams. * Update JSDoc comment in pings adapter. * Update pings adapter tests to use new `statusFilter` parameter. * Delete tests and fixtures for obsolete endpoints. * Update outdated fixture. * Update status filter usages for snapshot query tests. * Delete obsolete imports from index file. * Delete obsolete monitor list getter. * Update supported URL params for new param keys. * Remove unused prop reference. * Improve naming in new filter components. * Clean up function body. * Internationalize filter components. * Update internationalization key. * Add test for new helper function. * Extract function to dedicated file, add tests. * Add tests for filter popover. * Move FilterStatusButton to appropriate directory. * Add test for FilterStatusButton. * Add tests for getIndexPattern helper. * Extract helper function to dedicated file. * Add tests to combineFiltersAndUserSearch helper function. * Extract inline JSX to new component and add tests. * Remove obsolete code, update index pattern getter, and add tests. * Add filter clause helper function and tests. * Replace custom filter formatting code with calls to new helper function. * Move filter components to dedicated directory. * Rename filter files. * Delete obsolete snapshot. * Fix broken import in test file. * Update a comment. * Simplify index pattern loading in KueryBar. * Delete unused prop. * Extract toggle handler to external function and write tests. * Delete obsolete int'l labels and reuse existing ones in current code. * Delete remaining unused translation key. * Rename a file. * Handle numeric values for filters. Position KueryBar and FilterGroup on same line. * Remove ID's and URL's from FilterGroup. * Remove unneeded onOutsideClick handler from styled component to silence warning. * Escape colons in filters. * Escape colons in filters. * Fix bug in snapshot code - calculate total after filtering by status. * Add specific message to MonitorList when filters are active. * Introduce missing prop to unit tests. * Delete unused translation keys. * Undo filter-related changes to snapshot adapter function. * Remove unnecessary spread. * Update filter popover to trap focus and improve keyboard experience. * Update broken test snapshots.
* [Uptime] Add Kuery Bar (#43621) * Add saved objects provider, auto-creation of index pattern. * Fix outdated import. * Add KueryBar component to Uptime app. * Extract module helper function to higher scope for greater reuse. * Reduce nesting in URL hook. * Update client usage of previously-moved helper function. * Add export for helper function to helper directory. * Add index pattern adapter to client lib. * Add KueryBar to Overview Page. * Add KueryBar and new filter group. * Move new components to appropriate directory. * Fix overview page import. * Delete status filter helper functions. * Remove from list of recommended fields. * Update domain files to use status filter. * Update GraphQL queries to use status filter. * Update GraphQL endpoint to accept status filter. * Delete obsolete component and associated files. * Add custom filter components. * Delete unneeded code. * Update adapters to accept statusFilter parameter. * Remove obsolete code. * Alphabetize object declaration. * Add index pattern helper function. * Update Overview handling of filters/user search. * Update GraphQL inferred types. * Delete obsolete component. * Update outdated unit test for stringify_url_params. * Add index file to new adapter directory. * Update test framework files to satisfy new typing requirements. * Update test snapshot for useUrlParams. * Update JSDoc comment in pings adapter. * Update pings adapter tests to use new `statusFilter` parameter. * Delete tests and fixtures for obsolete endpoints. * Update outdated fixture. * Update status filter usages for snapshot query tests. * Delete obsolete imports from index file. * Delete obsolete monitor list getter. * Update supported URL params for new param keys. * Remove unused prop reference. * Improve naming in new filter components. * Clean up function body. * Internationalize filter components. * Update internationalization key. * Add test for new helper function. * Extract function to dedicated file, add tests. * Add tests for filter popover. * Move FilterStatusButton to appropriate directory. * Add test for FilterStatusButton. * Add tests for getIndexPattern helper. * Extract helper function to dedicated file. * Add tests to combineFiltersAndUserSearch helper function. * Extract inline JSX to new component and add tests. * Remove obsolete code, update index pattern getter, and add tests. * Add filter clause helper function and tests. * Replace custom filter formatting code with calls to new helper function. * Move filter components to dedicated directory. * Rename filter files. * Delete obsolete snapshot. * Fix broken import in test file. * Update a comment. * Simplify index pattern loading in KueryBar. * Delete unused prop. * Extract toggle handler to external function and write tests. * Delete obsolete int'l labels and reuse existing ones in current code. * Delete remaining unused translation key. * Rename a file. * Handle numeric values for filters. Position KueryBar and FilterGroup on same line. * Remove ID's and URL's from FilterGroup. * Remove unneeded onOutsideClick handler from styled component to silence warning. * Escape colons in filters. * Escape colons in filters. * Fix bug in snapshot code - calculate total after filtering by status. * Add specific message to MonitorList when filters are active. * Introduce missing prop to unit tests. * Delete unused translation keys. * Undo filter-related changes to snapshot adapter function. * Remove unnecessary spread. * Update filter popover to trap focus and improve keyboard experience. * Update broken test snapshots. * Update snap.
* Add saved objects provider, auto-creation of index pattern. * Fix outdated import. * Add KueryBar component to Uptime app. * Extract module helper function to higher scope for greater reuse. * Reduce nesting in URL hook. * Update client usage of previously-moved helper function. * Add export for helper function to helper directory. * Add index pattern adapter to client lib. * Add KueryBar to Overview Page. * Add KueryBar and new filter group. * Move new components to appropriate directory. * Fix overview page import. * Delete status filter helper functions. * Remove from list of recommended fields. * Update domain files to use status filter. * Update GraphQL queries to use status filter. * Update GraphQL endpoint to accept status filter. * Delete obsolete component and associated files. * Add custom filter components. * Delete unneeded code. * Update adapters to accept statusFilter parameter. * Remove obsolete code. * Alphabetize object declaration. * Add index pattern helper function. * Update Overview handling of filters/user search. * Update GraphQL inferred types. * Delete obsolete component. * Update outdated unit test for stringify_url_params. * Add index file to new adapter directory. * Update test framework files to satisfy new typing requirements. * Update test snapshot for useUrlParams. * Update JSDoc comment in pings adapter. * Update pings adapter tests to use new `statusFilter` parameter. * Delete tests and fixtures for obsolete endpoints. * Update outdated fixture. * Update status filter usages for snapshot query tests. * Delete obsolete imports from index file. * Delete obsolete monitor list getter. * Update supported URL params for new param keys. * Remove unused prop reference. * Improve naming in new filter components. * Clean up function body. * Internationalize filter components. * Update internationalization key. * Add test for new helper function. * Extract function to dedicated file, add tests. * Add tests for filter popover. * Move FilterStatusButton to appropriate directory. * Add test for FilterStatusButton. * Add tests for getIndexPattern helper. * Extract helper function to dedicated file. * Add tests to combineFiltersAndUserSearch helper function. * Extract inline JSX to new component and add tests. * Remove obsolete code, update index pattern getter, and add tests. * Add filter clause helper function and tests. * Replace custom filter formatting code with calls to new helper function. * Move filter components to dedicated directory. * Rename filter files. * Delete obsolete snapshot. * Fix broken import in test file. * Update a comment. * Simplify index pattern loading in KueryBar. * Delete unused prop. * Extract toggle handler to external function and write tests. * Delete obsolete int'l labels and reuse existing ones in current code. * Delete remaining unused translation key. * Rename a file. * Handle numeric values for filters. Position KueryBar and FilterGroup on same line. * Remove ID's and URL's from FilterGroup. * Remove unneeded onOutsideClick handler from styled component to silence warning. * Escape colons in filters. * Escape colons in filters. * Fix bug in snapshot code - calculate total after filtering by status. * Add specific message to MonitorList when filters are active. * Introduce missing prop to unit tests. * Delete unused translation keys. * Undo filter-related changes to snapshot adapter function. * Remove unnecessary spread. * Update filter popover to trap focus and improve keyboard experience. * Update broken test snapshots.
Summary
Add Kuery Bar.
Understanding this PR
This diff is rather large so I have composed the guide below to help reviewers parse and understand it. A large portion of the added code involves tests, snapshots, or code copied from APM that we will ultimately not be maintaining.
I've also taken the liberty of removing a large amount of code that this PR will make obsolete. Additionally, I've removed some code that is not in use.
Filter group
One critical part of this change that added significant complexity was keeping our existing filtering experience functional. This necessitated the creation of an additional component. Code for fetching filter values has moved from the old search bar component to here.
The way filtering now works is a combination of two criteria.
or'd at the value level, andand'd at the field level.Example:
yields a Kuery string like:
'(monitor.id:green-0001 or monitor.id:green-0002) and (observer.geo.name:us-east-1 or observer.geo.name:us-east-2)'After the filter query is generated, the output of the filter and search are
and'd together, an ES DSL is generated, and the resultant string is provided to the server and persisted in a newfiltersURL parameter.Kuery Bar
This patch finally adds the
KueryBarto Uptime. The eventual goal is for this to be a common component that is shared amongst the various Observability solutions. For this present iteration, we are copying the code from APM. I have added an declaration file for theTypeaheadclass, and placed some custom code in the mainindex.tsxfile. TheKueryBarplaces its output into the existingsearchURL parameter.Server
Previously we had no control over the selection of filters applied on
monitor.status, as the output of the buttons was a plaintext string. Since we have more control over the persisted filter logic, we can handle the special case ofmonitor.statusseparately; as such the server and GraphQL methods now accept a separate status flag, along with the JSON string to use as part of the Elasticsearch queries.Testing this PR
From a UI perspective the changes in this PR are localized to the Overview page. We've added the Kuery Bar and a series of filter dropdowns. Testing this PR is fairly straightforward.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers