Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: Apps enable after app installed #15202

Merged
merged 3 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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