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

Refactor useQueryExecution & add inline query execution status #4584

Merged
merged 30 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
33a37d4
QueryResult: added support for getting status updates using a callbac…
arikfr Jan 23, 2020
8e52b28
Refactor useQueryExecution.
arikfr Jan 23, 2020
52ebb76
useQueryExecution: only consider last triggered execution
gabrieldutra Feb 3, 2020
8d8b1c3
Fix execution triggered on every query update
gabrieldutra Feb 3, 2020
63c34f4
Add loadedInitialResults and fix loading results issues
gabrieldutra Feb 3, 2020
d16494b
Only show Add Vis button when results are done
gabrieldutra Feb 4, 2020
2f45fc5
Merge branch 'query-view' into refactor-execution
gabrieldutra Feb 4, 2020
c8b916c
Don't show notification on first results load
gabrieldutra Feb 4, 2020
3ae2f74
Remove unnecessary useEffect
gabrieldutra Feb 4, 2020
5364594
Add margin between text and cancel button
gabrieldutra Feb 5, 2020
e7ca220
Add Refresh button to QuerySource
gabrieldutra Feb 5, 2020
288f84d
Update ExecutionStatus positioning
gabrieldutra Feb 6, 2020
2e7bf11
Mobile updates
gabrieldutra Feb 6, 2020
bf352c8
Add more spacing for execution status in mobile
gabrieldutra Feb 7, 2020
d1ef80a
Merge branch 'query-view' into refactor-execution
gabrieldutra Feb 9, 2020
5ce6479
Add spacing between results wrapper and resizer
gabrieldutra Feb 11, 2020
3ec47e5
Align Query description
gabrieldutra Feb 11, 2020
0f4d66f
Hide Add Description/tag on mobile
gabrieldutra Feb 11, 2020
1fd396b
Allow different messages for no results/empty set
gabrieldutra Feb 11, 2020
278de51
Don't show empty state when opening new query page
gabrieldutra Feb 11, 2020
c6312b3
Add min-width to ExecutionStatus
gabrieldutra Feb 11, 2020
ed37620
Improve ExecutionStatus spacing
gabrieldutra Feb 11, 2020
f0338ce
Use same execution information for view/edit
gabrieldutra Feb 11, 2020
3c981c7
Use autoFocus in EditInPlace for focus
gabrieldutra Feb 13, 2020
cff0163
Control visualization row emptyState from Renderer
gabrieldutra Feb 13, 2020
cf56791
Fix broken Filters on Visualization Renderer
gabrieldutra Feb 14, 2020
50710b2
Don't handle empty state based on context
gabrieldutra Feb 17, 2020
4041f83
Add Data Source label to data source.
arikfr Feb 19, 2020
e526173
Reuse useFullscreenHandler in QueryView page.
arikfr Feb 19, 2020
75820d8
(style fix)
arikfr Feb 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions client/app/assets/less/redash/query.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,6 @@ body.fixed-layout {
}
}

.bottom-controller {
padding: 10px 15px;
background: #fff;
display: flex;
align-items: center;

button,
div,
span {
position: relative;
}

div:last-child {
flex-grow: 1;
text-align: right;
}

&:before {
content: "";
height: 50px;
position: fixed;
bottom: 0;
width: 100%;
pointer-events: none;
left: 0;
}
}

.p-b-60 {
padding-bottom: 60px !important;
}
Expand Down
7 changes: 1 addition & 6 deletions client/app/components/EditInPlace.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,9 @@ export default class EditInPlace extends React.Component {
this.state = {
editing: props.defaultEditing,
};
this.inputRef = React.createRef();
}

componentDidUpdate(_, prevState) {
if (this.state.editing && !prevState.editing) {
this.inputRef.current.focus();
}

if (!this.state.editing && prevState.editing) {
this.props.onStopEditing();
}
Expand Down Expand Up @@ -90,10 +85,10 @@ export default class EditInPlace extends React.Component {
const InputComponent = multiline ? Input.TextArea : Input;
return (
<InputComponent
ref={this.inputRef}
defaultValue={value}
onBlur={e => this.stopEditing(e.target.value)}
onKeyDown={this.handleKeyDown}
autoFocus
{...editorProps}
/>
);
Expand Down
5 changes: 4 additions & 1 deletion client/app/components/tags-control/TagsControl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export class TagsControl extends React.Component {
renderEditButton() {
const tags = map(this.props.tags, trim);
return (
<a className="label label-tag" role="none" onClick={() => this.editTags(tags, this.props.getAvailableTags)}>
<a
className="label label-tag hidden-xs"
role="none"
onClick={() => this.editTags(tags, this.props.getAvailableTags)}>
{tags.length === 0 && (
<React.Fragment>
<i className="zmdi zmdi-plus m-r-5" />
Expand Down
16 changes: 16 additions & 0 deletions client/app/lib/getQueryResultData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { get, invoke } from "lodash";

export default function getQueryResultData(queryResult) {
return {
status: invoke(queryResult, "getStatus") || null,
columns: invoke(queryResult, "getColumns") || [],
rows: invoke(queryResult, "getData") || [],
filters: invoke(queryResult, "getFilters") || [],
updatedAt: invoke(queryResult, "getUpdatedAt") || null,
retrievedAt: get(queryResult, "query_result.retrieved_at", null),
log: invoke(queryResult, "getLog") || [],
error: invoke(queryResult, "getError") || null,
runtime: invoke(queryResult, "getRuntime") || null,
metadata: get(queryResult, "query_result.data.metadata", {}),
};
}
66 changes: 0 additions & 66 deletions client/app/lib/hooks/useQueryResult.js

This file was deleted.

2 changes: 1 addition & 1 deletion client/app/pages/dashboards/hooks/useDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TextboxDialog from "@/components/dashboards/TextboxDialog";
import PermissionsEditorDialog from "@/components/PermissionsEditorDialog";
import { editableMappingsToParameterMappings, synchronizeWidgetTitles } from "@/components/ParameterMappingInput";
import ShareDashboardDialog from "../components/ShareDashboardDialog";
import useFullscreenHandler from "./useFullscreenHandler";
import useFullscreenHandler from "../../../lib/hooks/useFullscreenHandler";
import useRefreshRateHandler from "./useRefreshRateHandler";
import useEditModeHandler from "./useEditModeHandler";

Expand Down
Loading