Fixed previous, next and deploy button issue

Change-Id: I4c41d8779433407a71992b55f62ce1d9359021c6
This commit is contained in:
Chi Zhang 2014-09-24 16:29:26 -07:00
parent 9efc8791f7
commit 6e456f1726

View File

@ -259,13 +259,13 @@ angular.module('compass.wizard', [
$scope.stepForward = function() {
$scope.pendingStep = $scope.currentStep + 1;;
$scope.triggerCommit($scope.currentStep);
$scope.triggerCommit($scope.currentStep,$scope.pendingStep);
};
// go to previous step
$scope.stepBackward = function() {
$scope.pendingStep = $scope.currentStep - 1;
$scope.triggerCommit($scope.currentStep);
$scope.triggerCommit($scope.currentStep,$scope.pendingStep);
};
// go to step by stepId
@ -1645,21 +1645,12 @@ angular.module('compass.wizard', [
}, function(newCommitState, oldCommitState) {
if (newCommitState !== undefined) {
if (newCommitState.name == "review" && newCommitState.state == "triggered") {
$scope.commit(newCommitState.sendRequest);
$scope.commit();
}
}
});
$scope.commit = function() {
if (!sendRequest) {
var commitState = {
"name": "review",
"state": "goToPreviousStep",
"message": ""
};
wizardFactory.setCommitState(commitState);
return;
}
var reviewAction = {
"review": {
"hosts": []