You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by iu...@apache.org on 2021/09/01 14:48:39 UTC

[brooklyn-ui] branch master updated: fix bug where "continue" button doesn't always refresh the composer

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 87d7119  fix bug where "continue" button doesn't always refresh the composer
     new 0eaa2ba  Merge pull request #278 from ahgittin/fix-composer-refresh-continue-after-catalog-add
87d7119 is described below

commit 87d7119153583b6fdd0ed0182c3457a6350ed85f
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Wed Sep 1 14:40:18 2021 +0100

    fix bug where "continue" button doesn't always refresh the composer
---
 .../app/components/catalog-saver/catalog-saver.directive.js         | 6 +++++-
 .../app/components/catalog-saver/catalog-saver.modal.template.html  | 2 +-
 ui-modules/blueprint-composer/app/views/main/main.controller.js     | 5 ++++-
 3 files changed, 10 insertions(+), 3 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 acfcfbd..c7b6bdc 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
@@ -30,7 +30,8 @@ const TEMPLATE_MODAL_URL = 'blueprint-composer/component/catalog-saver/modal.htm
 
 const REASONS = {
     new: 0,
-    deploy: 1
+    deploy: 1,
+    continue: 2,
 };
 const VIEWS = {
     form: 0,
@@ -127,6 +128,9 @@ export function saveToCatalogModalDirective($rootScope, $uibModal, $injector, $f
                     case REASONS.deploy:
                         $rootScope.$broadcast('blueprint.deploy');
                         break;
+                    case REASONS.continue:
+                        $rootScope.$broadcast('blueprint.continue');
+                        break;
                 }
             });
         };
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 4a463b4..4f82358 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
@@ -120,7 +120,7 @@
 
         <div class="next-actions">
             <p>What would you like to do next?</p>
-            <button class="btn btn-default btn-block" ng-click="$dismiss('Continue editing')">Continue to edit this blueprint</button>
+            <button class="btn btn-default btn-block" ng-click="$close(REASONS.continue)">Continue to edit this blueprint</button>
             <button class="btn btn-info btn-block" ng-click="$close(REASONS.new)">Create a new blueprint</button>
             <a class="btn btn-primary btn-block" ng-href="{{catalogURL}}">View in catalog</a>
             <button ng-if="['template', 'entity'].indexOf(config.itemType) > -1" class="btn btn-link btn-block" ng-click="$close(REASONS.deploy)">Or deploy</button>
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 000ddc0..85e2722 100644
--- a/ui-modules/blueprint-composer/app/views/main/main.controller.js
+++ b/ui-modules/blueprint-composer/app/views/main/main.controller.js
@@ -158,11 +158,14 @@ export function MainController($scope, $element, $log, $state, $stateParams, brB
     $scope.$on('blueprint.reset', () => {
         vm.saveToCatalogConfig = {};
         blueprintService.reset();
-        $state.go(vm.isYamlMode() ? $state : graphicalState, {}, {inherit: false, reload: true});
+        $state.go(vm.isYamlMode() ? $state.current : graphicalState, {}, {inherit: false, reload: true});
     });
     $scope.$on('blueprint.deploy', () => {
         vm.deployApplication();
     });
+    $scope.$on('blueprint.continue', () => {
+        blueprintService.refreshBlueprintMetadata();
+    });
 
     vm.saveToCatalogConfig = {};
     if (edit) {