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:
@ -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,
|
||||
{
|
||||
|
Reference in New Issue
Block a user