Skip to content

Commit

Permalink
NEW: Apps enable after install (#15202)
Browse files Browse the repository at this point in the history
* Add auto enable after install

* Change status text for apps in INVALID_SETTINGS_DISABLED state

* Prevent errors when Apps are disabled
  • Loading branch information
d-gubert authored and sampaiodiego committed Aug 20, 2019
1 parent adcc398 commit 429b1ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/apps/client/admin/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export const appStatusSpanProps = ({
return {
type: 'failed',
icon: 'warning',
label: 'Failed',
label: status === AppStatus.INVALID_SETTINGS_DISABLED ? 'Config Needed' : 'Failed',
};
}

Expand Down
2 changes: 1 addition & 1 deletion app/apps/server/communication/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
10 changes: 9 additions & 1 deletion app/apps/server/cron.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 429b1ee

Please sign in to comment.