Skip to content

Commit

Permalink
Merge pull request #195 from carlosms/keep-error-tabs
Browse files Browse the repository at this point in the history
Keep tabs open on error
  • Loading branch information
carlosms authored Jul 12, 2018
2 parents f15bec9 + 418d206 commit 86a2465
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
6 changes: 1 addition & 5 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,7 @@ AND refs.ref_name = 'HEAD'`

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

if (status === STATUS_SUCCESS) {
newResults.set(key, result);
} else {
newResults.delete(key);
}
newResults.set(key, result);

this.setState({
results: newResults,
Expand Down
23 changes: 17 additions & 6 deletions frontend/src/components/TabbedResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { Component, Fragment } from 'react';
import {
Row,
Col,
Alert,
Tab,
Button,
OverlayTrigger,
Expand All @@ -19,6 +18,7 @@ import CloseIcon from '../icons/close-query-tab.svg';
import TimerIcon from '../icons/history-tab.svg';
import LoadingImg from '../icons/alex-loading-results.gif';
import SuspendedImg from '../icons/alex-suspended-tab.gif';
import ErrorImg from '../icons/broken-alex.gif';

class TabTitle extends Component {
constructor(props) {
Expand Down Expand Up @@ -209,11 +209,22 @@ class TabbedResults extends Component {
);
} else if (query.errorMsg) {
content = (
<Row className="errors-row">
<Col xs={12}>
<Alert bsStyle="danger">{query.errorMsg}</Alert>
</Col>
</Row>
<Fragment>
<span className="result-error-msg">{query.errorMsg}</span>
<Row>
<Col className="text-center animation-col" xs={12}>
<img src={`${ErrorImg}?${key}`} alt="error animation" />
</Col>
</Row>
<Row>
<Col
className="text-center message-col last-message-col"
xs={12}
>
QUERY FAILED
</Col>
</Row>
</Fragment>
);
} else if (query.response) {
content = (
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/components/TabbedResults.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,16 @@
}
}

span.result-error-msg {
font-size: 14px;
color: @error-text;
}

.animation-col {
margin-top: 3em;
img {
max-height: 240px;
}
}

.message-col {
Expand All @@ -56,6 +64,7 @@

.query-text {
flex: 0 1 auto;
height: 100%;
white-space: pre;
font-family: @monospace-font;
color: @secondary-tint-2;
Expand Down
Binary file added frontend/src/icons/broken-alex.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 86a2465

Please sign in to comment.