2016-06-10 00:16:01 -03:00
|
|
|
import auth from './auth';
|
|
|
|
import config from './config';
|
2016-10-10 15:34:21 -03:00
|
|
|
import integrations, * as fromIntegrations from './integrations';
|
2016-10-18 12:32:39 -02:00
|
|
|
import entries, * as fromEntries from './entries';
|
2018-06-11 19:03:43 -07:00
|
|
|
import cursors from './cursors';
|
2016-10-10 15:34:21 -03:00
|
|
|
import editorialWorkflow, * as fromEditorialWorkflow from './editorialWorkflow';
|
2016-06-10 00:16:01 -03:00
|
|
|
import entryDraft from './entryDraft';
|
|
|
|
import collections from './collections';
|
2016-12-07 15:44:07 -02:00
|
|
|
import search from './search';
|
2017-08-14 09:00:47 -04:00
|
|
|
import mediaLibrary from './mediaLibrary';
|
2016-06-10 00:16:01 -03:00
|
|
|
import medias, * as fromMedias from './medias';
|
2016-11-11 17:54:58 -02:00
|
|
|
import globalUI from './globalUI';
|
2016-06-10 00:16:01 -03:00
|
|
|
|
|
|
|
const reducers = {
|
|
|
|
auth,
|
|
|
|
config,
|
|
|
|
collections,
|
2016-12-07 15:44:07 -02:00
|
|
|
search,
|
2016-10-10 15:34:21 -03:00
|
|
|
integrations,
|
2016-06-10 00:16:01 -03:00
|
|
|
entries,
|
2018-06-11 19:03:43 -07:00
|
|
|
cursors,
|
2016-09-06 13:04:17 -03:00
|
|
|
editorialWorkflow,
|
2016-06-10 00:16:01 -03:00
|
|
|
entryDraft,
|
2017-08-14 09:00:47 -04:00
|
|
|
mediaLibrary,
|
2016-10-18 12:32:39 -02:00
|
|
|
medias,
|
2016-11-11 17:54:58 -02:00
|
|
|
globalUI,
|
2016-06-10 00:16:01 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
export default reducers;
|
|
|
|
|
2016-09-06 13:04:17 -03:00
|
|
|
/*
|
|
|
|
* Selectors
|
|
|
|
*/
|
2016-06-10 00:16:01 -03:00
|
|
|
export const selectEntry = (state, collection, slug) =>
|
|
|
|
fromEntries.selectEntry(state.entries, collection, slug);
|
|
|
|
|
|
|
|
export const selectEntries = (state, collection) =>
|
|
|
|
fromEntries.selectEntries(state.entries, collection);
|
|
|
|
|
2016-12-07 15:44:07 -02:00
|
|
|
export const selectSearchedEntries = (state) => {
|
|
|
|
const searchItems = state.search.get('entryIds');
|
|
|
|
return searchItems && searchItems.map(({ collection, slug }) => fromEntries.selectEntry(state.entries, collection, slug));
|
|
|
|
};
|
2016-10-10 15:34:21 -03:00
|
|
|
|
2017-01-11 20:58:15 -02:00
|
|
|
export const selectUnpublishedEntry = (state, collection, slug) =>
|
|
|
|
fromEditorialWorkflow.selectUnpublishedEntry(state.editorialWorkflow, collection, slug);
|
2016-09-06 13:04:17 -03:00
|
|
|
|
2017-01-11 20:58:15 -02:00
|
|
|
export const selectUnpublishedEntriesByStatus = (state, status) =>
|
|
|
|
fromEditorialWorkflow.selectUnpublishedEntriesByStatus(state.editorialWorkflow, status);
|
2016-09-06 13:04:17 -03:00
|
|
|
|
2016-10-10 15:34:21 -03:00
|
|
|
export const selectIntegration = (state, collection, hook) =>
|
|
|
|
fromIntegrations.selectIntegration(state.integrations, collection, hook);
|
|
|
|
|
2017-01-10 22:23:22 -02:00
|
|
|
export const getAsset = (state, path) =>
|
|
|
|
fromMedias.getAsset(state.config.get('public_folder'), state.medias, path);
|