You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2018/11/13 09:38:28 UTC

[2/4] brooklyn-ui git commit: Change to radio buttons with help text

Change to radio buttons with help text

Signed-off-by: Andrew Donald Kennedy <an...@cloudsoftcorp.com>


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/0804c5c3
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/0804c5c3
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/0804c5c3

Branch: refs/heads/master
Commit: 0804c5c3d634312bf59233f7d7f10da814f34b8d
Parents: a8c0075
Author: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Authored: Mon Nov 12 16:09:23 2018 +0000
Committer: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Committed: Mon Nov 12 16:09:23 2018 +0000

----------------------------------------------------------------------
 .../catalog-saver/catalog-saver.directive.js          | 10 ++--------
 .../catalog-saver/catalog-saver.modal.template.html   | 14 +++++++++-----
 .../app/views/main/main.controller.js                 |  3 +--
 3 files changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/0804c5c3/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 83be9f7..be846ac 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
@@ -70,8 +70,7 @@ export function saveToCatalogModalDirective($rootScope, $uibModal, $injector, co
             // Reset the config values if this is not an update
             $scope.isUpdate = Object.keys($scope.config).length > ($scope.config.label ? 1 : 0);
             if (!$scope.isUpdate) {
-                $scope.config.template = true;
-                $scope.config.entity = false;
+                $scope.config.itemType = 'template';
             }
 
             // Set various properties from the blueprint entity data
@@ -163,15 +162,10 @@ export function CatalogItemModalController($scope, blueprintService, paletteApi,
 
         let bomItem = {
             id: $scope.config.symbolicName,
+            itemType: $scope.config.itemType,
             item: blueprint
         };
 
-        // Set the itemType to the correct value or leave out entirely if config undefined
-        let itemType = $scope.config.entity ? 'entity' : $scope.config.template ? 'template' : undefined;
-        if (itemType) {
-            bomItem.itemType = itemType;
-        }
-
         if (brUtilsGeneral.isNonEmpty($scope.config.name)) {
             bomItem.name = $scope.config.name;
         }

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/0804c5c3/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 94309d2..6690456 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
@@ -72,20 +72,24 @@
                     <span ng-if="form.symbolicName.$error.required">You must specify a blueprint symbolic name</span>
                     <span ng-if="form.symbolicName.$error.pattern">The blueprint symbolic name can contains only letters, numbers as well a the following characters: <code>.</code>, <code>-</code> and <code>_</code></span>
                 </p>
-            </div>>
+            </div>
 
             <div class="form-group">
                 <label class="control-label">Blueprint type</label>
                 <div class="checkbox">
                     <label>
-                        <input ng-model="config.template" ng-disabled="state.saving" name="template" type="checkbox" ng-change="config.template && (config.entity = !config.template)" />
-                        Save this as a template displayable in quick-launch
+                        <input ng-model="config.itemType" ng-disabled="state.saving" name="itemType" type="radio" value="template" />
+                        Template
+                        <i class="fa fa-fw fa-info-circle" popover-trigger="'mouseenter'"
+                           uib-popover="Save as 'template' which can be used as an editable starting point for other blueprints or quick-launched directly"></i>
                     </label>
                 </div>
                 <div class="checkbox">
                     <label>
-                        <input ng-model="config.entity" ng-disabled="state.saving" name="entity" type="checkbox" ng-change="config.entity && (config.template = !config.entity)" />
-                        Store this blueprint as an extension to the referenced entities
+                        <input ng-model="config.itemType" ng-disabled="state.saving" name="itemType" type="radio" value="entity" />
+                        Entity
+                        <i class="fa fa-fw fa-info-circle" popover-trigger="'mouseenter'"
+                           uib-popover="Save as a new 'entity' type which can be used in blueprints"></i>
                     </label>
                 </div>
             </div>

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/0804c5c3/ui-modules/blueprint-composer/app/views/main/main.controller.js
----------------------------------------------------------------------
diff --git a/ui-modules/blueprint-composer/app/views/main/main.controller.js b/ui-modules/blueprint-composer/app/views/main/main.controller.js
index 598fca8..d4204f8 100644
--- a/ui-modules/blueprint-composer/app/views/main/main.controller.js
+++ b/ui-modules/blueprint-composer/app/views/main/main.controller.js
@@ -109,8 +109,7 @@ export function MainController($scope, $element, $log, $state, $stateParams, brB
             bundle: edit.bundle.symbolicName.replace(/^catalog-bom-/, ''),
             version: edit.type.version,
             symbolicName: edit.type.symbolicName,
-            entity: !edit.type.template,
-            template: edit.type.template,
+            itemType: edit.type.template ? 'template' : 'entity',
             name: edit.type.displayName,
             description: edit.type.description,
             iconUrl: edit.type.iconUrl,