Skip to content

Commit 260b788

Browse files
authored
feat: moving the errors up a bit (#5172)
1 parent 1cf5eec commit 260b788

File tree

4 files changed

+33
-9
lines changed

4 files changed

+33
-9
lines changed

src/dataExplorer/components/QueryTime.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,4 @@
2727
background: $c-rainforest;
2828
}
2929
}
30-
31-
pre {
32-
color: $c-fire;
33-
font-family: $cf-code-font;
34-
margin: $cf-space-2xs;
35-
}
3630
}

src/dataExplorer/components/QueryTime.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const humanReadable = (time: number): string => {
99
}
1010

1111
const QueryTime: FC = () => {
12-
const {result, status, time} = useContext(ResultsContext)
12+
const {status, time} = useContext(ResultsContext)
1313

1414
if (status === RemoteDataState.Done) {
1515
return (
@@ -42,7 +42,6 @@ const QueryTime: FC = () => {
4242
<div className="query-status">
4343
<div className="status error" />
4444
<label>Error ({humanReadable(time)})</label>
45-
<pre>{result.error}</pre>
4645
</div>
4746
)
4847
}

src/dataExplorer/components/Results.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,30 @@ $cf-radius-lg: $cf-radius + 4px;
5151
position: absolute;
5252
width: 100%;
5353
height: 100%;
54+
55+
.monaco-editor,
56+
.monaco-editor > div:first-of-type {
57+
border-radius: $cf-radius-lg;
58+
}
59+
}
60+
61+
.data-explorer--error-gutter {
62+
color: $c-fire;
63+
background-color: $cf-grey-15;
64+
border-radius: $cf-radius-lg;
65+
width: 100%;
66+
display: flex;
67+
68+
.cf-icon {
69+
padding: $cf-space-2xs $cf-space-s;
70+
font-size: $cf-text-base-2;
71+
}
72+
73+
pre {
74+
padding: $cf-space-2xs 0;
75+
font-family: $cf-code-font;
76+
white-space: pre-line;
77+
}
5478
}
5579

5680
.query-stat {

src/dataExplorer/components/ResultsPane.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
FlexDirection,
1515
JustifyContent,
1616
AlignItems,
17+
Icon,
1718
} from '@influxdata/clockface'
1819

1920
// Contexts
@@ -80,7 +81,7 @@ const rangeToParam = (timeRange: TimeRange) => {
8081

8182
const ResultsPane: FC = () => {
8283
const {basic, query, cancel} = useContext(QueryContext)
83-
const {status, setStatus, setResult} = useContext(ResultsContext)
84+
const {status, result, setStatus, setResult} = useContext(ResultsContext)
8485

8586
const [
8687
horizDragPosition,
@@ -168,6 +169,12 @@ const ResultsPane: FC = () => {
168169
</Suspense>
169170
</div>
170171
</div>
172+
{status === RemoteDataState.Error && (
173+
<div className="data-explorer--error-gutter">
174+
<Icon glyph={IconFont.AlertTriangle_New} />
175+
<pre>{result.error}</pre>
176+
</div>
177+
)}
171178
<div style={{width: '100%'}}>
172179
<FlexBox
173180
direction={FlexDirection.Row}

0 commit comments

Comments
 (0)