Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

TEAMFOUR-668 - Show toast on service add in create app flow #504

Merged
merged 2 commits into from
Aug 2, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
this.id = $stateParams.guid;
this.ready = false;
this.warningMsg = gettext('The application needs to be restarted for highlighted variables to be added to the runtime.');
this.UPDATE_INTERVAL = 1000; // milliseconds
this.UPDATE_INTERVAL = 5000; // milliseconds

this.init();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
AddServiceWorkflowController.$inject = [
'$q',
'$scope',
'$interpolate',
'app.model.modelManager',
'app.event.eventService',
'helion.framework.widgets.detailView'
'helion.framework.widgets.detailView',
'helion.framework.widgets.toaster'
];

/**
Expand All @@ -35,11 +37,15 @@
* @constructor
* @param {object} $q - the Angular $q service
* @param {object} $scope - the Angular $scope service
* @param {object} $interpolate - the Angular $interpolate service
* @param {app.model.modelManager} modelManager - the application model manager
* @param {app.event.eventService} eventService - the event management service
* @param {helion.framework.widgets.detailView} detailView - the detail view widget
* @param {helion.framework.widgets.toaster} toaster - the toast notification service
* @property {object} $q - the Angular $q service
* @property {object} $interpolate - the Angular $interpolate service
* @property {helion.framework.widgets.detailView} detailView - the detail view widget
* @property {helion.framework.widgets.toaster} toaster - the toast notification service
* @property {cloud-foundry.model.application} appModel - the CF application model
* @property {cloud-foundry.model.service-binding} bindingModel - the CF service binding model
* @property {cloud-foundry.model.service-instance} instanceModel - the CF service instance model
Expand All @@ -49,10 +55,12 @@
* @property {string} path - the path to this add-service-workflow folder
* @property {object} addServiceActions - the stop and finish workflow actions
*/
function AddServiceWorkflowController($q, $scope, modelManager, eventService, detailView) {
function AddServiceWorkflowController($q, $scope, $interpolate, modelManager, eventService, detailView, toaster) {
var that = this;
this.$q = $q;
this.$interpolate = $interpolate;
this.detailView = detailView;
this.toaster = toaster;
this.appModel = modelManager.retrieve('cloud-foundry.model.application');
this.bindingModel = modelManager.retrieve('cloud-foundry.model.service-binding');
this.instanceModel = modelManager.retrieve('cloud-foundry.model.service-instance');
Expand Down Expand Up @@ -324,6 +332,13 @@
if (!this.data.confirm) {
this.addService().then(function () {
that.addBinding().then(function () {
// show notification for successful binding
var successMsg = gettext('The {{service}} service has been attached to your {{appName}} application');
var context = {
service: that.options.serviceInstance.entity.name,
appName: that.data.app.summary.name
};
that.toaster.success(that.$interpolate(successMsg)(context), {positionClass: 'toast-top-right'});
that.modal.close();
});
});
Expand Down
4 changes: 3 additions & 1 deletion tools/gulp.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module.exports = function () {
"main": [ "release/angular-link-header-parser.min.js" ]
},
"angular-toastr": {
"main": [ "./dist/angular-toastr.tpls.js" ]
"main": [
"./dist/angular-toastr.tpls.js"
]
}
}
},
Expand Down