Removed members internal app (#10379)

no-issue

* Mounted members static router directly to parentApp

* Removed members internal app
This commit is contained in:
Fabien O'Carroll 2019-01-17 12:03:40 +01:00 committed by GitHub
parent 909f9012ed
commit 42a1313bff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 21 deletions

View File

@ -1,12 +0,0 @@
const membersService = require('../../services/members');
const labs = require('../../services/labs');
module.exports = {
activate() {},
setupMiddleware(router) {
if (labs.isSet('members')) {
router.use('/members', membersService.api.staticRouter);
}
}
};

View File

@ -17,8 +17,7 @@
"internal": [
"private-blogging",
"subscribers",
"amp",
"members"
"amp"
]
},
"slugs": {

View File

@ -4,6 +4,8 @@ const config = require('../config');
const compress = require('compression');
const netjet = require('netjet');
const shared = require('./shared');
const labs = require('../services/labs');
const membersService = require('../services/members');
module.exports = function setupParentApp(options = {}) {
debug('ParentApp setup start');
@ -46,6 +48,11 @@ module.exports = function setupParentApp(options = {}) {
// ADMIN
parentApp.use('/ghost', require('./admin')());
// MEMBERS
if (labs.isSet('members')) {
parentApp.use('/members', membersService.api.staticRouter);
}
// BLOG
parentApp.use(require('./site')(options));

View File

@ -47,15 +47,14 @@ describe('Apps', function () {
settingsEditStub.callCount.should.eql(0);
// Test that activate is called 4 times, and install 0 time
loaderActivateStub.callCount.should.eql(4);
loaderActivateStub.callCount.should.eql(3);
loaderInstallStub.callCount.should.eql(0);
// Test that the 4 internal apps are loaded as expected
availableApps.should.be.an.Array().with.lengthOf(4);
availableApps.should.be.an.Array().with.lengthOf(3);
availableApps.should.containEql('amp');
availableApps.should.containEql('private-blogging');
availableApps.should.containEql('subscribers');
availableApps.should.containEql('members');
done();
})
@ -81,15 +80,14 @@ describe('Apps', function () {
settingsEditStub.firstCall.args[0].settings[0].value.should.eql(['testA', 'testB']);
// Test that activate is called 6 times, and install only 1 time
loaderActivateStub.callCount.should.eql(6);
loaderActivateStub.callCount.should.eql(5);
loaderInstallStub.callCount.should.eql(1);
// Test that the 4 internal apps are loaded as expected
availableApps.should.be.an.Array().with.lengthOf(6);
// Test that the 5 internal apps are loaded as expected
availableApps.should.be.an.Array().with.lengthOf(5);
availableApps.should.containEql('amp');
availableApps.should.containEql('private-blogging');
availableApps.should.containEql('subscribers');
availableApps.should.containEql('members');
availableApps.should.containEql('testA');
availableApps.should.containEql('testB');