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

Make (empty) value subdued #103833

Merged
merged 4 commits into from
Jul 1, 2021

Conversation

timroes
Copy link
Contributor

@timroes timroes commented Jun 30, 2021

Summary

Fixes #103802

This makes the new (empty) value of the string field formatter use the subdued text color (in contexts where it renders as HTML, i.e. Discover, table visualizations).

Note: when searching for a value (i.e. a highlight appears) the formatting won't happen (as you might figure out in the code). This behavior was already present before this PR with the pure text converter, and I opened #103854 to discuss and track that.

screenshot-20210630-091025

screenshot-20210630-090554

@timroes timroes added v8.0.0 Team:AppServices release_note:skip Skip the PR/issue when compiling release notes Feature:FieldFormatters v7.14.0 auto-backport Deprecated - use backport:version if exact versions are needed v7.15.0 labels Jun 30, 2021
@timroes timroes requested a review from flash1293 June 30, 2021 07:12
@timroes timroes requested review from a team as code owners June 30, 2021 07:12
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

import { shortenDottedString } from '../../utils';

export const emptyLabel = i18n.translate('data.fieldFormats.string.emptyLabel', {
const emptyLabel = i18n.translate('data.fieldFormats.string.emptyLabel', {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Removed the export, since we're not using this outside this file.

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 LGTM. It even works in the Lens data table!
Screenshot 2021-06-30 at 09 29 40

Found a related bug in Lens xy chart, I'm going to open a new issue for this

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

@timroes tested locally and this looks good!

What do you think about adding test cases for string.convert(value, 'html'... to string.test.ts too?

[EDIT]
For the empty val and non empty val cases

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
data 573 588 +15

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
data 3268 3271 +3

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
data 107 108 +1

Page load bundle

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

id before after diff
data 834.1KB 838.4KB +4.3KB
Unknown metric groups

API count

id before after diff
data 3833 3836 +3

History

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

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

LGTM in Discover

Bildschirmfoto 2021-06-30 um 18 41 57

Bildschirmfoto 2021-06-30 um 18 41 35

Copy link
Contributor

@jloleysens jloleysens 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 adding those test cases!

Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

LGTM

@timroes timroes merged commit a3c079b into elastic:master Jul 1, 2021
@timroes timroes deleted the field-formatter/subdued-empty branch July 1, 2021 07:26
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 1, 2021
* Make empty value subdued

* Fix highlighting in values

* Fix test failures

* Add unit tests
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 1, 2021
* Make empty value subdued

* Fix highlighting in values

* Fix test failures

* Add unit tests
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.14
7.x

The backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jul 1, 2021
* Make empty value subdued

* Fix highlighting in values

* Fix test failures

* Add unit tests

Co-authored-by: Tim Roes <tim.roes@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 1, 2021
* Make empty value subdued

* Fix highlighting in values

* Fix test failures

* Add unit tests

Co-authored-by: Tim Roes <tim.roes@elastic.co>
madirey pushed a commit to madirey/kibana that referenced this pull request Jul 6, 2021
* Make empty value subdued

* Fix highlighting in values

* Fix test failures

* Add unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:FieldFormatters release_note:skip Skip the PR/issue when compiling release notes v7.14.0 v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discover] A lighter shade of pale gray
7 participants