Skip to content

Commit d214eee

Browse files
Raubzeugtsufiev
authored andcommitted
fix: query status should not be shown when query is loading
1 parent 3f487ff commit d214eee

File tree

4 files changed

+29
-30
lines changed

4 files changed

+29
-30
lines changed

src/containers/Tenant/QueryEditor/QueryEditor.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function QueryEditor(props) {
154154
useEffect(() => {
155155
const {monacoHotKey, setMonacoHotKey} = props;
156156
if (monacoHotKey === null) {
157-
return
157+
return;
158158
}
159159
setMonacoHotKey(null);
160160
switch (monacoHotKey) {
@@ -464,19 +464,12 @@ function QueryEditor(props) {
464464
};
465465

466466
const getExecuteResult = () => {
467-
const {
468-
data = [],
469-
error,
470-
loading,
471-
history: {queries},
472-
} = props.executeQuery;
467+
const {data = [], error} = props.executeQuery;
473468

474469
if (error) {
475470
return error.data || error;
476471
} else if (data.length > 0) {
477472
return data;
478-
} else if (!loading && queries.length) {
479-
return 'The request was successful';
480473
} else {
481474
return '';
482475
}

src/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -252,28 +252,32 @@ function QueryExplain(props) {
252252
return (
253253
<React.Fragment>
254254
<div className={b('controls')}>
255-
<div className={b('controls-right')}>
256-
<QueryExecutionStatus hasError={Boolean(props.error)} />
257-
{!props.error && (
258-
<React.Fragment>
259-
<Divider />
260-
<RadioButton
261-
options={explainOptions}
262-
value={activeOption}
263-
onUpdate={onSelectOption}
255+
{!props.loading && (
256+
<React.Fragment>
257+
<div className={b('controls-right')}>
258+
<QueryExecutionStatus hasError={Boolean(props.error)} />
259+
{!props.error && (
260+
<React.Fragment>
261+
<Divider />
262+
<RadioButton
263+
options={explainOptions}
264+
value={activeOption}
265+
onUpdate={onSelectOption}
266+
/>
267+
</React.Fragment>
268+
)}
269+
</div>
270+
<div className={b('controls-left')}>
271+
<EnableFullscreenButton disabled={Boolean(props.error)} />
272+
<PaneVisibilityToggleButtons
273+
onCollapse={props.onCollapseResults}
274+
onExpand={props.onExpandResults}
275+
isCollapsed={props.isResultsCollapsed}
276+
initialDirection="bottom"
264277
/>
265-
</React.Fragment>
266-
)}
267-
</div>
268-
<div className={b('controls-left')}>
269-
<EnableFullscreenButton disabled={Boolean(props.error)} />
270-
<PaneVisibilityToggleButtons
271-
onCollapse={props.onCollapseResults}
272-
onExpand={props.onExpandResults}
273-
isCollapsed={props.isResultsCollapsed}
274-
initialDirection="bottom"
275-
/>
276-
</div>
278+
</div>
279+
</React.Fragment>
280+
)}
277281
</div>
278282
<div className={b('result')}>{renderContent()}</div>
279283
</React.Fragment>

src/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
justify-content: space-between;
2020
align-items: center;
2121

22+
height: 53px;
2223
padding: 12px 20px;
2324

2425
border-bottom: 1px solid var(--yc-color-line-generic);

src/containers/Tenant/QueryEditor/QueryResult/QueryResult.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
justify-content: space-between;
2929
align-items: center;
3030

31+
height: 53px;
3132
padding: 12px 20px;
3233

3334
border-bottom: 1px solid var(--yc-color-line-generic);

0 commit comments

Comments
 (0)