add namespace for appBoot, and fix syntax error in GridField

This commit is contained in:
Christopher Joe 2016-05-25 12:11:46 +12:00
parent 67d3a8d544
commit 19a1ebe789
2 changed files with 6 additions and 4 deletions

View File

@ -45,4 +45,6 @@ function appBoot() {
// Entwine hooks are being used to set up the <Provider>. // Entwine hooks are being used to set up the <Provider>.
// `window.onload` happens AFTER these Entwine hooks which means // `window.onload` happens AFTER these Entwine hooks which means
// the store is undefined when the <Provider> is constructed. // the store is undefined when the <Provider> is constructed.
$('body').entwine({ onadd: () => appBoot() }); $.entwine('ss', () => {
$('body').entwine({ onadd: () => appBoot() });
});

View File

@ -11,6 +11,8 @@ import GridFieldAction from './GridFieldAction';
import FormConstants from 'components/Form/FormConstants'; import FormConstants from 'components/Form/FormConstants';
import * as actions from 'state/records/RecordsActions'; import * as actions from 'state/records/RecordsActions';
const NotYetLoaded = {};
/** /**
* The component acts as a container for a grid field, * The component acts as a container for a grid field,
* with smarts around data retrieval from external sources. * with smarts around data retrieval from external sources.
@ -161,13 +163,11 @@ GridField.propTypes = {
}), }),
}; };
const NotYetLoaded = {};
function mapStateToProps(state, ownProps) { function mapStateToProps(state, ownProps) {
const recordType = ownProps.data ? ownProps.data.recordType : null; const recordType = ownProps.data ? ownProps.data.recordType : null;
return { return {
config: state.config, config: state.config,
records: recordType && state.records[recordType] ? state.records[recordType] : NotYetLoaded records: recordType && state.records[recordType] ? state.records[recordType] : NotYetLoaded,
}; };
} }