2.0.1 Beta

This commit is contained in:
Colin McLeod
2016-02-13 22:48:48 -08:00
parent d783a38588
commit 9175fb60af
67 changed files with 1042 additions and 1112 deletions

View File

@@ -1,4 +1,5 @@
import React from 'react';
import ErrorDetails from './ErrorDetails';
import { shallowEqual } from '../utils/UtilityFunctions';
/**
@@ -16,7 +17,8 @@ export default class Page extends React.Component {
hideModal: React.PropTypes.func.isRequired,
tooltip: React.PropTypes.func.isRequired,
termtip: React.PropTypes.func.isRequired,
onWindowResize: React.PropTypes.func.isRequired
onWindowResize: React.PropTypes.func.isRequired,
onCommand: React.PropTypes.func.isRequired
};
static propTypes = {
@@ -67,4 +69,16 @@ export default class Page extends React.Component {
document.title = newState.title || 'Coriolis';
}
/**
* Checks error state before rendering the page contents.
* Pages should catch all errors where possible capture details to state.error.
* @return {React.Component} Page contents
*/
render() {
if (this.state.error) {
return <ErrorDetails error={this.state.error} />;
}
return this.renderPage();
}
}