You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by tb...@apache.org on 2018/10/30 13:28:06 UTC
[1/2] brooklyn-ui git commit: Add callback for customising catalog
save configuration
Repository: brooklyn-ui
Updated Branches:
refs/heads/master c2c63714d -> a359d463d
Add callback for customising catalog save configuration
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/39d3fbb3
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/39d3fbb3
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/39d3fbb3
Branch: refs/heads/master
Commit: 39d3fbb3c7f1ba541eda014706767bb50823155d
Parents: 88c36c3
Author: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Authored: Mon Oct 15 13:38:57 2018 +0100
Committer: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Committed: Wed Oct 24 14:02:52 2018 +0100
----------------------------------------------------------------------
.../catalog-saver/catalog-saver.directive.js | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/39d3fbb3/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
----------------------------------------------------------------------
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 5da6f77..cb6f0ea 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
@@ -23,8 +23,11 @@ import template from './catalog-saver.template.html';
import modalTemplate from './catalog-saver.modal.template.html';
import jsYaml from 'js-yaml';
import brUtils from 'brooklyn-ui-utils/utils/general';
+import {yamlState} from "../../views/main/yaml/yaml.state";
+import {graphicalState} from "../../views/main/graphical/graphical.state";
const MODULE_NAME = 'brooklyn.components.catalog-saver';
+
const REASONS = {
new: 0,
deploy: 1
@@ -39,12 +42,12 @@ const TYPES = [
];
angular.module(MODULE_NAME, [angularAnimate, uibModal, brUtils])
- .directive('catalogSaver', ['$rootScope', '$uibModal', saveToCatalogModalDirective])
+ .directive('catalogSaver', ['$rootScope', '$uibModal', '$injector', 'composerOverrides', saveToCatalogModalDirective])
.directive('catalogVersion', ['$parse', catalogVersionDirective]);
export default MODULE_NAME;
-export function saveToCatalogModalDirective($rootScope, $uibModal) {
+export function saveToCatalogModalDirective($rootScope, $uibModal, $injector, composerOverrides) {
return {
restrict: 'E',
template: template,
@@ -54,11 +57,17 @@ export function saveToCatalogModalDirective($rootScope, $uibModal) {
link: link
};
- function link($scope) {
+ function link($scope, $element) {
$scope.buttonText = $scope.config.label || ($scope.config.itemType ? `Update ${$scope.config.name || $scope.config.symbolicName}` : 'Add to catalog');
+
+ $injector.get('$templateCache').put('catalog-saver.modal.template.html', modalTemplate);
+
$scope.activateModal = () => {
+ // Override callback to update catalog configuration data in other applications
+ $scope.config = (composerOverrides.updateCatalogConfig || (($scope, $element) => $scope.config))($scope, $element);
+
let modalInstance = $uibModal.open({
- template: modalTemplate,
+ templateUrl: 'catalog-saver.modal.template.html',
size: 'save',
controller: ['$scope', 'blueprintService', 'paletteApi', 'brUtilsGeneral', CatalogItemModalController],
scope: $scope,
[2/2] brooklyn-ui git commit: This closes #91
Posted by tb...@apache.org.
This closes #91
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/a359d463
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/a359d463
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/a359d463
Branch: refs/heads/master
Commit: a359d463d8d01b0840a128889ddd40b7f1f8579e
Parents: c2c6371 39d3fbb
Author: Thomas Bouron <th...@cloudsoftcorp.com>
Authored: Tue Oct 30 13:28:00 2018 +0000
Committer: Thomas Bouron <th...@cloudsoftcorp.com>
Committed: Tue Oct 30 13:28:00 2018 +0000
----------------------------------------------------------------------
.../catalog-saver/catalog-saver.directive.js | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------