From 1a19f8fdaf52056f91fdb8475a8405f96515c561 Mon Sep 17 00:00:00 2001 From: john <johnbarlas39@gmail.com> Date: Sat, 3 Dec 2016 23:47:38 +0200 Subject: [PATCH] use a common config for dev and production --- config/dev.js | 23 +++++------------------ config/production.js | 19 +++++-------------- config/universal.js | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 32 deletions(-) create mode 100644 config/universal.js diff --git a/config/dev.js b/config/dev.js index 8383516..6fa983e 100644 --- a/config/dev.js +++ b/config/dev.js @@ -1,6 +1,6 @@ - const path = require('path') -const editoriaMode = require('../app/authsome_editoria') + +const universal = require('./universal') module.exports = { 'pubsweet-backend': { @@ -9,26 +9,13 @@ module.exports = { API_ENDPOINT: '/api' }, 'pubsweet-frontend': { - theme: 'ThemeEditoria', + theme: universal.theme, routes: 'app/routes.jsx', navigation: 'app/components/Navigation/Navigation.jsx' }, authsome: { - mode: editoriaMode, - teams: { - teamProduction: { - name: 'Production Editor', - permissions: 'all' - }, - teamCopyEditor: { - name: 'Copy Editor', - permissions: 'update' - }, - teamauthors: { - name: 'Author', - permissions: 'update' - } - } + mode: universal.mode, + teams: universal.teams }, pubsweet: { components: ['pubsweet-component-signup', 'pubsweet-component-login'] diff --git a/config/production.js b/config/production.js index 31f7de5..da468a6 100644 --- a/config/production.js +++ b/config/production.js @@ -1,6 +1,6 @@ - const path = require('path') -const blogmode = require('authsome/src/modes/blog') + +const universal = require('./universal') module.exports = { 'pubsweet-backend': { @@ -9,22 +9,13 @@ module.exports = { API_ENDPOINT: '/api' }, 'pubsweet-frontend': { - theme: 'PepperTheme', + theme: universal.theme, routes: 'app/routes.jsx', navigation: 'app/components/Navigation/Navigation.jsx' }, authsome: { - mode: blogmode, - teams: { - teamContributors: { - name: 'Contributors', - permissions: 'create' - }, - teamCoauthors: { - name: 'Coauthors', - permissions: 'update' - } - } + mode: universal.mode, + teams: universal.teams }, pubsweet: { components: ['pubsweet-component-signup', 'pubsweet-component-login'] diff --git a/config/universal.js b/config/universal.js new file mode 100644 index 0000000..3575878 --- /dev/null +++ b/config/universal.js @@ -0,0 +1,20 @@ +const editoriaMode = require('../app/authsome_editoria') + +module.exports = { + mode: editoriaMode, + teams: { + teamProduction: { + name: 'Production Editor', + permissions: 'all' + }, + teamCopyEditor: { + name: 'Copy Editor', + permissions: 'update' + }, + teamauthors: { + name: 'Author', + permissions: 'update' + } + }, + theme: 'ThemeEditoria' +} -- GitLab