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

[Lens] Add feature to ignore global filters at layer level #159248

Merged
merged 15 commits into from
Jun 9, 2023

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Jun 7, 2023

Summary

Fixes #143493

  • Add the switch control in Layer Settings
    • Make sure it does not duplicate on Annotation Layer Settings
    • Data Layers
    • Reference line layers
    • Extended dataView picker to support multiple icons
      • Added unit tests
    • Functional tests
Screenshot 2023-06-07 at 15 28 19 Screenshot 2023-06-07 at 15 31 31 Screenshot 2023-06-07 at 15 28 25 Screenshot 2023-06-07 at 15 27 59 Screenshot 2023-06-07 at 15 27 53
  • Create IgnoreGlobalFilter shared component folder

    • Layer setting control component
    • Info badge component
  • Extends esaggs_fn to support the flag

    • Avoid to pass the filter to the handler if set
    • Add unit tests
  • Notification badges

    • Extends the badge component in Embeddable to support grouped messages
    • Added unit tests
Screenshot 2023-06-07 at 15 31 39 Screenshot 2023-06-07 at 15 30 57 Screenshot 2023-06-07 at 15 27 43
  • Add support for Open in Lens
    • Add unit tests for each converter
    • Functional tests

Checklist

Delete any items that are not applicable to this PR.

@dej611 dej611 added release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens v8.9.0 labels Jun 7, 2023
@@ -23,7 +23,7 @@ export function YesNo({
name,
value,
disabled,
'data-test-subj': dataTestSubj,
'data-test-subj': dataTestSubj = name,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to assign a default data-test-subj value to avoid having undefined-yes or undefined-no for all YesNo component on functional testing.
It should not affect existing tests as it only kicks in when the test id is not passed.

@dej611 dej611 marked this pull request as ready for review June 9, 2023 07:07
@dej611 dej611 requested review from a team as code owners June 9, 2023 07:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

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.

This works great Marco! Changes LGTM! I tested locally in Chrome with TSVB, TSVB with panel ignore, TSVB with layer ignore, annotations and all Lens scenarios and it works as expected!

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

Data Discovery changes LGTM 👍

<EuiFormRow
display="columnCompressedSwitch"
label={i18n.translate('xpack.lens.layerSettings.ignoreGlobalFilters', {
defaultMessage: 'Use global filters',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we already use "global filters" naming in Kibana? Maybe it would be less confusing to say something like "Use search bar filters".

Copy link
Contributor

Choose a reason for hiding this comment

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

We are using the same terminology in TSVB (it supports this feature for many versions) so we used the same term for the TSVB to Lens users to easily identify it.

@gchaps I don't know if you have any proposal here to improve the text. We can still merge I think and we can change the text in a followup PR is we decide in favor of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also the same terminology has been around in Lens for already few minor within the Annotation and Dashboard context.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 895 898 +3

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
lens 523 524 +1
visualizations 780 781 +1
total +2

Async chunks

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

id before after diff
lens 1.3MB 1.3MB +2.1KB
visTypeTimeseries 507.9KB 508.3KB +441.0B
total +2.5KB

Page load bundle

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

id before after diff
data 404.4KB 404.7KB +246.0B
visTypeGauge 12.3KB 12.4KB +46.0B
visTypeHeatmap 12.4KB 12.4KB +23.0B
visTypeMetric 11.0KB 11.0KB +23.0B
visTypePie 10.5KB 10.5KB +23.0B
visTypeTable 18.0KB 18.0KB +23.0B
visTypeXy 31.1KB 31.1KB +46.0B
total +430.0B
Unknown metric groups

API count

id before after diff
lens 618 619 +1
visualizations 810 811 +1
total +2

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 414 418 +4
visTypeTimeseries 19 22 +3
total +9

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 498 502 +4
visTypeTimeseries 22 25 +3
total +9

History

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

@dej611 dej611 merged commit e325d41 into elastic:main Jun 9, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 9, 2023
saarikabhasi pushed a commit to saarikabhasi/kibana that referenced this pull request Jun 14, 2023
…59248)

## Summary

Fixes elastic#143493

* Add the switch control in Layer Settings
  * [x] Make sure it does not duplicate on Annotation Layer Settings 
  * [x] Data Layers
  * [x] Reference line layers
  * [x] Extended dataView picker to support multiple icons
    * [x] Added unit tests 
  * [x] Functional tests

<img width="351" alt="Screenshot 2023-06-07 at 15 28 19"
src="https://github.com/elastic/kibana/assets/924948/00dc5523-0bec-4e9c-b1d0-4d36804b29f9">
<img width="340" alt="Screenshot 2023-06-07 at 15 31 31"
src="https://github.com/elastic/kibana/assets/924948/d36ca147-5d8c-4123-9be3-2932844cbd15">
<img width="331" alt="Screenshot 2023-06-07 at 15 28 25"
src="https://github.com/elastic/kibana/assets/924948/c7d4f166-b8ab-4439-a83c-debf82b913ad">
<img width="324" alt="Screenshot 2023-06-07 at 15 27 59"
src="https://github.com/elastic/kibana/assets/924948/3738a7e0-6e49-4e22-b857-965a953b4b84">
<img width="323" alt="Screenshot 2023-06-07 at 15 27 53"
src="https://github.com/elastic/kibana/assets/924948/5965bf1c-0e25-4c0e-b54f-fa315157fd44">


*  Create `IgnoreGlobalFilter` shared component folder
   * [x] Layer setting control component
   * [x] Info badge component
   
 * Extends `esaggs_fn` to support the flag
   * [x] Avoid to pass the filter to the handler if set
   * [x] Add unit tests

* Notification badges
* [x] Extends the badge component in Embeddable to support grouped
messages
    * [x] Added unit tests
  
<img width="750" alt="Screenshot 2023-06-07 at 15 31 39"
src="https://github.com/elastic/kibana/assets/924948/01bf8203-9133-4429-9b79-17ec67613c7e">
<img width="828" alt="Screenshot 2023-06-07 at 15 30 57"
src="https://github.com/elastic/kibana/assets/924948/9acb78f2-d061-4225-a4af-b3a66e7454fc">
<img width="756" alt="Screenshot 2023-06-07 at 15 27 43"
src="https://github.com/elastic/kibana/assets/924948/b9f79aed-7c02-4060-9c0f-61f438dc031d">


* Add support for Open in Lens
  * [x] Add unit tests for each converter
  * [x] Functional tests


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

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:skip This commit does not require backporting Feature:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Ignore global filters in data layers
6 participants