-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch add to project to a dropdown menu
- Loading branch information
Showing
18 changed files
with
728 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
'use strict'; | ||
|
||
(function() { | ||
angular.module('openshiftConsole').component('deployImageDialog', { | ||
controller: [ | ||
'$scope', | ||
'DataService', | ||
DeployImageDialog | ||
], | ||
controllerAs: '$ctrl', | ||
bindings: { | ||
visible: '<', | ||
project: '<', //handle create project optionally | ||
context: '<', | ||
onDialogClosed: '&' | ||
}, | ||
templateUrl: 'views/directives/deploy-image-dialog.html' | ||
}); | ||
|
||
function DeployImageDialog($scope, DataService) { | ||
var ctrl = this; | ||
|
||
ctrl.$onInit = function() { | ||
ctrl.alerts = {}; | ||
ctrl.loginBaseUrl = DataService.openshiftAPIBaseUrl(); | ||
ctrl.currentStep = "Image"; | ||
}; | ||
|
||
ctrl.deployImage = function() { | ||
$scope.$broadcast('newAppFromDeployImage'); | ||
}; | ||
|
||
$scope.$on('deployImageNewAppCreated', function(event, message) { | ||
ctrl.selectedProject = message.project; | ||
ctrl.currentStep = "Results"; | ||
}); | ||
|
||
ctrl.close = function() { | ||
var cb = ctrl.onDialogClosed(); | ||
if (_.isFunction(cb)) { | ||
cb(); | ||
} | ||
ctrl.wizardDone = false; | ||
return true; | ||
}; | ||
|
||
$scope.$on("wizard:stepChanged", function (e, parameters) { | ||
if (parameters.step.stepId === 'results') { | ||
ctrl.nextButtonTitle = "Close"; | ||
ctrl.wizardDone = true; | ||
} else { | ||
ctrl.nextButtonTitle = "Deploy"; | ||
} | ||
}); | ||
|
||
ctrl.nextCallback = function (step) { | ||
if (step.stepId === 'image') { | ||
ctrl.deployImage(); | ||
return false; // don't actually navigate yet | ||
} | ||
else if (step.stepId === 'results') { | ||
ctrl.close(); | ||
} | ||
return true; | ||
}; | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.