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 a5a4a99  Smart-121 part 2 fix. Graphical editor needs original yaml, 
no format.
a5a4a99 is described below

commit a5a4a99a32d16b396e3f38ba4481e4114701fa81
Author: iuliana <[email protected]>
AuthorDate: Tue Jun 15 11:29:34 2021 +0100

    Smart-121 part 2 fix. Graphical editor needs original yaml, no format.
---
 ui-modules/blueprint-composer/app/views/main/main.controller.js | 8 ++++++--
 ui-modules/catalog/app/views/bundle/type/type.template.html     | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

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 969e0d5..03590d1 100644
--- a/ui-modules/blueprint-composer/app/views/main/main.controller.js
+++ b/ui-modules/blueprint-composer/app/views/main/main.controller.js
@@ -153,9 +153,13 @@ export function MainController($scope, $element, $log, 
$state, $stateParams, brB
             // or in other words, for other items, DO set these
             vm.saveToCatalogConfig = Object.assign(vm.saveToCatalogConfig, 
vm.saveToCatalogConfig.original); 
         }
-        
-        yaml = edit.type.plan.data;
+
         $scope.initialYamlFormat = edit.type.plan.format;
+        if($scope.initialYamlFormat && Array.isArray(edit.type.specList) && 
edit.type.specList.length > 0 && edit.type.specList[0].format === 
$scope.initialYamlFormat) {
+            yaml = edit.type.specList[0].contents;
+        }  else {
+            yaml = edit.type.plan.data;
+        }
     }
 
     vm.isTabActive = stateKey => {
diff --git a/ui-modules/catalog/app/views/bundle/type/type.template.html 
b/ui-modules/catalog/app/views/bundle/type/type.template.html
index 161ba6b..8ba893b 100644
--- a/ui-modules/catalog/app/views/bundle/type/type.template.html
+++ b/ui-modules/catalog/app/views/bundle/type/type.template.html
@@ -77,7 +77,7 @@
                     <button uib-dropdown-toggle type="button" class="btn 
btn-primary"><i class="fa fa-fw fa-edit"></i> Edit <span 
class="caret"></span></button>
                     <ul class="dropdown-menu dropdown-menu-right" 
uib-dropdown-menu role="menu" aria-labelledby="edit-dropdown">
                         <li role="menuitem" 
ng-if="type.supertypes.includes('org.apache.brooklyn.api.entity.Entity') && 
composerUrl">
-                            <a ng-href="{{ composerUrl 
}}#!/graphical?{{typeFormat}}bundleSymbolicName={{type.containingBundle.split(':')[0]}}&bundleVersion={{type.containingBundle.split(':')[1]}}&typeSymbolicName={{type.symbolicName}}&typeVersion={{type.version}}">Using
 graphical designer</a>
+                            <a ng-href="{{ composerUrl 
}}#!/graphical?bundleSymbolicName={{type.containingBundle.split(':')[0]}}&bundleVersion={{type.containingBundle.split(':')[1]}}&typeSymbolicName={{type.symbolicName}}&typeVersion={{type.version}}">Using
 graphical designer</a>
                         </li>
                         <li role="menuitem" 
ng-if="type.supertypes.includes('org.apache.brooklyn.api.entity.Entity') && 
composerUrl">
                             <a ng-href="{{ composerUrl 
}}#!/yaml?{{typeFormat}}bundleSymbolicName={{type.containingBundle.split(':')[0]}}&bundleVersion={{type.containingBundle.split(':')[1]}}&typeSymbolicName={{type.symbolicName}}&typeVersion={{type.version}}">Using
 YAML editor</a>

Reply via email to