address PR comments
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/176ab914 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/176ab914 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/176ab914 Branch: refs/heads/master Commit: 176ab914c1c2da475f8ca8ebfd87756a6d1e13a1 Parents: abd5b43 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Authored: Tue Nov 20 10:04:08 2018 +0000 Committer: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Committed: Tue Nov 20 10:04:08 2018 +0000 ---------------------------------------------------------------------- .../app/components/catalog-saver/catalog-saver.directive.js | 9 +++++---- .../catalog-saver/catalog-saver.modal.template.html | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/176ab914/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js ---------------------------------------------------------------------- diff --git a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js index adc3f42..435d758 100644 --- a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js +++ b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js @@ -44,7 +44,7 @@ const TYPES = [ angular.module(MODULE_NAME, [angularAnimate, uibModal, brUtils]) .directive('catalogSaver', ['$rootScope', '$uibModal', '$injector', '$filter', 'composerOverrides', 'blueprintService', saveToCatalogModalDirective]) .directive('catalogVersion', ['$parse', catalogVersionDirective]) - .directive('blueprintNameOrSymbolicNameAndBundleIdRequired', blueprintNameOrSymbolicNameAndBundleIdRequiredDirective) + .directive('composerBlueprintNameValidator', composerBlueprintNameValidatorDirective) .filter('bundlize', bundlizeProvider) .run(['$templateCache', templateCache]); @@ -210,7 +210,7 @@ export function CatalogItemModalController($scope, $filter, blueprintService, pa $scope.defaultSymbolicName = ($scope.config.itemType==='template' && $scope.config.original.symbolicName) || bundlize(newName) || null; $scope.defaultBundle = ($scope.config.itemType==='template' && $scope.config.original.bundle) || bundlize(newName) || null; }; - $scope.$watchGroup(['config.name', 'config.itemType'], (newVals) => { + $scope.$watchGroup(['config.name', 'config.itemType', 'config.bundle', 'config.symbolicName'], (newVals) => { $scope.updateDefaults(newVals[0]); $scope.form.name.$validate(); $scope.buttonText = $scope.buttonTextFn(); @@ -218,13 +218,14 @@ export function CatalogItemModalController($scope, $filter, blueprintService, pa }); } -function blueprintNameOrSymbolicNameAndBundleIdRequiredDirective() { +function composerBlueprintNameValidatorDirective() { return { restrict: 'A', require: 'ngModel', link: function(scope, element, attr, ngModel) { - ngModel.$validators.blueprintNameOrSymbolicNameAndBundleIdRequired = function(modelValue, viewValue) { + ngModel.$validators.composerBlueprintNameValidator = function(modelValue, viewValue) { scope.updateDefaults(modelValue); + console.log("valildating", scope.config.bundle, scope.config.symbolicName); if (!ngModel.$isEmpty(modelValue)) { // anything set is valid return true; http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/176ab914/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html ---------------------------------------------------------------------- diff --git a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html index 4b5f626..a0c9c2f 100644 --- a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html +++ b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html @@ -26,7 +26,7 @@ <div class="form-group" ng-class="{'has-error': form.name.$invalid}"> <label class="control-label">Blueprint display name</label> - <input ng-model="config.name" ng-disabled="state.saving" class="form-control" name="name" type="text" placeholder="{{ defaultName }}" blueprint-name-or-symbolic-name-and-bundle-id-required/> + <input ng-model="config.name" ng-disabled="state.saving" class="form-control" name="name" type="text" placeholder="{{ defaultName }}" composer-blueprint-name-validator/> <p class="help-block" ng-show="form.name.$invalid"> <span ng-if="form.name.$invalid">You must specify a name for this item or supply explicit bundle ID and blueprint symbolic name</span> </p> @@ -82,7 +82,7 @@ <input ng-model="config.itemType" ng-disabled="state.saving" name="itemType" type="radio" value="application" /> Application entity <i class="fa fa-fw fa-info-circle" popover-trigger="'mouseenter'" - uib-popover="Save as an application entity which can be configured and used in blueprints or used on its own ('application' item type)"></i> + uib-popover="Save as an application entity which can be deployed on its own, or configured and used in blueprints but only config and sensors declared at the root are accessible in the Composer ('application' item type)"></i> </label> </div> <div class="checkbox">