editor workflow ui adjustments
This commit is contained in:
@ -1,12 +1,11 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { Map } from 'immutable';
|
||||
import { OrderedMap } from 'immutable';
|
||||
import { init, loadUnpublishedEntries } from '../actions/editorialWorkflow';
|
||||
import { selectUnpublishedEntries } from '../reducers';
|
||||
import { EDITORIAL_WORKFLOW, status } from '../constants/publishModes';
|
||||
import UnpublishedListing from '../components/UnpublishedListing';
|
||||
import { connect } from 'react-redux';
|
||||
import _ from 'lodash';
|
||||
|
||||
export default function EditorialWorkflow(WrappedComponent) {
|
||||
class EditorialWorkflow extends WrappedComponent {
|
||||
@ -45,11 +44,15 @@ export default function EditorialWorkflow(WrappedComponent) {
|
||||
const returnObj = { isEditorialWorkflow };
|
||||
|
||||
if (isEditorialWorkflow) {
|
||||
returnObj.unpublishedEntries = _.reduce(status, (acc, currStatus) => {
|
||||
/*
|
||||
* Generates an ordered Map of the available status as keys.
|
||||
* Each key containing a List of available unpubhlished entries
|
||||
* Eg.: OrderedMap{'draft':List(), 'pending_review':List(), 'pending_publish':List()}
|
||||
*/
|
||||
returnObj.unpublishedEntries = status.reduce((acc, currStatus) => {
|
||||
return acc.set(currStatus, selectUnpublishedEntries(state, currStatus));
|
||||
}, Map());
|
||||
}, OrderedMap());
|
||||
}
|
||||
|
||||
return returnObj;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user