diff --git a/src/actions/config.js b/src/actions/config.js index 57a51510..ff6581e9 100644 --- a/src/actions/config.js +++ b/src/actions/config.js @@ -70,9 +70,9 @@ function parseConfig(data) { } } - if (!('publish_mode' in config.backend)) { - // Make sure there is a publish mode - config.backend['publish_mode'] = 'simple'; + if (!('publish_workflow' in config)) { + // Make sure there is a publish workflow mode set + config['publish_workflow'] = 'simple'; } if (!('public_folder' in config)) { diff --git a/src/backends/backend.js b/src/backends/backend.js index 23584799..b734108e 100644 --- a/src/backends/backend.js +++ b/src/backends/backend.js @@ -3,7 +3,7 @@ import GitHubBackend from './github/implementation'; import NetlifyGitBackend from './netlify-git/implementation'; import { resolveFormat } from '../formats/formats'; import { createEntry } from '../valueObjects/Entry'; -import { SIMPLE, BRANCH } from './constants'; +import { SIMPLE, EDITORIAL } from './constants'; class LocalStorageAuthStore { storageKey = 'nf-cms-user'; @@ -94,9 +94,9 @@ class Backend { } getPublishMode(config) { - const publish_modes = [SIMPLE, BRANCH]; - const mode = config.getIn(['backend', 'publish_mode']); - if (publish_modes.indexOf(mode) !== -1) { + const publish_workflows = [SIMPLE, EDITORIAL]; + const mode = config.get('publish_workflow'); + if (publish_workflows.indexOf(mode) !== -1) { return mode; } else { return SIMPLE; diff --git a/src/backends/constants.js b/src/backends/constants.js index 6f6c6852..e4203a35 100644 --- a/src/backends/constants.js +++ b/src/backends/constants.js @@ -1,3 +1,3 @@ -// Create/edit modes +// Create/edit workflows export const SIMPLE = 'simple'; -export const BRANCH = 'branch'; +export const EDITORIAL = 'editorial'; diff --git a/src/backends/github/API.js b/src/backends/github/API.js index 453f3e89..2cd4ac3d 100644 --- a/src/backends/github/API.js +++ b/src/backends/github/API.js @@ -1,7 +1,7 @@ import LocalForage from 'localforage'; import MediaProxy from '../../valueObjects/MediaProxy'; import { Base64 } from 'js-base64'; -import { BRANCH } from '../constants'; +import { EDITORIAL } from '../constants'; const API_ROOT = 'https://api.github.com'; @@ -169,7 +169,7 @@ export default class API { .then(branchData => this.updateTree(branchData.commit.sha, '/', fileTree)) .then(changeTree => this.commit(options.commitMessage, changeTree)) .then((response) => { - if (options.mode && options.mode === BRANCH) { + if (options.mode && options.mode === EDITORIAL) { const contentKey = options.collectionName ? `${options.collectionName}-${entry.slug}` : entry.slug; const branchName = `cms/${contentKey}`; return this.createBranch(branchName, response.sha) diff --git a/src/backends/netlify-git/API.js b/src/backends/netlify-git/API.js index ef16c56d..e5e8d28c 100644 --- a/src/backends/netlify-git/API.js +++ b/src/backends/netlify-git/API.js @@ -1,7 +1,7 @@ import LocalForage from 'localforage'; import MediaProxy from '../../valueObjects/MediaProxy'; import { Base64 } from 'js-base64'; -import { BRANCH } from '../constants'; +import { EDITORIAL } from '../constants'; export default class API { constructor(token, url, branch) { @@ -161,7 +161,7 @@ export default class API { .then(branchData => this.updateTree(branchData.commit.sha, '/', fileTree)) .then(changeTree => this.commit(options.commitMessage, changeTree)) .then((response) => { - if (options.mode && options.mode === BRANCH) { + if (options.mode && options.mode === EDITORIAL) { const contentKey = options.collectionName ? `${options.collectionName}-${entry.slug}` : entry.slug; return this.createBranch(`cms/${contentKey}`, response.sha) .then(this.storeMetadata(contentKey, { status: 'draft' }))