Skip to content

Commit

Permalink
馃帹 internalApps -> apps.internal
Browse files Browse the repository at this point in the history
refs #7488

- simply rename the config usage
- we might want to add `apps.external` later
  • Loading branch information
kirrg001 authored and kevinansfield committed May 31, 2017
1 parent 18b71f3 commit e3ef310
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions core/server/apps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ function getInstalledApps() {
return Promise.reject(e);
}

return installed.concat(config.get('internalApps'));
return installed.concat(config.get('apps:internal'));
});
}

function saveInstalledApps(installedApps) {
return getInstalledApps().then(function (currentInstalledApps) {
var updatedAppsInstalled = _.difference(_.uniq(installedApps.concat(currentInstalledApps)), config.get('internalApps'));
var updatedAppsInstalled = _.difference(_.uniq(installedApps.concat(currentInstalledApps)), config.get('apps:internal'));

return api.settings.edit({settings: [{key: 'installed_apps', value: updatedAppsInstalled}]}, {context: {internal: true}});
});
Expand All @@ -45,7 +45,7 @@ module.exports = {

appsToLoad = JSON.parse(aApps.value) || [];

appsToLoad = appsToLoad.concat(config.get('internalApps'));
appsToLoad = appsToLoad.concat(config.get('apps:internal'));
});
} catch (err) {
logging.error(new errors.GhostError({
Expand Down
2 changes: 1 addition & 1 deletion core/server/apps/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var path = require('path'),
loader;

function isInternalApp(name) {
return _.includes(config.get('internalApps'), name);
return _.includes(config.get('apps:internal'), name);
}

// Get the full path to an app by name
Expand Down
2 changes: 1 addition & 1 deletion core/server/blog/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module.exports = function setupBlogApp() {

// setup middleware for internal apps
// @TODO: refactor this to be a proper app middleware hook for internal & external apps
config.get('internalApps').forEach(function (appName) {
config.get('apps:internal').forEach(function (appName) {
var app = require(path.join(config.get('paths').internalAppPath, appName));
if (app.hasOwnProperty('setupMiddleware')) {
app.setupMiddleware(blogApp);
Expand Down
2 changes: 1 addition & 1 deletion core/server/blog/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ frontendRoutes = function frontendRoutes() {

// setup routes for internal apps
// @TODO: refactor this to be a proper app route hook for internal & external apps
config.get('internalApps').forEach(function (appName) {
config.get('apps:internal').forEach(function (appName) {
var app = require(path.join(config.get('paths').internalAppPath, appName));
if (app.hasOwnProperty('setupRoutes')) {
app.setupRoutes(router);
Expand Down
14 changes: 8 additions & 6 deletions core/server/config/overrides.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
"migrationPath": "core/server/data/migrations",
"publicFilePath": "core/server/public"
},
"internalApps": [
"private-blogging",
"subscribers",
"amp",
"default-cards"
],
"apps": {
"internal": [
"private-blogging",
"subscribers",
"amp",
"default-cards"
]
},
"routeKeywords": {
"tag": "tag",
"author": "author",
Expand Down
4 changes: 2 additions & 2 deletions core/server/utils/mobiledoc-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var SimpleDom = require('simple-dom'),
};

// function getCards() {
// return config.get('internalApps').reduce(
// return config.get('apps:internal').reduce(
// function (cards, appName) {
// var app = require(path.join(config.get('paths').internalAppPath, appName));
// if (app.hasOwnProperty('cards')) {
Expand All @@ -25,7 +25,7 @@ var SimpleDom = require('simple-dom'),
// }, [ ]);
// }
// function getAtoms() {
// return config.get('internalApps').reduce(
// return config.get('apps:internal').reduce(
// function (atoms, appName) {
// var app = require(path.join(config.get('paths').internalAppPath, appName));
// if (app.hasOwnProperty('atoms')) {
Expand Down

0 comments on commit e3ef310

Please sign in to comment.