fix: bug fixes from linters (#1524)

This commit is contained in:
Caleb
2018-07-27 09:13:52 -06:00
committed by Shawn Erquhart
parent 34c8c2ad70
commit 6632e5d152
11 changed files with 16 additions and 14 deletions

View File

@ -8,7 +8,7 @@ import { formatToExtension } from 'Formats/formats';
const collections = (state = null, action) => {
switch (action.type) {
case CONFIG_SUCCESS:
case CONFIG_SUCCESS: {
const configCollections = action.payload ? action.payload.get('collections') : List();
return configCollections
.toOrderedMap()
@ -21,6 +21,7 @@ const collections = (state = null, action) => {
}
})
.mapKeys((key, collection) => collection.get('name'));
}
default:
return state;
}

View File

@ -22,13 +22,14 @@ import { CONFIG_SUCCESS } from 'Actions/config';
const unpublishedEntries = (state = Map(), action) => {
switch (action.type) {
case CONFIG_SUCCESS:
case CONFIG_SUCCESS: {
const publishMode = action.payload && action.payload.get('publish_mode');
if (publishMode === EDITORIAL_WORKFLOW) {
// Editorial workflow state is explicetelly initiated after the config.
return Map({ entities: Map(), pages: Map() });
}
return state;
}
case UNPUBLISHED_ENTRY_REQUEST:
return state.setIn(['entities', `${ action.payload.collection }.${ action.payload.slug }`, 'isFetching'], true);

View File

@ -3,7 +3,7 @@ import { CONFIG_SUCCESS } from 'Actions/config';
const integrations = (state = null, action) => {
switch (action.type) {
case CONFIG_SUCCESS:
case CONFIG_SUCCESS: {
const integrations = action.payload.get('integrations', List()).toJS() || [];
const newState = integrations.reduce((acc, integration) => {
const { hooks, collections, provider, ...providerData } = integration;
@ -23,6 +23,7 @@ const integrations = (state = null, action) => {
return acc;
}, { providers:{}, hooks: {} });
return fromJS(newState);
}
default:
return state;
}