addressed review comments
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 ab8a3f7..cab9db2 100644
--- a/ui-modules/home/app/views/main/deploy/deploy.controller.js
+++ b/ui-modules/home/app/views/main/deploy/deploy.controller.js
@@ -22,7 +22,7 @@
import brooklynApi from 'brooklyn-ui-utils/brooklyn.api/brooklyn.api';
import {HIDE_INTERSTITIAL_SPINNER_EVENT} from 'brooklyn-ui-utils/interstitial-spinner/interstitial-spinner';
import modalTemplate from './modal.template.html';
-import {filterCatalogQuickLaunch} from '../main.controller.js';
+import {filterCatalogQuickLaunch} from '../main.controller.js'; // this really should be handled by angular DI
const MODULE_NAME = 'states.main.deploy';
@@ -80,13 +80,16 @@
function modalController($scope, $location, entitySpec, locations) {
$scope.app = entitySpec;
$scope.locations = filterCatalogQuickLaunch(locations, (t) => {
- $scope.usingCatalogQuickLaunchTags = t.length > 0;
+ $scope.usingLocationCatalogQuickLaunchTags = t.length > 0;
});
// also supports { noEditButton: true, noComposerButton: true }
// see quick-launch.js for more info
$scope.args = angular.extend({
- noCreateLocationLink: $scope.usingCatalogQuickLaunchTags
+ // disable "create location" is admin has configured locations with tags.
+ // called out in docs in https://github.com/apache/brooklyn-docs/pull/299.
+ // a better approach would be to add config on the server to configure this.
+ noCreateLocationLink: $scope.usingLocationCatalogQuickLaunchTags
},
$location.search());
diff --git a/ui-modules/home/app/views/main/deploy/modal.template.html b/ui-modules/home/app/views/main/deploy/modal.template.html
index ec62c19..effb5db 100644
--- a/ui-modules/home/app/views/main/deploy/modal.template.html
+++ b/ui-modules/home/app/views/main/deploy/modal.template.html
@@ -17,4 +17,4 @@
under the License.
-->
<br-svg type="close" class="modal-close pull-right" ng-click="$dismiss('Dismiss deployment modal')"></br-svg>
-<brooklyn-quick-launch app="app" args="args" locations="locations" simpleMode="$scope.usingCatalogQuickLaunchTags" callback="$close"></brooklyn-quick-launch>
+<brooklyn-quick-launch app="app" args="args" locations="locations" callback="$close"></brooklyn-quick-launch>
diff --git a/ui-modules/home/app/views/main/main.controller.js b/ui-modules/home/app/views/main/main.controller.js
index 352b365..a3bdff1 100644
--- a/ui-modules/home/app/views/main/main.controller.js
+++ b/ui-modules/home/app/views/main/main.controller.js
@@ -50,10 +50,11 @@
export function filterCatalogQuickLaunch(list, callbackForFiltered) {
// optionally tag things with 'catalog_quick_launch': if any apps are so tagged,
- // then only apps with such tags will be shown;
- // in all cases only show those marked as templates.
+ // then only apps with such tags will be shown; otherwise show all marked as templates.
+
// the callback is used for clients who wish to adjust their behaviour if tags are used,
// eg in deploy.controller where noCreateLocationLink is set on the quick launch if there are tagged locations
+
if (!list) {
list = [];
}
diff --git a/ui-modules/utils/quick-launch/quick-launch.js b/ui-modules/utils/quick-launch/quick-launch.js
index 7ed27d7..a114aae 100644
--- a/ui-modules/utils/quick-launch/quick-launch.js
+++ b/ui-modules/utils/quick-launch/quick-launch.js
@@ -38,7 +38,7 @@
scope: {
app: '=',
locations: '=',
- args: '=?', // default: { noEditButton: false, noComposerButton: false, noCreateLocationLink: false, location: null }
+ args: '=?', // default behaviour of code is: { noEditButton: false, noComposerButton: false, noCreateLocationLink: false, location: null }
callback: '=?',
},
controller: ['$scope', '$http', '$location', 'brSnackbar', controller]