From 5156f9b1cd4a5e523dd413295594888a01775831 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Mon, 19 Aug 2019 16:39:29 -0300 Subject: [PATCH 1/3] Add auto enable after install --- app/apps/server/communication/rest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/apps/server/communication/rest.js b/app/apps/server/communication/rest.js index 5b0a4f19d40b..43d836c86f15 100644 --- a/app/apps/server/communication/rest.js +++ b/app/apps/server/communication/rest.js @@ -227,7 +227,7 @@ export class AppsRestApi { return API.v1.failure({ error: 'Failed to get a file to install for the App. ' }); } - const aff = Promise.await(manager.add(buff.toString('base64'), false, marketplaceInfo)); + const aff = Promise.await(manager.add(buff.toString('base64'), true, marketplaceInfo)); const info = aff.getAppInfo(); if (aff.hasStorageError()) { From c0004940a811cbc368d877fcd622a905f1383bb9 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Mon, 19 Aug 2019 16:43:16 -0300 Subject: [PATCH 2/3] Change status text for apps in INVALID_SETTINGS_DISABLED state --- app/apps/client/admin/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/apps/client/admin/helpers.js b/app/apps/client/admin/helpers.js index 839974e465ed..6e8c8ab58be9 100644 --- a/app/apps/client/admin/helpers.js +++ b/app/apps/client/admin/helpers.js @@ -335,7 +335,7 @@ export const appStatusSpanProps = ({ return { type: 'failed', icon: 'warning', - label: 'Failed', + label: status === AppStatus.INVALID_SETTINGS_DISABLED ? 'Config Needed' : 'Failed', }; } From 57f3ffe8cf882647a23e67f49f67dd2a0ed31cc4 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Mon, 19 Aug 2019 17:19:11 -0300 Subject: [PATCH 3/3] Prevent errors when Apps are disabled --- app/apps/server/cron.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/apps/server/cron.js b/app/apps/server/cron.js index 0dbed66a9bd3..3e7a1d9cdc7d 100644 --- a/app/apps/server/cron.js +++ b/app/apps/server/cron.js @@ -10,10 +10,14 @@ import { Settings, Users, Roles } from '../../models/server'; const notifyAdminsAboutInvalidApps = Meteor.bindEnvironment(function _notifyAdminsAboutInvalidApps(apps) { + if (!apps) { + return; + } + const hasInvalidApps = !!apps.find((app) => app.getLatestLicenseValidationResult().hasErrors); if (!hasInvalidApps) { - return apps; + return; } const id = 'someAppInInvalidState'; @@ -50,6 +54,10 @@ const notifyAdminsAboutInvalidApps = Meteor.bindEnvironment(function _notifyAdmi }); const notifyAdminsAboutRenewedApps = Meteor.bindEnvironment(function _notifyAdminsAboutRenewedApps(apps) { + if (!apps) { + return; + } + const renewedApps = apps.filter((app) => app.getStatus() === AppStatus.DISABLED && app.getPreviousStatus() === AppStatus.INVALID_LICENSE_DISABLED); if (renewedApps.length === 0) {