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] Enhance visualization modifier popup with layer palette #155280

Merged
merged 14 commits into from
Apr 26, 2023

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Apr 19, 2023

Summary

Fix #154349

This PR introduces some chart info API enhancements, used within the visualization modifier popup in a embeddable context.

Screenshot 2023-04-19 at 15 56 01

For the specific scenario with a table with multiple color by value columns, the palette is omitted:

Screenshot 2023-04-19 at 16 14 22

Sampling dashboard with many combinations:
sampling_testing_dashboard.ndjson.txt

Additional fixes:

  • 💄 Fixes bottom padding in case of single layer info in the popup

Before:
Screenshot 2023-04-19 at 15 53 07 copy

  • 💄 Fixes some styling issues of the visualization modifier icon with some visualization types (treemaps, metrics, tables)

Before:
Screenshot 2023-04-19 at 15 53 31
Screenshot 2023-04-19 at 15 53 17
Screenshot 2023-04-19 at 15 53 07
Screenshot 2023-04-19 at 15 53 00
Screenshot 2023-04-19 at 15 52 44
Screenshot 2023-04-19 at 15 52 38

After:
Screenshot 2023-04-19 at 15 55 22
Screenshot 2023-04-19 at 15 55 52
Screenshot 2023-04-19 at 15 55 45
Screenshot 2023-04-19 at 15 55 38
Screenshot 2023-04-19 at 15 55 31

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 v8.8.0 labels Apr 19, 2023
@dej611 dej611 marked this pull request as ready for review April 19, 2023 15:52
@dej611 dej611 requested review from a team as code owners April 19, 2023 15:52
@elasticmachine
Copy link
Contributor

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

@stratoula stratoula changed the title [Lens] Enhenace visualization modifier popup with layer palette [Lens] Enhance visualization modifier popup with layer palette Apr 20, 2023
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 looks fantastic! Changes LGTM!

@drewdaemon
Copy link
Contributor

🤩

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.

Thanks for putting this together, @dej611. It looks wonderful. Leaving you a few small comments below for your initial review.

  • Why did we change the previous popover header from Layers with reduced sampling to Sampling probability by layer? The reason I ask is because that sounds like an odd title for an area that only shows layers with reduced sampling (i.e. we don't show all layers, namely those with 100% sampling). Should we change it back?

  • Would it be possible to apply a minimum width of 280px on the modifiers popover?

@stratoula
Copy link
Contributor

stratoula commented Apr 20, 2023

Why did we change the previous popover header from Layers with reduced sampling to Sampling probability by layer? The reason I ask is because that sounds like an odd title for an area that only shows layers with reduced sampling (i.e. we don't show all layers, namely those with 100% sampling). Should we change it back?

@MichaelMarcialis I changed that after Sophie's request. As she said

Another thing that jumped out, is that the label "Layers with reduced sampling" is syntactically incorrect. It means that the sampling is reduced, rather than data is sampled. 

The title was a proposal from her.

@dej611
Copy link
Contributor Author

dej611 commented Apr 21, 2023

Refactored info badge component into a shared component and added unit test for the shared codebase.

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.

Thanks for making those changes, @dej611! This looks great. The only previously mentioned item remaining was setting a minimum width on the modifier popover of 280px. Would it be possible to address that?

Otherwise, aside from my small comments below, this looks good-to-go. Approving now so I don't hold you up.

Comment on lines 67 to 69
css={css`
padding-right: 0;
`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this doing anything? If not, it can be removed.

Suggested change
css={css`
padding-right: 0;
`}

}
return (
<>
{index ? <EuiHorizontalRule margin="s" /> : null}
Copy link
Contributor

Choose a reason for hiding this comment

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

May be better to set this to no margin to simplify your aside padding.

Suggested change
{index ? <EuiHorizontalRule margin="s" /> : null}
{index ? <EuiHorizontalRule margin="none" /> : null}

Comment on lines 85 to 86
padding: ${!isFirstItem ? 0 : euiTheme.size.base} ${euiTheme.size.base}
${bottomPadding};
Copy link
Contributor

Choose a reason for hiding this comment

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

With the removal of the horizontal rule margin in the previous comment, you can simplify these styles.

Suggested change
padding: ${!isFirstItem ? 0 : euiTheme.size.base} ${euiTheme.size.base}
${bottomPadding};
padding: ${euiTheme.size.base};

Comment on lines 47 to 64
<EuiFlexGroup justifyContent={hasColor ? 'center' : 'spaceBetween'} gutterSize="s">
{hasColor ? (
<EuiFlexItem grow={false}>
<EuiIcon
color={hasSingleColor ? palette[0] : undefined}
type={iconType}
css={css`
margin-top: ${euiTheme.size.xxs};
`}
data-test-subj={`${dataTestSubjPrefix}-${index}-icon`}
/>
</EuiFlexItem>
) : null}
<EuiFlexItem grow={Boolean(palette)}>
<EuiText size="s" data-test-subj={`${dataTestSubjPrefix}-${index}-title`}>
{title}
</EuiText>
</EuiFlexItem>
Copy link
Contributor

Choose a reason for hiding this comment

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

With your latest markup refactoring, I'd suggest the following changes for simplicity:

Suggested change
<EuiFlexGroup justifyContent={hasColor ? 'center' : 'spaceBetween'} gutterSize="s">
{hasColor ? (
<EuiFlexItem grow={false}>
<EuiIcon
color={hasSingleColor ? palette[0] : undefined}
type={iconType}
css={css`
margin-top: ${euiTheme.size.xxs};
`}
data-test-subj={`${dataTestSubjPrefix}-${index}-icon`}
/>
</EuiFlexItem>
) : null}
<EuiFlexItem grow={Boolean(palette)}>
<EuiText size="s" data-test-subj={`${dataTestSubjPrefix}-${index}-title`}>
{title}
</EuiText>
</EuiFlexItem>
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
{hasColor ? (
<EuiFlexItem grow={false}>
<EuiIcon
color={hasSingleColor ? palette[0] : undefined}
type={iconType}
data-test-subj={`${dataTestSubjPrefix}-${index}-icon`}
/>
</EuiFlexItem>
) : null}
<EuiFlexItem>
<EuiText size="s" data-test-subj={`${dataTestSubjPrefix}-${index}-title`}>
{title}
</EuiText>
</EuiFlexItem>

Comment on lines 75 to 103
<EuiFlexGroup
justifyContent={'center'}
gutterSize="s"
css={css`
margin-top: ${euiTheme.size.xs};
overflow-y: hidden;
`}
>
<EuiFlexItem
grow={false}
css={css`
height: ${euiTheme.size.xs};
`}
>
<EuiIcon type="empty" />
</EuiFlexItem>
<EuiFlexItem
grow={Boolean(palette)}
css={css`
height: ${euiTheme.size.xs};
`}
>
<EuiColorPaletteDisplay
size="xs"
palette={palette}
data-test-subj={`${dataTestSubjPrefix}-${index}-palette`}
/>
</EuiFlexItem>
</EuiFlexGroup>
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than using an EuiFlexGroup with one of the two EuiFlexItem children housing an empty icon, would it be simpler to just house the EuiColorPaletteDisplay in a div element with some left padding for alignment?

@KOTungseth KOTungseth mentioned this pull request Apr 25, 2023
19 tasks
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 910 912 +2

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 514 515 +1

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 +4.0KB

Page load bundle

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

id before after diff
expressionGauge 14.6KB 14.5KB -30.0B
Unknown metric groups

API count

id before after diff
lens 610 611 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 17 19 +2
securitySolution 399 402 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 18 20 +2
securitySolution 479 482 +3
total +5

History

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

@dej611 dej611 merged commit d8a1706 into elastic:main Apr 26, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 26, 2023
jloleysens added a commit to jloleysens/kibana that referenced this pull request Apr 26, 2023
* main: (1294 commits)
  [SecuritySolution] Refactor security packages (elastic#155365)
  [Discover] Show "Temporary" badge for ad-hoc data views in Alerts flyout (elastic#155717)
  [RAM] Conditional actions feedback on pr review (elastic#155804)
  [Files] Adds bulk delete method (elastic#155628)
  [Lens] Use proper way to generate absolute short URL (elastic#155512)
  [Guided onboarding] Use Kibana features to grant access (elastic#155065)
  [Index Management] Fix duped mock (elastic#155844)
  [Lens] Enhance visualization modifier popup with layer palette (elastic#155280)
  Fix flaky combobox tests on role management screen (elastic#155711)
  [Infrastructure UI] Create InventoryViewsService and InventoryViewsClient (elastic#155126)
  [Fleet] always create agent upload write indices (elastic#155729)
  [Fleet] [Cloud Security Posture] Add CloudFormation agent install method (elastic#155045)
  Add tech preview label for search applications (elastic#155649)
  [ML] AIOps: Stabilize flaky functional tests. (elastic#155710)
  [ES UI Shared] Migrate JsonEditor to monaco (elastic#155610)
  [Security Solution] Fixes security_solution storybooks always rendering in a flyout (elastic#155814)
  [Synthetics] Make error popover disappear `onMouseLeave` of metric item card (elastic#155800)
  Remove Exploratory View components from Observability (elastic#155629)
  [Discover] Remove redundant "Filter was added" toast (elastic#155645)
  [RAM][Security Solution][Alerts] Support the ability to trigger a rule action per alert generated (elastic#153611) (elastic#155384)
  ...
KOTungseth added a commit that referenced this pull request May 23, 2023
## Summary

Adds the 8.8 documentation for the following:

- Enable report sharing: #153429
Docs preview:
https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html

- Random sampling feature: #143221
Docs preview:
https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time

- Improve Ignore global filters UI:
#154441 and
#155280
Docs preview:
https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations

---------

Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 23, 2023
## Summary

Adds the 8.8 documentation for the following:

- Enable report sharing: elastic#153429
Docs preview:
https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html

- Random sampling feature: elastic#143221
Docs preview:
https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time

- Improve Ignore global filters UI:
elastic#154441 and
elastic#155280
Docs preview:
https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations

---------

Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
(cherry picked from commit 06a800f)
kibanamachine added a commit that referenced this pull request May 23, 2023
# Backport

This will backport the following commits from `main` to `8.8`:
- [[DOCS] Adds 8.8 Viz docs
(#157215)](#157215)

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

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

<!--BACKPORT [{"author":{"name":"Kaarina
Tungseth","email":"kaarina.tungseth@elastic.co"},"sourceCommit":{"committedDate":"2023-05-23T15:41:42Z","message":"[DOCS]
Adds 8.8 Viz docs (#157215)\n\n## Summary\r\n\r\nAdds the 8.8
documentation for the following:\r\n\r\n- Enable report sharing:
https://github.com/elastic/kibana/pull/153429\r\nDocs
preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html\r\n\r\n-
Random sampling feature:
https://github.com/elastic/kibana/pull/143221\r\nDocs
preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time\r\n\r\n-
Improve Ignore global filters
UI:\r\nhttps://github.com//pull/154441
and\r\nhttps://github.com//pull/155280\r\nDocs
preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations\r\n\r\n---------\r\n\r\nCo-authored-by:
Tim Sullivan
<tsullivan@users.noreply.github.com>","sha":"06a800fbad1f2a8fd9146bfe0c439e2107f771fc","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","Team:SharedUX","v8.8.0","v8.9.0"],"number":157215,"url":"https://github.com/elastic/kibana/pull/157215","mergeCommit":{"message":"[DOCS]
Adds 8.8 Viz docs (#157215)\n\n## Summary\r\n\r\nAdds the 8.8
documentation for the following:\r\n\r\n- Enable report sharing:
https://github.com/elastic/kibana/pull/153429\r\nDocs
preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html\r\n\r\n-
Random sampling feature:
https://github.com/elastic/kibana/pull/143221\r\nDocs
preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time\r\n\r\n-
Improve Ignore global filters
UI:\r\nhttps://github.com//pull/154441
and\r\nhttps://github.com//pull/155280\r\nDocs
preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations\r\n\r\n---------\r\n\r\nCo-authored-by:
Tim Sullivan
<tsullivan@users.noreply.github.com>","sha":"06a800fbad1f2a8fd9146bfe0c439e2107f771fc"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157215","number":157215,"mergeCommit":{"message":"[DOCS]
Adds 8.8 Viz docs (#157215)\n\n## Summary\r\n\r\nAdds the 8.8
documentation for the following:\r\n\r\n- Enable report sharing:
https://github.com/elastic/kibana/pull/153429\r\nDocs
preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html\r\n\r\n-
Random sampling feature:
https://github.com/elastic/kibana/pull/143221\r\nDocs
preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time\r\n\r\n-
Improve Ignore global filters
UI:\r\nhttps://github.com//pull/154441
and\r\nhttps://github.com//pull/155280\r\nDocs
preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations\r\n\r\n---------\r\n\r\nCo-authored-by:
Tim Sullivan
<tsullivan@users.noreply.github.com>","sha":"06a800fbad1f2a8fd9146bfe0c439e2107f771fc"}}]}]
BACKPORT-->

Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
delanni pushed a commit to delanni/kibana that referenced this pull request May 25, 2023
## Summary

Adds the 8.8 documentation for the following:

- Enable report sharing: elastic#153429
Docs preview:
https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html

- Random sampling feature: elastic#143221
Docs preview:
https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time

- Improve Ignore global filters UI:
elastic#154441 and
elastic#155280
Docs preview:
https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations

---------

Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
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.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Enhance layer presentation on Visualization modifiers popup
7 participants