Refinements & Preview Defaults (#167)

* No need for set width for base Card anymore

* entries are not required

* Redirect from Dashboard to first collection if publish mode is simple

* collection inference: Add more synonyms to description

* Implemented a better default preview for editing entries

* Add label field in default preview for small text values

* Added margin for default preview
This commit is contained in:
Cássio Souza
2016-11-23 16:23:32 -02:00
committed by GitHub
parent fed0066ca5
commit b1a5ea95d3
22 changed files with 191 additions and 70 deletions

View File

@ -1,13 +1,39 @@
import React from 'react';
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { SIMPLE, EDITORIAL_WORKFLOW } from '../constants/publishModes';
import history from '../routing/history';
import UnpublishedEntriesPanel from './editorialWorkflow/UnpublishedEntriesPanel';
import styles from './breakpoints.css';
export default function DashboardPage() {
return (
<div className={styles.root}>
<h1>Dashboard</h1>
<UnpublishedEntriesPanel />
</div>
);
class DashboardPage extends Component {
componentWillMount() {
if (this.props.publishMode === SIMPLE) {
history.push(`/collections/${ this.props.firstCollection }`);
}
}
render() {
return (
<div className={styles.root}>
<h1>Dashboard</h1>
<UnpublishedEntriesPanel />
</div>
);
}
}
DashboardPage.propTypes = {
firstCollection: PropTypes.string,
publishMode: PropTypes.oneOf([SIMPLE, EDITORIAL_WORKFLOW]),
};
function mapStateToProps(state) {
const { config, collections } = state;
return {
firstCollection: collections.first().get('name'),
publishMode: config.get('publish_mode'),
};
}
export default connect(mapStateToProps)(DashboardPage);

View File

@ -11,7 +11,7 @@ import { Loader } from '../../components/UI';
class unpublishedEntriesPanel extends Component {
static propTypes = {
isEditorialWorkflow: PropTypes.bool.isRequired,
isFetching: PropTypes.bool.isRequired,
isFetching: PropTypes.bool,
unpublishedEntries: ImmutablePropTypes.map,
loadUnpublishedEntries: PropTypes.func.isRequired,
updateUnpublishedEntryStatus: PropTypes.func.isRequired,