diff --git a/src/views/apps.js b/src/views/apps.js
index 0017796f9..d7fc1dee0 100644
--- a/src/views/apps.js
+++ b/src/views/apps.js
@@ -313,6 +313,30 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
message: ''
};
+ $scope.appPostInstallConfirm = {
+ app: {},
+ message: '',
+ confirmed: false,
+
+ show: function (app) {
+ $scope.reset();
+
+ $scope.appPostInstallConfirm.app = app;
+ $scope.appPostInstallConfirm.message = app.manifest.postInstallMessage;
+
+ $('#appPostInstallConfirmModal').modal('show');
+
+ return false; // prevent propagation and default
+ },
+
+ submit: function () {
+ $scope.appPostInstallConfirm.app.pendingPostInstallConfirmation = false;
+ delete localStorage['confirmPostInstall_' + $scope.appPostInstallConfirm.app.id];
+
+ $('#appPostInstallConfirmModal').modal('hide');
+ }
+ };
+
$scope.appError = {
app: {}
};
@@ -333,6 +357,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$('#appUpdateModal').modal('hide');
$('#appInfoModal').modal('hide');
$('#appUninstallModal').modal('hide');
+ $('#appPostInstallConfirmModal').modal('hide');
// reset configure dialog
$scope.appConfigure.error = {};
@@ -383,6 +408,11 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
$scope.appRestore.portBindingsInfo = {};
$scope.appRestore.portBindingsEnabled = {};
$scope.appRestore.action = 'restore';
+
+ // post install confirmation dialog
+ $scope.appPostInstallConfirm.app = {};
+ $scope.appPostInstallConfirm.message = '';
+ $scope.appPostInstallConfirm.confirmed = false;
};
$scope.readCertificate = function (event) {
diff --git a/src/views/appstore.js b/src/views/appstore.js
index 90dc613c8..f4ce3b1e8 100644
--- a/src/views/appstore.js
+++ b/src/views/appstore.js
@@ -161,7 +161,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
// add sso property for the postInstall message to be shown correctly
$scope.appInstall.app.sso = data.sso;
- Client.installApp($scope.appInstall.app.id, $scope.appInstall.app.manifest, $scope.appInstall.app.title, data, function (error) {
+ Client.installApp($scope.appInstall.app.id, $scope.appInstall.app.manifest, $scope.appInstall.app.title, data, function (error, newAppId) {
if (error) {
if (error.statusCode === 402) {
$scope.appInstall.state = 'appLimitReached';
@@ -191,6 +191,9 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$scope.appInstall.busy = false;
+ // stash new app id for later
+ $scope.appInstall.app.id = newAppId;
+
$scope.appInstall.postInstall();
});
},
@@ -200,6 +203,11 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$scope.appInstall.state = 'postInstall';
$('#collapseInstallForm').collapse('hide');
$('#postInstallMessage').collapse('show');
+
+ // we track the postinstall confirmation for the current user's browser
+ // TODO later we might want to have a notification db to track the state across admins and browsers
+ localStorage['confirmPostInstall_' + $scope.appInstall.app.id] = true;
+
return;
}