Skip to content

[Lens] Render newlines in data table#134441

Merged
flash1293 merged 6 commits intoelastic:mainfrom
flash1293:lens-table-newline
Jun 16, 2022
Merged

[Lens] Render newlines in data table#134441
flash1293 merged 6 commits intoelastic:mainfrom
flash1293:lens-table-newline

Conversation

@flash1293
Copy link
Copy Markdown
Contributor

@flash1293 flash1293 commented Jun 15, 2022

Fixes #76242

This PR sets white-space: pre; to the grid cell if row auto-height is used:

default
Screenshot 2022-06-15 at 12 45 45

Screenshot 2022-06-15 at 12 45 49

One thing to note - the newlines are not rendered for custom row height:
Screenshot 2022-06-15 at 12 45 54

If that turns out to be a common use case, we could add more granular control later on (e.g. on a per-column basis)

@flash1293 flash1293 added release_note:enhancement Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// Feature:Lens v8.4.0 labels Jun 15, 2022
@flash1293
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@flash1293
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@flash1293 flash1293 marked this pull request as ready for review June 15, 2022 13:52
@flash1293 flash1293 requested review from a team as code owners June 15, 2022 13:52
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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, @flash1293. Thanks!

Copy link
Copy Markdown
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

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

Other than comment from Michael, nothing else to add. Great PR 🙌🏼

dangerouslySetInnerHTML={{ __html: content }} // eslint-disable-line react/no-danger
data-test-subj="lnsTableCellContent"
className={`lnsTableCell--${currentAlignment}`}
className={classNames({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if we remove x-pack/plugins/lens/public/datatable_visualization/components/table_basic.scss in favor of using the emotion/css ?

I see we just need to set text-align, white-space and height styles

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I would like to split it out into a separate PR though - I will add it to our tech debt list

flash1293 and others added 2 commits June 16, 2022 14:01
@flash1293
Copy link
Copy Markdown
Contributor Author

@MichaelMarcialis adjusted, thanks!

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

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 +183.0B

History

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

Copy link
Copy Markdown
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 that change, @flash1293. LGTM!

@flash1293 flash1293 merged commit 3430163 into elastic:main Jun 16, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Jun 16, 2022
@flash1293 flash1293 changed the title [Lens] Render newlines in data [Lens] Render newlines in data table Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Lens release_note:enhancement Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kibana feature : Allow users to display a string with newlines inside the datatable

7 participants