From 6e3f448892e7d65d7fda409f90dbb3ea1ff9e469 Mon Sep 17 00:00:00 2001 From: Oleksii Orel Date: Thu, 8 Jun 2017 16:08:39 +0300 Subject: [PATCH] CHE-5237 fix state for 'create workspace' button Signed-off-by: Oleksii Orel --- .../workspace-recipe-authoring.controller.ts | 4 ++++ .../recipe-authoring/workspace-recipe-authoring.html | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.controller.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.controller.ts index 93c4618dcd2..ea114196601 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.controller.ts @@ -131,6 +131,10 @@ export class WorkspaceRecipeAuthoringController { } } + isRecipeValid(): boolean { + return this.recipeValidationError.length === 0; + } + onRecipeChange(): void { this.$timeout(() => { this.detectFormat(this.recipeScriptCopy); diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.html b/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.html index 254c39994f8..6eee42e0da0 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.html +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/recipe-authoring/workspace-recipe-authoring.html @@ -10,16 +10,14 @@ che-name="recipe" type="hidden" ng-model="workspaceRecipeAuthoringController.recipeScriptCopy" + custom-validator="workspaceRecipeAuthoringController.isRecipeValid()" ng-required>
The recipe is required.
+
{{workspaceRecipeAuthoringController.recipeValidationError}}
-
- {{workspaceRecipeAuthoringController.recipeValidationError}} -