From 0d40952232ba382e4e1400332f7589e89d0c26db Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Mon, 15 Apr 2019 14:37:24 +0200 Subject: [PATCH] Removed apps from update-check no-issue This only read external apps, so can be removed now we don't support them --- core/server/update-check.js | 13 ----- .../update-check/update_check_spec.js | 1 - core/test/unit/services/apps/proxy_spec.js | 53 ------------------- 3 files changed, 67 deletions(-) diff --git a/core/server/update-check.js b/core/server/update-check.js index 6112c284ee..34ab30b8a8 100644 --- a/core/server/update-check.js +++ b/core/server/update-check.js @@ -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() : ''; diff --git a/core/test/regression/update-check/update_check_spec.js b/core/test/regression/update-check/update_check_spec.js index 25094261a2..d11b95be41 100644 --- a/core/test/regression/update-check/update_check_spec.js +++ b/core/test/regression/update-check/update_check_spec.js @@ -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); diff --git a/core/test/unit/services/apps/proxy_spec.js b/core/test/unit/services/apps/proxy_spec.js index 7328809d74..20552be48e 100644 --- a/core/test/unit/services/apps/proxy_spec.js +++ b/core/test/unit/services/apps/proxy_spec.js @@ -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) {