Skip to content

Commit

Permalink
Fix some of the feedback addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Joe committed Aug 3, 2017
1 parent 4a8b2c0 commit 32edfa0
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 66 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions client/src/containers/CampaignAdmin/CampaignAdminList.js
Expand Up @@ -29,7 +29,7 @@ class CampaignAdminList extends SilverStripeComponent {
this.setBreadcrumbs = this.setBreadcrumbs.bind(this);
this.handleCloseItem = this.handleCloseItem.bind(this);

if (!this.isRecordLoaded()) {
if (!this.isRecordLoaded(props)) {
this.state = {
loading: true,
};
Expand Down Expand Up @@ -64,8 +64,8 @@ class CampaignAdminList extends SilverStripeComponent {
/**
* @return {boolean}
*/
isRecordLoaded() {
return Object.keys(this.props.record).length !== 0;
isRecordLoaded(props = this.props) {
return Object.keys(props.record).length !== 0;
}

/**
Expand Down Expand Up @@ -419,12 +419,13 @@ CampaignAdminList.propTypes = {
};

function mapStateToProps(state, ownProps) {
// Find record specific to this item
let record = null;
const treeClass = ownProps.sectionConfig.treeClass;
if (state.records && state.records[treeClass] && ownProps.campaignId) {
record = state.records[treeClass][parseInt(ownProps.campaignId, 10)];
}
const id = parseInt(ownProps.campaignId, 10);
// Find record specific to this item
const record = state.records[treeClass]
? state.records[treeClass][id]
: null;

return {
config: state.config,
record: record || {},
Expand Down
2 changes: 1 addition & 1 deletion client/src/state/campaign/CampaignActions.js
Expand Up @@ -69,7 +69,7 @@ export function publishCampaign(publishApi, recordType, campaignId) {
/**
* Set new campaign
*
* @param {?number}
* @param {Number|null} itemId
* @return {Object}
*/
export function setNewItem(itemId) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -9,9 +9,9 @@
"node": "^6.x"
},
"scripts": {
"build": "NODE_ENV=production webpack -p --bail --progress",
"watch": "NODE_ENV=development webpack --watch --progress",
"css": "WEBPACK_CHILD=css npm run build",
"build": "yarn && NODE_ENV=production webpack -p --bail --progress",
"watch": "yarn && NODE_ENV=development webpack --watch --progress",
"css": "yarn && WEBPACK_CHILD=css webpack -p --bail --progress",
"test": "jest",
"coverage": "jest --coverage",
"lint": "eslint client/src && sass-lint -v client/src"
Expand Down
2 changes: 1 addition & 1 deletion src/CampaignAdmin.php
Expand Up @@ -590,7 +590,7 @@ public function getCampaignCreateForm()
'campaignCreateForm',
$fields,
FieldList::create(
FormAction::create('save', _t(__CLASS__.'.SAVE', 'Create'))
FormAction::create('save', _t(__CLASS__.'.CREATE', 'Create'))
->setIcon('save'),
FormAction::create('cancel', _t(__CLASS__.'.CANCEL', 'Cancel'))
->setUseButtonTag(true)
Expand Down
104 changes: 52 additions & 52 deletions yarn.lock
Expand Up @@ -298,19 +298,19 @@ babel-code-frame@^6.11.0, babel-code-frame@^6.22.0:
esutils "^2.0.2"
js-tokens "^3.0.0"

babel-core@^6.0.0, babel-core@^6.24.0, babel-core@^6.7.4:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.0.tgz#8f36a0a77f5c155aed6f920b844d23ba56742a02"
babel-core@^6.0.0, babel-core@^6.24.0, babel-core@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83"
dependencies:
babel-code-frame "^6.22.0"
babel-generator "^6.24.0"
babel-helpers "^6.23.0"
babel-generator "^6.24.1"
babel-helpers "^6.24.1"
babel-messages "^6.23.0"
babel-register "^6.24.0"
babel-register "^6.24.1"
babel-runtime "^6.22.0"
babel-template "^6.23.0"
babel-traverse "^6.23.1"
babel-types "^6.23.0"
babel-template "^6.24.1"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babylon "^6.11.0"
convert-source-map "^1.1.0"
debug "^2.1.1"
Expand All @@ -322,19 +322,19 @@ babel-core@^6.0.0, babel-core@^6.24.0, babel-core@^6.7.4:
slash "^1.0.0"
source-map "^0.5.0"

babel-core@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83"
babel-core@^6.7.4:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.0.tgz#8f36a0a77f5c155aed6f920b844d23ba56742a02"
dependencies:
babel-code-frame "^6.22.0"
babel-generator "^6.24.1"
babel-helpers "^6.24.1"
babel-generator "^6.24.0"
babel-helpers "^6.23.0"
babel-messages "^6.23.0"
babel-register "^6.24.1"
babel-register "^6.24.0"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-template "^6.23.0"
babel-traverse "^6.23.1"
babel-types "^6.23.0"
babylon "^6.11.0"
convert-source-map "^1.1.0"
debug "^2.1.1"
Expand All @@ -346,26 +346,26 @@ babel-core@^6.24.1:
slash "^1.0.0"
source-map "^0.5.0"

babel-generator@^6.18.0, babel-generator@^6.24.0:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.0.tgz#eba270a8cc4ce6e09a61be43465d7c62c1f87c56"
babel-generator@^6.18.0, babel-generator@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497"
dependencies:
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-types "^6.23.0"
babel-types "^6.24.1"
detect-indent "^4.0.0"
jsesc "^1.3.0"
lodash "^4.2.0"
source-map "^0.5.0"
trim-right "^1.0.1"

babel-generator@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497"
babel-generator@^6.24.0:
version "6.24.0"
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.0.tgz#eba270a8cc4ce6e09a61be43465d7c62c1f87c56"
dependencies:
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-types "^6.24.1"
babel-types "^6.23.0"
detect-indent "^4.0.0"
jsesc "^1.3.0"
lodash "^4.2.0"
Expand Down Expand Up @@ -1112,66 +1112,66 @@ babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0:
core-js "^2.4.0"
regenerator-runtime "^0.10.0"

babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638"
babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333"
dependencies:
babel-runtime "^6.22.0"
babel-traverse "^6.23.0"
babel-types "^6.23.0"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babylon "^6.11.0"
lodash "^4.2.0"

babel-template@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333"
babel-template@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638"
dependencies:
babel-runtime "^6.22.0"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-traverse "^6.23.0"
babel-types "^6.23.0"
babylon "^6.11.0"
lodash "^4.2.0"

babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1:
version "6.23.1"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48"
babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695"
dependencies:
babel-code-frame "^6.22.0"
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-types "^6.23.0"
babel-types "^6.24.1"
babylon "^6.15.0"
debug "^2.2.0"
globals "^9.0.0"
invariant "^2.2.0"
lodash "^4.2.0"

babel-traverse@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695"
babel-traverse@^6.23.1:
version "6.23.1"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48"
dependencies:
babel-code-frame "^6.22.0"
babel-messages "^6.23.0"
babel-runtime "^6.22.0"
babel-types "^6.24.1"
babel-types "^6.23.0"
babylon "^6.15.0"
debug "^2.2.0"
globals "^9.0.0"
invariant "^2.2.0"
lodash "^4.2.0"

babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf"
babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975"
dependencies:
babel-runtime "^6.22.0"
esutils "^2.0.2"
lodash "^4.2.0"
to-fast-properties "^1.0.1"

babel-types@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975"
babel-types@^6.23.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf"
dependencies:
babel-runtime "^6.22.0"
esutils "^2.0.2"
Expand Down Expand Up @@ -3591,11 +3591,11 @@ minimist@0.0.8, minimist@~0.0.1:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"

minimist@1.1.x, minimist@^1.1.1, minimist@^1.1.3:
minimist@1.1.x, minimist@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.1.3.tgz#3bedfd91a92d39016fcfaa1c681e8faa1a1efda8"

minimist@^1.2.0:
minimist@^1.1.1, minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"

Expand Down

0 comments on commit 32edfa0

Please sign in to comment.