This is an automated email from the ASF dual-hosted git repository.

iuliana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new 8695cb5  Added support for tags being added from the YAML Editor. This 
allows support for spec tags when adding to catalog from the composer
     new c017d62  Merge pull request #219 from iuliana/fix/smart-121
8695cb5 is described below

commit 8695cb5b6b2d783b1d528f350c7844b5975cd39c
Author: iuliana <[email protected]>
AuthorDate: Thu Jun 10 12:03:28 2021 +0100

    Added support for tags being added from the YAML Editor. This allows 
support for spec tags when adding to catalog from the composer
---
 .../components/catalog-saver/catalog-saver.directive.js   | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

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 a53c3a2..980b07d 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
@@ -144,7 +144,7 @@ export function CatalogItemModalController($scope, $filter, 
blueprintService, pa
         pattern: '[\\w\\.\\-\\_]+',
         view: VIEWS.form,
         saving: false,
-        force: false,
+        force: false
     };
 
     $scope.getTitle = () => {
@@ -155,6 +155,7 @@ export function CatalogItemModalController($scope, $filter, 
blueprintService, pa
                 return `${$scope.config.name || $scope.config.symbolicName || 
'Blueprint'} ${$scope.isUpdate() ? 'updated' : 'saved'}`;
         }
     };
+
     $scope.getCatalogURL = () => {
         switch ($scope.state.view) {
             case VIEWS.form:
@@ -165,7 +166,6 @@ export function CatalogItemModalController($scope, $filter, 
blueprintService, pa
     };
 
     $scope.title = $scope.getTitle();
-
     $scope.save = () => {
         $scope.state.saving = true;
         $scope.state.error = undefined;
@@ -185,6 +185,7 @@ export function CatalogItemModalController($scope, $filter, 
blueprintService, pa
         });
     };
 
+
     function createBom() {
         let blueprint = blueprintService.getAsJson();
 
@@ -199,11 +200,21 @@ export function CatalogItemModalController($scope, 
$filter, blueprintService, pa
             itemType: $scope.config.itemType,
             item: blueprint
         };
+        // tags can now be added to a blueprint created in the YAML Editor
+        let tags = [];
+        if(blueprint.tags) {
+            tags = blueprint.tags;
+            delete blueprint['tags'];
+        }
         let bomCatalogYaml = {
             bundle: `catalog-bom-${bundleBase}`,
             version: $scope.config.version,
             items: [ bomItem ]
         };
+        if(tags) {
+            bomCatalogYaml.tags = tags
+        }
+
         let bundleName = $scope.config.name || $scope.defaultName;
         if (brUtilsGeneral.isNonEmpty(bundleName)) {
             bomItem.name = bundleName;

Reply via email to