From 40c6ae97a5b0911572aa4a6cc221d3f1f5db3af4 Mon Sep 17 00:00:00 2001
From: Vivek R <123vivekr@gmail.com>
Date: Thu, 17 Jan 2019 10:18:33 +0530
Subject: [PATCH] board.jsx: Remove error message
Removes error message because a modal has been implemented.
Fixes https://github.com/coala/gh-board/issues/127
---
src/components/board.jsx | 255 ++++++++++++++++++++-------------------
1 file changed, 128 insertions(+), 127 deletions(-)
diff --git a/src/components/board.jsx b/src/components/board.jsx
index 0b5963ad..4dd2f738 100644
--- a/src/components/board.jsx
+++ b/src/components/board.jsx
@@ -12,139 +12,140 @@ import Progress from '../progress';
import Database from '../database';
class ProgressView extends Component {
- state = {message: null, ticks: 0, max: 0};
-
- componentDidMount() {
- const {progress} = this.props;
- progress.on('start', this.onStart);
- progress.on('tick', this.onTick);
- progress.on('stop', this.onStop);
- }
-
- componentWillUnmount() {
- const {progress} = this.props;
- progress.off('start', this.onStart);
- progress.off('tick', this.onTick);
- progress.off('stop', this.onStop);
- }
-
- onStart = (context) => { this.setState({max: this.props.progress.max, message: 'Start: ' + context}); };
-
- onTick = (context, ticks, max) => {
- this.setState({ticks: ticks, max: max, message: context});
- this.forceUpdate();
- };
-
- onStop = (context) => {
- this.setState({
- ticks: this.props.progress.ticks,
- max: this.props.progress.max,
- message: 'Finished: ' + context
- });
- };
-
- render() {
- const {ticks, max} = this.state;
- const {message} = this.state;
- const label = `${ticks}/${max}`;
-
- // TODO: Use Loadable component
- return (
-
-
- {message}
-
- );
- }
-}
+ state = {message: null, ticks: 0, max: 0};
-class Board extends Component {
- static propTypes = {
- type: PropTypes.func.isRequired, // A React Component
- repoInfos: PropTypes.array.isRequired,
- columnDataPromise: PropTypes.object.isRequired
- };
-
- componentDidMount() {
- IssueStore.on('change', this.onChange);
- FilterStore.on('change', this.onChange);
- SettingsStore.on('change', this.onChange);
- SettingsStore.on('change:showPullRequestData', this.onChangeAndRefetch);
- }
-
- componentWillUnmount() {
- IssueStore.off('change', this.onChange);
- FilterStore.off('change', this.onChange);
- SettingsStore.off('change', this.onChange);
- SettingsStore.off('change:showPullRequestData', this.onChangeAndRefetch);
- }
-
- onChangeAndRefetch = () => {
- IssueStore.clearCacheCards();
- this.forceUpdate();
- };
-
- onChange = () => {
- this.setState({});
- };
-
- onLabelsChanged = () => {
- this.setState({});
- };
-
- // Curried func to squirrell the primaryRepoName var
- renderKanbanRepos = (repoInfos) => {
- const {type} = this.props;
-
- return ([columnData, cards]) => {
-
- if (cards.length) {
- return React.createElement(type, {columnData, cards, repoInfos});
- } else {
+ componentDidMount() {
+ const {progress} = this.props;
+ progress.on('start', this.onStart);
+ progress.on('tick', this.onTick);
+ progress.on('stop', this.onStop);
+ }
+
+ componentWillUnmount() {
+ const {progress} = this.props;
+ progress.off('start', this.onStart);
+ progress.off('tick', this.onTick);
+ progress.off('stop', this.onStop);
+ }
+
+ onStart = (context) => { this.setState({max: this.props.progress.max, message: 'Start: ' + context}); };
+
+ onTick = (context, ticks, max) => {
+ this.setState({ticks: ticks, max: max, message: context});
+ this.forceUpdate();
+ };
+
+ onStop = (context) => {
+ this.setState({
+ ticks: this.props.progress.ticks,
+ max: this.props.progress.max,
+ message: 'Finished: ' + context
+ });
+ };
+
+ render() {
+ const {ticks, max} = this.state;
+ const {message} = this.state;
+ const label = `${ticks}/${max}`;
+
+ // TODO: Use Loadable component
return (
-
-
No Issues to show
-
There are no Issues to show. Maybe the repository does not have any or an applied filter removes all Issues.
-
+
+
+ {message}
+
);
- }
+ }
+}
+
+class Board extends Component {
+ static propTypes = {
+ type: PropTypes.func.isRequired, // A React Component
+ repoInfos: PropTypes.array.isRequired,
+ columnDataPromise: PropTypes.object.isRequired
+ };
+
+ componentDidMount() {
+ IssueStore.on('change', this.onChange);
+ FilterStore.on('change', this.onChange);
+ SettingsStore.on('change', this.onChange);
+ SettingsStore.on('change:showPullRequestData', this.onChangeAndRefetch);
+ }
+
+ componentWillUnmount() {
+ IssueStore.off('change', this.onChange);
+ FilterStore.off('change', this.onChange);
+ SettingsStore.off('change', this.onChange);
+ SettingsStore.off('change:showPullRequestData', this.onChangeAndRefetch);
+ }
+
+ onChangeAndRefetch = () => {
+ IssueStore.clearCacheCards();
+ this.forceUpdate();
+ };
+
+ onChange = () => {
+ this.setState({});
+ };
+
+ onLabelsChanged = () => {
+ this.setState({});
+ };
+ // Curried func to squirrell the primaryRepoName var
+ renderKanbanRepos = (repoInfos) => {
+ const {type} = this.props;
+
+ return ([columnData, cards]) => {
+
+ if (cards.length) {
+ return React.createElement(type, {columnData, cards, repoInfos});
+ } else {
+ return (
+
+
No Issues to show
+
There are no Issues to show. Maybe the repository does not have any or an applied filter removes all Issues.
+
+ );
+ }
+
+ };
+ };
+
+ renderError = (err) => {
+ console.error(err);
+ if (err.name === 'InvalidStateError') {
+ return (
+ It looks like your browser is in private browsing mode. gh-board uses IndexedDB to cache requests to GitHub. Please disable Private Browsing to see it work.
+ );
+ } else {
+ return (
+
+ //
+ // Problem loading. Is it a valid repo? And have you exceeded your number of requests? Usually happens when not logged in because GitHub limits anonymous use of their API.
+ // {err.message}
+ // {JSON.stringify(err)}
+ //
+ );
+ }
};
- };
-
- renderError = (err) => {
- console.error(err);
- if (err.name === 'InvalidStateError') {
- return (
- It looks like your browser is in private browsing mode. gh-board uses IndexedDB to cache requests to GitHub. Please disable Private Browsing to see it work.
- );
- } else {
- return (
-
- Problem loading. Is it a valid repo? And have you exceeded your number of requests? Usually happens when not logged in because GitHub limits anonymous use of their API.
- {err.message}
- {JSON.stringify(err)}
-
- );
+
+ render() {
+ const {repoInfos, columnDataPromise} = this.props;
+ const progress = new Progress();
+ const cardsPromise = IssueStore.fetchIssues().then((cards) => {
+ return Database.fetchCards(getFilters()) || cards;
+ });
+
+ return (
+ ()}
+ renderLoaded={this.renderKanbanRepos(repoInfos)}
+ renderError={this.renderError}
+ />
+ );
}
- };
-
- render() {
- const {repoInfos, columnDataPromise} = this.props;
- const progress = new Progress();
- const cardsPromise = IssueStore.fetchIssues().then((cards) => {
- return Database.fetchCards(getFilters()) || cards;
- });
-
- return (
- ()}
- renderLoaded={this.renderKanbanRepos(repoInfos)}
- renderError={this.renderError}
- />
- );
- }
}
export default Board;