mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 17:04:59 +03:00
Removed apps from update-check
no-issue This only read external apps, so can be removed now we don't support them
This commit is contained in:
parent
f74d459dad
commit
0d40952232
@ -18,7 +18,6 @@
|
||||
// - post count - total number of posts
|
||||
// - user count - total number of users
|
||||
// - theme - name of the currently active theme
|
||||
// - apps - names of any active apps
|
||||
|
||||
const crypto = require('crypto'),
|
||||
exec = require('child_process').exec,
|
||||
@ -97,23 +96,12 @@ function updateCheckData() {
|
||||
return Promise.props({
|
||||
hash: api.settings.read(_.extend({key: 'db_hash'}, internal)).reflect(),
|
||||
theme: api.settings.read(_.extend({key: 'active_theme'}, internal)).reflect(),
|
||||
apps: api.settings.read(_.extend({key: 'active_apps'}, internal))
|
||||
.then(function (response) {
|
||||
var apps = response.settings[0];
|
||||
|
||||
apps = JSON.parse(apps.value);
|
||||
|
||||
return _.reduce(apps, function (memo, item) {
|
||||
return memo === '' ? memo + item : memo + ', ' + item;
|
||||
}, '');
|
||||
}).reflect(),
|
||||
posts: api.posts.browse().reflect(),
|
||||
users: api.users.browse(internal).reflect(),
|
||||
npm: Promise.promisify(exec)('npm -v').reflect()
|
||||
}).then(function (descriptors) {
|
||||
var hash = descriptors.hash.value().settings[0],
|
||||
theme = descriptors.theme.value().settings[0],
|
||||
apps = descriptors.apps.value(),
|
||||
posts = descriptors.posts.value(),
|
||||
users = descriptors.users.value(),
|
||||
npm = descriptors.npm.value(),
|
||||
@ -122,7 +110,6 @@ function updateCheckData() {
|
||||
|
||||
data.blog_id = crypto.createHash('md5').update(blogId).digest('hex');
|
||||
data.theme = theme ? theme.value : '';
|
||||
data.apps = apps || '';
|
||||
data.post_count = posts && posts.meta && posts.meta.pagination ? posts.meta.pagination.total : 0;
|
||||
data.user_count = users && users.users && users.users.length ? users.users.length : 0;
|
||||
data.blog_created_at = users && users.users && users.users[0] && users.users[0].created_at ? moment(users.users[0].created_at).unix() : '';
|
||||
|
@ -132,7 +132,6 @@ describe('Update Check', function () {
|
||||
data.blog_id.should.be.a.String();
|
||||
data.blog_id.should.not.be.empty();
|
||||
data.theme.should.be.equal('casper');
|
||||
data.apps.should.be.a.String();
|
||||
data.blog_created_at.should.be.a.Number();
|
||||
data.user_count.should.be.above(0);
|
||||
data.post_count.should.be.above(0);
|
||||
|
@ -6,36 +6,7 @@ const should = require('should'),
|
||||
routing = require('../../../../server/services/routing');
|
||||
|
||||
describe('Apps', function () {
|
||||
var fakeApi;
|
||||
|
||||
beforeEach(function () {
|
||||
fakeApi = {
|
||||
posts: {
|
||||
browse: sinon.stub(),
|
||||
read: sinon.stub(),
|
||||
edit: sinon.stub(),
|
||||
add: sinon.stub(),
|
||||
destroy: sinon.stub()
|
||||
},
|
||||
users: {
|
||||
browse: sinon.stub(),
|
||||
read: sinon.stub(),
|
||||
edit: sinon.stub()
|
||||
},
|
||||
tags: {
|
||||
all: sinon.stub()
|
||||
},
|
||||
notifications: {
|
||||
destroy: sinon.stub(),
|
||||
add: sinon.stub()
|
||||
},
|
||||
settings: {
|
||||
browse: sinon.stub(),
|
||||
read: sinon.stub(),
|
||||
add: sinon.stub()
|
||||
}
|
||||
};
|
||||
|
||||
sinon.stub(routing.registry, 'getRouter').withArgs('appRouter').returns({
|
||||
mountRouter: sinon.stub()
|
||||
});
|
||||
@ -64,30 +35,6 @@ describe('Apps', function () {
|
||||
should.exist(appProxy.helpers);
|
||||
should.exist(appProxy.helpers.register);
|
||||
should.exist(appProxy.helpers.registerAsync);
|
||||
|
||||
should.exist(appProxy.api);
|
||||
|
||||
should.exist(appProxy.api.posts);
|
||||
should.exist(appProxy.api.posts.browse);
|
||||
should.exist(appProxy.api.posts.read);
|
||||
should.exist(appProxy.api.posts.edit);
|
||||
should.exist(appProxy.api.posts.add);
|
||||
should.exist(appProxy.api.posts.destroy);
|
||||
|
||||
should.not.exist(appProxy.api.users);
|
||||
|
||||
should.exist(appProxy.api.tags);
|
||||
should.exist(appProxy.api.tags.browse);
|
||||
|
||||
should.exist(appProxy.api.notifications);
|
||||
should.exist(appProxy.api.notifications.browse);
|
||||
should.exist(appProxy.api.notifications.add);
|
||||
should.exist(appProxy.api.notifications.destroy);
|
||||
|
||||
should.exist(appProxy.api.settings);
|
||||
should.exist(appProxy.api.settings.browse);
|
||||
should.exist(appProxy.api.settings.read);
|
||||
should.exist(appProxy.api.settings.edit);
|
||||
});
|
||||
|
||||
it('allows filter registration', function (done) {
|
||||
|
Loading…
Reference in New Issue
Block a user