You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2021/09/02 21:34:46 UTC

[pinot] branch master updated: showing tooltip in SQL Editor (#7387)

This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 27b4da7  showing tooltip in SQL Editor (#7387)
27b4da7 is described below

commit 27b4da7a8134a442466a42ea40d309036c6b7739
Author: Sanket Shah <sh...@users.noreply.github.com>
AuthorDate: Fri Sep 3 03:04:24 2021 +0530

    showing tooltip in SQL Editor (#7387)
---
 .../src/main/resources/app/components/TableToolbar.tsx   | 16 +++++++++++++---
 pinot-controller/src/main/resources/app/pages/Query.tsx  |  4 +++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/pinot-controller/src/main/resources/app/components/TableToolbar.tsx b/pinot-controller/src/main/resources/app/components/TableToolbar.tsx
index 9286b6b..6905bdb 100644
--- a/pinot-controller/src/main/resources/app/components/TableToolbar.tsx
+++ b/pinot-controller/src/main/resources/app/components/TableToolbar.tsx
@@ -18,18 +18,21 @@
  */
 
 import * as React from 'react';
-import { Typography, Toolbar } from '@material-ui/core';
+import { Typography, Toolbar, Tooltip } from '@material-ui/core';
 import {
   makeStyles
 } from '@material-ui/core/styles';
 import SearchBar from './SearchBar';
+import HelpOutlineIcon from '@material-ui/icons/HelpOutline';
 
 type Props = {
   name: string;
   showSearchBox: boolean;
   searchValue?: string;
   handleSearch?: Function;
-  recordCount?: number
+  recordCount?: number;
+  showTooltip?: boolean;
+  tooltipText?: string;
 };
 
 const useToolbarStyles = makeStyles((theme) => ({
@@ -53,7 +56,9 @@ export default function TableToolbar({
   showSearchBox,
   searchValue,
   handleSearch,
-  recordCount
+  recordCount,
+  showTooltip,
+  tooltipText
 }: Props) {
   const classes = useToolbarStyles();
 
@@ -71,6 +76,11 @@ export default function TableToolbar({
         value={searchValue}
         onChange={(e) => handleSearch(e.target.value)}
       /> : <strong>{(recordCount)}</strong>}
+      {showTooltip &&
+        <Tooltip title={tooltipText}>
+          <HelpOutlineIcon />
+        </Tooltip>
+      }
     </Toolbar>
   );
 }
\ No newline at end of file
diff --git a/pinot-controller/src/main/resources/app/pages/Query.tsx b/pinot-controller/src/main/resources/app/pages/Query.tsx
index a4366af..12dd8a1 100644
--- a/pinot-controller/src/main/resources/app/pages/Query.tsx
+++ b/pinot-controller/src/main/resources/app/pages/Query.tsx
@@ -318,6 +318,8 @@ const QueryPage = () => {
     return defaultHint;
   };
 
+  const sqlEditorTooltip = "This editor supports auto-completion feature. Type @ in the editor to see the list of SQL keywords, functions, table name and column names."
+
   return fetching ? (
     <AppLoader />
   ) : (
@@ -344,7 +346,7 @@ const QueryPage = () => {
         <Grid container>
           <Grid item xs={12} className={classes.rightPanel}>
             <div className={classes.sqlDiv}>
-              <TableToolbar name="SQL Editor" showSearchBox={false} />
+              <TableToolbar name="SQL Editor" showSearchBox={false} showTooltip={true} tooltipText={sqlEditorTooltip} />
               <CodeMirror
                 options={{
                   ...sqloptions,

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org