Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ export function MainController($scope, $element, $log, $state, $stateParams, brB

if (yaml) {
$scope.initialYamlFormat = $stateParams.format;
if(Array.isArray(edit.type.specList) && edit.type.specList.length > 0 && edit.type.specList[0].format === $stateParams.format) {
yaml = edit.type.specList[0].contents;
}

if (vm.isYamlMode()) {
// don't set blueprint; yaml mode will take from "initial yaml"
Expand Down
1 change: 1 addition & 0 deletions ui-modules/catalog/app/views/bundle/type/type.state.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export function typeController($scope, $state, $stateParams, $q, $uibModal, brBr
$scope.bundle = responses[0];
$scope.type = responses[1];
this.specItem = $scope.type.specList[0];
$scope.typeFormat = this.specItem.format ? 'format=' + this.specItem.format + '&' : '';
$scope.versions = responses[2].map(typeVersion => {
return {
bundleSymbolicName: typeVersion.containingBundle.split(':')[0],
Expand Down
4 changes: 2 additions & 2 deletions ui-modules/catalog/app/views/bundle/type/type.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ <h4 class="media-heading">
<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?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?{{typeFormat}}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?bundleSymbolicName={{type.containingBundle.split(':')[0]}}&bundleVersion={{type.containingBundle.split(':')[1]}}&typeSymbolicName={{type.symbolicName}}&typeVersion={{type.version}}">Using YAML editor</a>
<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>
</li>
<li role="menuitem" ng-if="type.supertypes.includes('org.apache.brooklyn.api.location.Location')">
<a ng-href="brooklyn-ui-location-manager/#!/location?symbolicName={{type.symbolicName}}&version={{type.version}}">Using location manager</a>
Expand Down