diff --git a/package.json b/package.json index a1c42b59..42ac35a6 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "jest-cli": "^15.1.1", "js-yaml": "^3.5.3", "lint-staged": "^3.0.2", - "moment": "^2.11.2", "node-sass": "^3.10.0", "normalizr": "^2.0.0", "npm-check": "^5.2.3", @@ -68,10 +67,7 @@ "postcss-import": "^8.1.2", "postcss-loader": "^0.9.1", "pre-commit": "^1.1.3", - "react": "^15.1.0", - "react-dom": "^15.1.0", "react-hot-loader": "^3.0.0-beta.2", - "react-immutable-proptypes": "^1.6.0", "react-lazy-load": "^3.0.3", "react-pure-render": "^1.0.2", "react-redux": "^4.4.0", @@ -105,9 +101,14 @@ "lodash": "^4.13.1", "markup-it": "git+https://github.com/cassiozen/markup-it.git", "material-design-icons": "^3.0.1", + "moment": "^2.11.2", "normalize.css": "^4.2.0", "pluralize": "^3.0.0", "prismjs": "^1.5.1", + "react": "^15.1.0", + "react-dom": "^15.1.0", + "react-hot-loader": "^3.0.0-beta.2", + "react-immutable-proptypes": "^1.6.0", "react-addons-css-transition-group": "^15.3.1", "react-datetime": "^2.6.0", "react-portal": "^2.2.1", diff --git a/src/backends/github/implementation.js b/src/backends/github/implementation.js index cdb94c86..6ab60721 100644 --- a/src/backends/github/implementation.js +++ b/src/backends/github/implementation.js @@ -47,17 +47,17 @@ export default class GitHub { })); }); return Promise.all(promises); - }).then((entries) => ({ - pagination: {}, - entries + }).then(entries => ({ + pagination: 0, + entries, })); } // Will fetch the entire list of entries from github. lookupEntry(collection, slug) { - return this.entries(collection).then((response) => ( - response.entries.filter((entry) => entry.slug === slug)[0] + return this.entries(collection).then(response => ( + response.entries.filter(entry => entry.slug === slug)[0] )); } @@ -93,14 +93,14 @@ export default class GitHub { }).then((entries) => { return { pagination: {}, - entries + entries, }; }); } unpublishedEntry(collection, slug) { - return this.unpublishedEntries().then((response) => ( - response.entries.filter((entry) => ( + return this.unpublishedEntries().then(response => ( + response.entries.filter(entry => ( entry.metaData && entry.metaData.collection === collection.get('name') && entry.slug === slug ))[0] )); diff --git a/src/components/UnpublishedListing.js b/src/components/UnpublishedListing.js index 3da8ac52..e7df60d2 100644 --- a/src/components/UnpublishedListing.js +++ b/src/components/UnpublishedListing.js @@ -16,6 +16,9 @@ class UnpublishedListing extends React.Component { }; requestPublish = (collection, slug, ownStatus) => { + console.log('HERE'); + console.log(ownStatus); + console.log(status.last()); if (ownStatus !== status.last()) return; if (window.confirm('Are you sure you want to publish this entry?')) { this.props.handlePublish(collection, slug, ownStatus); @@ -39,12 +42,12 @@ class UnpublishedListing extends React.Component { /* eslint-enable */ )); } else { - return
- {entries.map(entry => { + return (
+ {entries.map((entry) => { // Look for an "author" field. Fallback to username on backend implementation; const author = entry.getIn(['data', 'author'], entry.getIn(['metaData', 'user'])); const timeStamp = moment(entry.getIn(['metaData', 'timeStamp'])).format('llll'); - const link = `/editorialworkflow/${entry.getIn(['metaData', 'collection'])}/${entry.getIn(['metaData', 'status'])}/${entry.get('slug')}`; + const link = `/editorialworkflow/${ entry.getIn(['metaData', 'collection']) }/${ entry.getIn(['metaData', 'status']) }/${ entry.get('slug') }`; const slug = entry.get('slug'); const ownStatus = entry.getIn(['metaData', 'status']); const collection = entry.getIn(['metaData', 'collection']); @@ -56,7 +59,7 @@ class UnpublishedListing extends React.Component { {entry.getIn(['data', 'title'])} by {author}

Last updated: {timeStamp} by {entry.getIn(['metaData', 'user'])}

{(ownStatus === status.last()) && - + }
@@ -65,7 +68,7 @@ class UnpublishedListing extends React.Component { ); } )} -
; + ); } }; @@ -81,7 +84,7 @@ class UnpublishedListing extends React.Component {

Editorial Workflow

- {columns} + {columns}
);