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] Refactor field select component as shared #134773

Merged
merged 11 commits into from
Jul 7, 2022

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Jun 20, 2022

Summary

This PR refactors the field select component into a shared component that can be used outside of the indexpattern datasource area. This is required for #129299 .

The component is an extra layer on top of EUI combobox with specific ES field knowledge + some extra truncation logic for longer names.

Screenshot 2022-06-20 at 19 25 24

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@dej611 dej611 added Team:Visualizations Visualization editors, elastic-charts and infrastructure release_note:skip Skip the PR/issue when compiling release notes Feature:Lens backport:skip This commit does not require backporting v8.4.0 labels Jun 24, 2022
@dej611 dej611 marked this pull request as ready for review June 24, 2022 14:27
@dej611 dej611 requested review from a team as code owners June 24, 2022 14:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

Left one comment for your review. Thanks!

Comment on lines 47 to 48
'lnFieldPicker__option--incompatible': !compatible,
'lnFieldPicker__option--nonExistant': !exists,
Copy link
Contributor

@MichaelMarcialis MichaelMarcialis Jun 24, 2022

Choose a reason for hiding this comment

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

Are these classes being applied in the appropriate circumstances? When running locally, I noticed that some items in the field selector weren't being given these classes and accompanying color styling that they would have been given previously.

For example, in the screenshot below, I'd expect @timestamp and agent.keyword fields to be given the incompatible treatment (as the "Median" function was selected).

image

@flash1293
Copy link
Contributor

Agree with Michael that it seems like there is some information missing in the field list - non-cpmpatible fields are not shown subdued

@dej611
Copy link
Contributor Author

dej611 commented Jul 6, 2022

The issue should be solved now: the typecast was covering the fact that fields were grouped, leading to the error.

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested and works as expected, LGTM

@dej611
Copy link
Contributor Author

dej611 commented Jul 6, 2022

@elasticmachine merge upstream

@dej611
Copy link
Contributor Author

dej611 commented Jul 7, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #36 / APM API tests basic apm_mappings_only_8.0.0 Top backend spans when data is loaded without a kuery or environment returns the correct spans for the requested spanName

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 923 930 +7

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.2MB 1.2MB +2.1KB

History

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

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

LGTM!

@dej611 dej611 merged commit 05b5c91 into elastic:main Jul 7, 2022
@alie223323
Copy link

Summary

This PR refactors the field select component into a shared component that can be used outside of the indexpattern datasource area. This is required for #129299 .

The component is an extra layer on top of EUI combobox with specific ES field knowledge + some extra truncation logic for longer names.

Screenshot 2022-06-20 at 19 25 24

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

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:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants