34e1f09105
* Fix handling of displayURLs which are strings * Add fromFetchArguments to unsentRequest * Add parseLinkHeader to backendUtil * Handle paginated endpoints in GitHub API * Rename fork workflow to Open Authoring across the whole repo * Fixes for bugs in GitHub API introduced by Open Authoring changes * Fix getDeployPreview * Fix incorrect auth header formatting GitHub implementation cf. https://github.com/netlify/netlify-cms/pull/2456#discussion_r309633387 * Remove unused and broken method from GitHub API cf. https://github.com/netlify/netlify-cms/pull/2456#discussion_r308687145 * Fix editorialWorkflowGit method in GitHub API * Request published entry content from origin repo * Better error when deleting a published post in Open Authoring * Rename to Open Authoring in fork request message Also adds a note to the fork request message that an existing fork of the same repo will be used automatically. * fix linting
19 lines
670 B
JavaScript
19 lines
670 B
JavaScript
import { Map } from 'immutable';
|
|
import { USE_OPEN_AUTHORING } from 'Actions/auth';
|
|
/*
|
|
* Reducer for some global UI state that we want to share between components
|
|
* */
|
|
const globalUI = (state = Map({ isFetching: false, useOpenAuthoring: false }), action) => {
|
|
// Generic, global loading indicator
|
|
if (action.type.indexOf('REQUEST') > -1) {
|
|
return state.set('isFetching', true);
|
|
} else if (action.type.indexOf('SUCCESS') > -1 || action.type.indexOf('FAILURE') > -1) {
|
|
return state.set('isFetching', false);
|
|
} else if (action.type === USE_OPEN_AUTHORING) {
|
|
return state.set('useOpenAuthoring', true);
|
|
}
|
|
return state;
|
|
};
|
|
|
|
export default globalUI;
|