From eba799a5f6d9606ec890cd481cf02cf19ca1b6c0 Mon Sep 17 00:00:00 2001 From: Jessica Forrester Date: Fri, 19 May 2017 17:14:44 -0400 Subject: [PATCH] Deploy shouldn't enable to image is loaded --- app/scripts/directives/deployImage.js | 10 ++++ app/scripts/directives/deployImageDialog.js | 2 +- app/views/directives/deploy-image-dialog.html | 52 ++++++++++--------- app/views/directives/deploy-image.html | 5 +- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/app/scripts/directives/deployImage.js b/app/scripts/directives/deployImage.js index 8c84f82549..d32c243cbd 100644 --- a/app/scripts/directives/deployImage.js +++ b/app/scripts/directives/deployImage.js @@ -139,6 +139,8 @@ angular.module("openshiftConsole") return; } + $scope.forms.imageSelection.imageName.$setValidity("imageLoaded", true); + var image = $scope.import.image; if (image) { $scope.app.name = getName(); @@ -170,6 +172,14 @@ angular.module("openshiftConsole") delete $scope.import; $scope.istag = {}; + + if (newMode === 'dockerImage') { + $scope.forms.imageSelection.imageName.$setValidity("imageLoaded", false); + } + else { + // reset this to true so it doesn't block form submission + $scope.forms.imageSelection.imageName.$setValidity("imageLoaded", true); + } }); $scope.$watch('istag', function(istag, old) { diff --git a/app/scripts/directives/deployImageDialog.js b/app/scripts/directives/deployImageDialog.js index 0d6c8da1f6..579b22c8c9 100644 --- a/app/scripts/directives/deployImageDialog.js +++ b/app/scripts/directives/deployImageDialog.js @@ -41,7 +41,7 @@ function DeployImageDialog($scope, DataService) { }; $scope.$on("wizard:stepChanged", function (e, parameters) { - if (parameters.step.stepId === 'next-steps') { + if (parameters.step.stepId === 'results') { ctrl.nextButtonTitle = "Close"; } else { ctrl.nextButtonTitle = "Deploy"; diff --git a/app/views/directives/deploy-image-dialog.html b/app/views/directives/deploy-image-dialog.html index ff44e812d0..f59ce9932a 100644 --- a/app/views/directives/deploy-image-dialog.html +++ b/app/views/directives/deploy-image-dialog.html @@ -1,19 +1,22 @@
+ on-cancel="$ctrl.close()" + on-finish="$ctrl.close()" + hide-header="true" + hide-back-button="true" + hide-sidebar="true" + next-title="$ctrl.nextButtonTitle" + next-callback="$ctrl.nextCallback" + content-height="600">
+ step-title="Image" + step-id="image" + step-priority="1" + substeps="false" + ok-to-nav-away="true" + allow-click-nav="false" + next-enabled="!$ctrl.deployForm.$invalid">
@@ -21,20 +24,19 @@
+ step-title="Results" + step-id="results" + step-priority="2" + substeps="false" + ok-to-nav-away="true" + allow-click-nav="false">
- +
-
-
+ +
diff --git a/app/views/directives/deploy-image.html b/app/views/directives/deploy-image.html index 5ae13d1850..603a4a32f3 100644 --- a/app/views/directives/deploy-image.html +++ b/app/views/directives/deploy-image.html @@ -2,7 +2,7 @@

Deploy an existing image from an image stream tag or docker pull spec.

- +
- +