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

feature: Query Editor #713

Merged
merged 4 commits into from
Aug 5, 2020
Merged

feature: Query Editor #713

merged 4 commits into from
Aug 5, 2020

Conversation

breezewish
Copy link
Member

This PR impls a new feature Query Editor, as below:

image

image

Signed-off-by: Breezewish <me@breeswish.org>
Signed-off-by: Breezewish <me@breeswish.org>
}
setRunning(false)
editor.current?.editor.focus()
}, [])
Copy link
Collaborator

@baurine baurine Aug 3, 2020

Choose a reason for hiding this comment

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

Not sure whether we can use useClientRequest() to simplify the code like this:

const {data, isLoading, error, sendRequest: handleRun} = useClientRequest((cancelToken) => 
    client.getInstance().queryEditorRun({
        max_rows: MAX_DISPLAY_ROWS,
        statements: editor.current?.editor.getValue(),
    }, {cancelToken}), 
    { immediate: false, afterRequest: () => editor.current?.editor.focus() }
)

Then we don't need results and isRunning anymore.

For error, we can show an ErrorBar component instead of Modal.error().

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let me try it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unlike queries, for operational errors mostly there will be a modal dialog to stop further user actions. Displaying modal dialog using this pattern can be pretty hard.

Copy link
Collaborator

@baurine baurine left a comment

Choose a reason for hiding this comment

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

the rest LGTM!

@breezewish breezewish merged commit 2a372d4 into master Aug 5, 2020
@breezewish breezewish deleted the query-editor branch August 5, 2020 05:24
breezewish added a commit that referenced this pull request Sep 8, 2020
Signed-off-by: Breezewish <me@breeswish.org>
(cherry picked from commit 2a372d4)
breezewish added a commit that referenced this pull request Sep 8, 2020
* feature: Query Editor (#713)
* Backend: replace UNIX_TIMESTAMP with FROM_UNIXTIME in statement query (#731)
* test: Stablize e2e tests (#732)
* ui: Add store location tree (#728)
* log_search: Display instance port (#722)
* ui: show store location topology (#719)
* ui: Online Config (#733)
* ui: Support sharing session (#741)
* doc: Update to sig-diagnosis (#742)
* statement: Display number of plans in the list (#746)
* log search: return zip instead of tar or gzip (#724)
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