File tree Expand file tree Collapse file tree 2 files changed +31
-18
lines changed
src/containers/Tenant/QueryEditor/QueryResult Expand file tree Collapse file tree 2 files changed +31
-18
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {PaneVisibilityToggleButtons} from '../../utils/paneVisibilityToggleHelpe
1414import QueryExecutionStatus from '../../../../components/QueryExecutionStatus/QueryExecutionStatus' ;
1515import EnableFullscreenButton from '../../../../components/EnableFullscreenButton/EnableFullscreenButton' ;
1616import ResultIssues from '../Issues/Issues' ;
17+ import { prepareQueryError } from '../../../../utils/query' ;
1718
1819const b = cn ( 'kv-query-result' ) ;
1920
@@ -94,24 +95,32 @@ function QueryResult(props) {
9495 } ;
9596
9697 const renderIssues = ( ) => {
97- const error = props . error ?. data ;
98-
99- const hasIssues = error ?. issues && Array . isArray ( error . issues ) ;
100-
101- return hasIssues ? (
102- < React . Fragment >
103- < ResultIssues data = { error } />
104- { isFullscreen && (
105- < Fullscreen >
106- < div className = { b ( 'result' , { fullscreen : true } ) } >
107- < ResultIssues data = { error } />
108- </ div >
109- </ Fullscreen >
110- ) }
111- </ React . Fragment >
112- ) : (
113- < span > { error ?. data ?? error } </ span >
114- ) ;
98+ const error = props . error ;
99+
100+ const hasIssues = error ?. data ?. issues && Array . isArray ( error . data . issues ) ;
101+
102+ if ( hasIssues ) {
103+ return (
104+ < React . Fragment >
105+ < ResultIssues data = { error . data } />
106+ { isFullscreen && (
107+ < Fullscreen >
108+ < div className = { b ( 'result' , { fullscreen : true } ) } >
109+ < ResultIssues data = { error . data } />
110+ </ div >
111+ </ Fullscreen >
112+ ) }
113+ </ React . Fragment >
114+ )
115+ }
116+
117+ if ( error ) {
118+ return (
119+ < div className = { b ( 'error' ) } >
120+ { prepareQueryError ( error ) }
121+ </ div >
122+ ) ;
123+ }
115124 } ;
116125
117126 return (
Original file line number Diff line number Diff line change 2020 }
2121 }
2222
23+ & __error {
24+ padding : 15px 10px ;
25+ }
26+
2327 & __controls {
2428 position : sticky ;
2529 z-index : 2 ;
You can’t perform that action at this time.
0 commit comments