Editorial workflow Drag'nDrop

This commit is contained in:
Cássio Zen
2016-09-13 16:00:24 -03:00
parent e2b6e140f3
commit 0b447d483d
10 changed files with 237 additions and 61 deletions

View File

@ -1,7 +1,7 @@
import React, { PropTypes } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { OrderedMap } from 'immutable';
import { loadUnpublishedEntries } from '../../actions/editorialWorkflow';
import { loadUnpublishedEntries, updateUnpublishedEntryStatus } from '../../actions/editorialWorkflow';
import { selectUnpublishedEntries } from '../../reducers';
import { EDITORIAL_WORKFLOW, status } from '../../constants/publishModes';
import UnpublishedListing from '../../components/UnpublishedListing';
@ -19,13 +19,17 @@ export default function CollectionPageHOC(CollectionPage) {
super.componentDidMount();
}
handleChangeStatus(collection, slug, oldStatus, newStatus) {
this.props.updateUnpublishedEntryStatus(collection, slug, oldStatus, newStatus);
}
render() {
const { isEditorialWorkflow, unpublishedEntries } = this.props;
if (!isEditorialWorkflow) return super.render();
return (
<div className={styles.alignable}>
<UnpublishedListing entries={unpublishedEntries}/>
<UnpublishedListing entries={unpublishedEntries} handleChangeStatus={this.handleChangeStatus.bind(this)} />
{super.render()}
</div>
);
@ -56,5 +60,5 @@ export default function CollectionPageHOC(CollectionPage) {
return returnObj;
}
return connect(mapStateToProps)(CollectionPageHOC);
return connect(mapStateToProps, { updateUnpublishedEntryStatus })(CollectionPageHOC);
}

View File

@ -37,7 +37,7 @@ export default function EntryPageHOC(EntryPage) {
};
returnObj.persistEntry = (collection, entryDraft) => {
dispatch(persistUnpublishedEntry(collection, status, entryDraft));
dispatch(persistUnpublishedEntry(collection, entryDraft));
};
}
return returnObj;