Skip to content

Commit 86a2465

Browse files
authored
Merge pull request #195 from carlosms/keep-error-tabs
Keep tabs open on error
2 parents f15bec9 + 418d206 commit 86a2465

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

frontend/src/App.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,7 @@ AND refs.ref_name = 'HEAD'`
201201

202202
const newResults = new Map(this.state.results);
203203

204-
if (status === STATUS_SUCCESS) {
205-
newResults.set(key, result);
206-
} else {
207-
newResults.delete(key);
208-
}
204+
newResults.set(key, result);
209205

210206
this.setState({
211207
results: newResults,

frontend/src/components/TabbedResults.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { Component, Fragment } from 'react';
22
import {
33
Row,
44
Col,
5-
Alert,
65
Tab,
76
Button,
87
OverlayTrigger,
@@ -19,6 +18,7 @@ import CloseIcon from '../icons/close-query-tab.svg';
1918
import TimerIcon from '../icons/history-tab.svg';
2019
import LoadingImg from '../icons/alex-loading-results.gif';
2120
import SuspendedImg from '../icons/alex-suspended-tab.gif';
21+
import ErrorImg from '../icons/broken-alex.gif';
2222

2323
class TabTitle extends Component {
2424
constructor(props) {
@@ -209,11 +209,22 @@ class TabbedResults extends Component {
209209
);
210210
} else if (query.errorMsg) {
211211
content = (
212-
<Row className="errors-row">
213-
<Col xs={12}>
214-
<Alert bsStyle="danger">{query.errorMsg}</Alert>
215-
</Col>
216-
</Row>
212+
<Fragment>
213+
<span className="result-error-msg">{query.errorMsg}</span>
214+
<Row>
215+
<Col className="text-center animation-col" xs={12}>
216+
<img src={`${ErrorImg}?${key}`} alt="error animation" />
217+
</Col>
218+
</Row>
219+
<Row>
220+
<Col
221+
className="text-center message-col last-message-col"
222+
xs={12}
223+
>
224+
QUERY FAILED
225+
</Col>
226+
</Row>
227+
</Fragment>
217228
);
218229
} else if (query.response) {
219230
content = (

frontend/src/components/TabbedResults.less

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,16 @@
3030
}
3131
}
3232

33+
span.result-error-msg {
34+
font-size: 14px;
35+
color: @error-text;
36+
}
37+
3338
.animation-col {
3439
margin-top: 3em;
40+
img {
41+
max-height: 240px;
42+
}
3543
}
3644

3745
.message-col {
@@ -56,6 +64,7 @@
5664

5765
.query-text {
5866
flex: 0 1 auto;
67+
height: 100%;
5968
white-space: pre;
6069
font-family: @monospace-font;
6170
color: @secondary-tint-2;

frontend/src/icons/broken-alex.gif

218 KB
Loading

0 commit comments

Comments
 (0)