Search integration (React Version) (#84)

* algolia integration skeleton

* Configuration Defaults

* Implemented partial entries with lazy loading of complete file

* Moved backend selection logic to actioncreators

* basic pagination for entries

* general search skeleton

* Basic search result listing

* Redo search for different search terms

* search results pagination

* Changing integration config & handling

* Changing integration config & handling

* new integration config model
This commit is contained in:
Cássio Souza
2016-10-10 15:34:21 -03:00
committed by GitHub
parent 45d810a25f
commit 2815a86e0c
25 changed files with 493 additions and 111 deletions

View File

@ -33,18 +33,18 @@ class EntryPage extends React.Component {
};
componentDidMount() {
if (!this.props.newEntry) {
this.props.loadEntry(this.props.collection, this.props.slug);
const { entry, collection, slug } = this.props;
this.createDraft(this.props.entry);
} else {
if (this.props.newEntry) {
this.props.createEmptyDraft(this.props.collection);
} else {
this.props.loadEntry(entry, collection, slug);
this.createDraft(entry);
}
}
componentWillReceiveProps(nextProps) {
if (this.props.entry === nextProps.entry) return;
if (nextProps.entry && !nextProps.entry.get('isFetching')) {
this.createDraft(nextProps.entry);
} else if (nextProps.newEntry) {
@ -86,6 +86,13 @@ class EntryPage extends React.Component {
}
}
/*
* Instead of checking the publish mode everywhere to dispatch & render the additional editorial workflow stuff,
* We delegate it to a Higher Order Component
*/
EntryPage = EntryPageHOC(EntryPage);
function mapStateToProps(state, ownProps) {
const { collections, entryDraft } = state;
const collection = collections.get(ownProps.params.name);
@ -96,12 +103,6 @@ function mapStateToProps(state, ownProps) {
return { collection, collections, newEntry, entryDraft, boundGetMedia, slug, entry };
}
/*
* Instead of checking the publish mode everywhere to dispatch & render the additional editorial workflow stuff,
* We delegate it to a Higher Order Component
*/
EntryPage = EntryPageHOC(EntryPage);
export default connect(
mapStateToProps,
{