Skip to content

Commit

Permalink
add icons and shortcuts for query submit and format
Browse files Browse the repository at this point in the history
  • Loading branch information
jadami10 committed Dec 22, 2024
1 parent 616d691 commit aaf6e38
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pinot-controller/src/main/resources/app/pages/Query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ const QueryPage = () => {
if (modifiedEnabled && event.keyCode == 191) {
handleComment(editor);
}
// Map (Cmd/Ctrl) + \ KeyPress to toggle formatting the query
if (modifiedEnabled && event.keyCode == 220) {
handleFormatSQL(editor.getValue());
}
}

const handleComment = (cm: NativeCodeMirror.Editor) => {
Expand Down Expand Up @@ -539,6 +543,7 @@ const QueryPage = () => {
variant="contained"
color="primary"
onClick={() => handleFormatSQL(inputQuery)}
endIcon={<span style={{fontSize: '0.8em', lineHeight: 1}}>{navigator.platform.includes('Mac') ? '⌘\\' : 'Ctrl+\\'}</span>}
>
Format SQL
</Button>
Expand All @@ -549,6 +554,7 @@ const QueryPage = () => {
variant="contained"
color="primary"
onClick={() => handleRunNow()}
endIcon={<span style={{fontSize: '0.8em', lineHeight: 1}}>{navigator.platform.includes('Mac') ? '⌘↵' : 'Ctrl+↵'}</span>}
>
Run Query
</Button>
Expand Down

0 comments on commit aaf6e38

Please sign in to comment.