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

Create a single-page application for Query Viewer #22621

Merged
merged 1 commit into from Apr 29, 2024

Conversation

yhwang
Copy link
Member

@yhwang yhwang commented Apr 26, 2024

Description

Add another webpack config to generate a single-page application for the Query Viewer and related artifacts, including:

  • a template file for the single-page application
  • a bootstrap CSS using external links for the fonts

Motivation and Context

The Query Viewer page doesn't rely on any Presto server API and can be used independently. It would be good to
convert it into a single-page application and users can use it locally.

Impact

None. A new single-page HTML file is created and no change to existing pages/services.

Test Plan

Run the yarn command to generate the HTML file, open it, and load JSON file to check the query details.

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

Add another webpack config to generate a single-page application
for the `Query Viewer` and related artifacts, including:
- a template file for the single-page application
- a bootstrap css using external links for the fonts

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
@yhwang yhwang requested review from steveburnett and a team as code owners April 26, 2024 23:00
@yhwang yhwang requested a review from presto-oss April 26, 2024 23:00
@yhwang
Copy link
Member Author

yhwang commented Apr 26, 2024

Some explanations about the changes:

  • templates/query_viewer.html: I modified the original query_viewer.html to use CDN links for the JS/CSS libraries we need. So I don't have to embed the JS/CSS files into the output HTML page which reduces the final file size.
  • a new bootstrap.css: it comes from the existing bootstrap.css but uses external links for the fonts. Otherwise, I can't pack the font files into the HTML.
  • new webpack config file: it is used to generate the single page file.

And I didn't include the final HTML file in this PR. Users need to run the yarn spa command to generate the file manually.

@yhwang
Copy link
Member Author

yhwang commented Apr 26, 2024

cc @aaneja @majetideepak

@tdcmeehan tdcmeehan requested a review from alonsovb April 26, 2024 23:50
Copy link

@alonsovb alonsovb left a comment

Choose a reason for hiding this comment

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

code looks good!

@tdcmeehan tdcmeehan merged commit 6b43924 into prestodb:master Apr 29, 2024
56 checks passed
@yhwang yhwang deleted the single-page-app branch April 29, 2024 19:40
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.

None yet

3 participants