This is an automated email from the ASF dual-hosted git repository.
heneveld 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 20ba7e71 make quick launch deploy act exactly like catalog deploy
20ba7e71 is described below
commit 20ba7e7127366fc2bb9fc5f559fccb109365bda8
Author: Alex Heneveld <[email protected]>
AuthorDate: Thu Jul 11 13:11:24 2024 +0100
make quick launch deploy act exactly like catalog deploy
---
ui-modules/catalog/app/views/bundle/type/type.state.js | 15 +++++++++------
.../home/app/views/main/deploy/deploy.controller.js | 18 ++++++++++++++++--
ui-modules/utils/quick-launch/quick-launch.less | 1 +
3 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/ui-modules/catalog/app/views/bundle/type/type.state.js
b/ui-modules/catalog/app/views/bundle/type/type.state.js
index e5d4f3bf..dc2eb12b 100644
--- a/ui-modules/catalog/app/views/bundle/type/type.state.js
+++ b/ui-modules/catalog/app/views/bundle/type/type.state.js
@@ -126,23 +126,26 @@ export function typeController($scope, $state,
$stateParams, $q, $uibModal, brBr
$scope.bundle = responses[0];
$scope.type = responses[1];
- // this is the initially selected item in the dropdown of the
definition
- const specItem = this.specItem = $scope.type.specList[0];
-
+ const entitySpec = $scope.type;
+ // update entity spec to keep the right format (repeated in home
deploy.controller.js)
+ const specItem = entitySpec.specList[0];
// if the implementation plan does not declare its format but the
first spec list item does
// then we should replace the low-level implementation plan (probably
auto-generated) with
// the first spec list item (which is what the user created)
- var preferredContents = $scope.type.plan && $scope.type.plan.data;
- var preferredFormat = $scope.type.plan && $scope.type.plan.format;
+ var preferredContents = entitySpec.plan && entitySpec.plan.data;
+ var preferredFormat = entitySpec.plan && entitySpec.plan.format;
if (!preferredFormat) {
if (specItem && specItem.format && specItem.contents) {
preferredFormat = specItem.format;
// also take those contents
preferredContents = specItem.contents;
- $scope.type.plan = { data: preferredContents, format:
preferredFormat };
+ entitySpec.plan = { data: preferredContents, format:
preferredFormat };
}
}
+ // save this as the initially selected item in the dropdown of the
definition
+ this.specItem = specItem;
+
// this is used to link to the right editor in composer, preserve the
format used to define the item being quick-launched
$scope.typeFormat = preferredFormat ? 'format=' + preferredFormat +
'&' : '';
diff --git a/ui-modules/home/app/views/main/deploy/deploy.controller.js
b/ui-modules/home/app/views/main/deploy/deploy.controller.js
index dd296831..7cf9d6bd 100644
--- a/ui-modules/home/app/views/main/deploy/deploy.controller.js
+++ b/ui-modules/home/app/views/main/deploy/deploy.controller.js
@@ -78,8 +78,23 @@ export function deployStateController($scope, $state,
$stateParams, $uibModal, b
});
function modalController($scope, $location, entitySpec, locations) {
+ // update entity spec to keep the right format (repeated in catalog
type.state.js)
+ const specItem = entitySpec.specList[0];
+ // if the implementation plan does not declare its format but the
first spec list item does
+ // then we should replace the low-level implementation plan (probably
auto-generated) with
+ // the first spec list item (which is what the user created)
+ var preferredContents = entitySpec.plan && entitySpec.plan.data;
+ var preferredFormat = entitySpec.plan && entitySpec.plan.format;
+ if (!preferredFormat) {
+ if (specItem && specItem.format && specItem.contents) {
+ preferredFormat = specItem.format;
+ // also take those contents
+ preferredContents = specItem.contents;
+ entitySpec.plan = { data: preferredContents, format:
preferredFormat };
+ }
+ }
+
$scope.app = entitySpec;
- $scope.app.plan.format = $scope.app.specList[0].format;
$scope.locations = filterCatalogQuickLaunch(locations, (t) => {
$scope.usingLocationCatalogQuickLaunchTags = t.length > 0;
});
@@ -93,7 +108,6 @@ export function deployStateController($scope, $state,
$stateParams, $uibModal, b
noCreateLocationLink:
$scope.usingLocationCatalogQuickLaunchTags
},
$location.search());
-
}
}
diff --git a/ui-modules/utils/quick-launch/quick-launch.less
b/ui-modules/utils/quick-launch/quick-launch.less
index ed3911ee..65090fc6 100644
--- a/ui-modules/utils/quick-launch/quick-launch.less
+++ b/ui-modules/utils/quick-launch/quick-launch.less
@@ -34,6 +34,7 @@ brooklyn-quick-launch {
.make-icon(60px);
}
.media-heading {
+ font-size: 2em;
color: @primary-500;
}
.media-subheading {