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

fix: added new "preformatted" transform option to properly display newlines in query results #1324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jij1949
Copy link
Contributor

@jij1949 jij1949 commented Sep 14, 2023

This also includes a new "multiline" column type which is assigned when a string contains newlines (\n). The initial use case for this feature was to be able to display the results of a "show create view" or "show create table" query properly without expanding the query results.

Screenshot 2023-09-14 at 11 03 44 AM

Before:
Screenshot 2023-09-15 at 11 27 09 AM

After:
Screenshot 2023-09-15 at 11 27 18 AM

"preformatted" CSS:
https://github.com/pinterest/querybook/blob/master/querybook/webapp/stylesheets/_utilities.scss

It does the same thing as expanding the cell, but it does it automatically for results with newlines without requiring the user to select the option

… lines (pinterest#157)

* fix: added new transform format list to display show create results properly

* fix: remove pre component and add new column type multiline

* fix: changed transformer name to preformatted

Co-authored-by: jvalvo <[email protected]>
priority: 0,
auto: true,
transform: (v: string): React.ReactNode => (
<div className={'preformatted'}>{v}</div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there associated css with preformatted?

also can you include a screenshot of what is before vs after?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the PR with this information. Thank you!

@jczhong84
Copy link
Collaborator

lgtm. @czgu do you have any other concerns?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants