Skip to content

Commit

Permalink
CHE-5237 fix state for 'create workspace' button
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <oorel@codenvy.com>
  • Loading branch information
Oleksii Orel committed Jun 8, 2017
1 parent 2c9f78f commit 6e3f448
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export class WorkspaceRecipeAuthoringController {
}
}

isRecipeValid(): boolean {
return this.recipeValidationError.length === 0;
}

onRecipeChange(): void {
this.$timeout(() => {
this.detectFormat(this.recipeScriptCopy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
che-name="recipe"
type="hidden"
ng-model="workspaceRecipeAuthoringController.recipeScriptCopy"
custom-validator="workspaceRecipeAuthoringController.isRecipeValid()"
ng-required>
<che-error-messages che-message-scope="workspace-details-environment"
che-message-name="Recipe content">
<div ng-message="required">The recipe is required.</div>
<div ng-message="customValidator">{{workspaceRecipeAuthoringController.recipeValidationError}}</div>
</che-error-messages>
</che-input>
<div class="errors-container"
ng-if="workspaceRecipeAuthoringController.recipeValidationError">
{{workspaceRecipeAuthoringController.recipeValidationError}}
</div>
<div class="recipe-docs-link">
<a ng-href="{{workspaceRecipeAuthoringController.stackDocsUrl}}" target="_blank">Custom stack documentation</a>
</div>
Expand Down

0 comments on commit 6e3f448

Please sign in to comment.