-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(admin): Send SQL queries from the UI to system tables #2311
Conversation
Adds UI components to send freeform SQL queries from the UI to any system table. Removes UI components related to the canned queries.
}).then((resp) => { | ||
if (resp.ok) { | ||
return resp.json(); | ||
} else { | ||
return resp.json().then(Promise.reject.bind(Promise)); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks terrible but it seems to work. Should probably all be rewritten as async/await
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to add some UI container for displaying errors in general, and then make HTTP request logic more generic so every API call writes to the same error div
or whatever.
This is perfectly good for what we already have, though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is intentionally free of UI elements - all of the methods here should just return or reject a promise. We can definitely add some system to display errors in a consistent manner across all pages but I don't know that it should be here. Currently this just uses window.alert to display the error message in as I didn't want to deal with styling + managing the state for those yet.
Codecov Report
@@ Coverage Diff @@
## master #2311 +/- ##
=======================================
Coverage 92.78% 92.78%
=======================================
Files 557 557
Lines 25600 25600
=======================================
Hits 23753 23753
Misses 1847 1847 Continue to review full report at Codecov.
|
value={value} | ||
onChange={(evt) => onChange(evt.target.value)} | ||
style={{ width: "100%", height: 100 }} | ||
placeholder={"Write your query here"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this placeholder could be a valid query? like the one in your screenshot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just going to merge this as-is. Let's build canned queries soon 🙂
Adds UI components to send freeform SQL queries from the UI to
any system table. Removes UI components related to the canned queries.
Looks like this now: