You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2021/08/09 10:52:34 UTC
[brooklyn-ui] branch master updated (24a84bd -> 99f51dd)
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git.
from 24a84bd clarify null values from "null" values in inspector
new e31eac8 Filter Scope in DSL editor by clicking on the node on the canvas
new 493c872 Add shadow styling for nodes in blueprint graph; drop shadow over selected node in DSL mode.
new 9cb7799 Hide shadows of all nodes on exit from DSL mode
new 99f51dd This closes #265
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../app/components/designer/designer.directive.js | 16 +++++++++---
.../app/components/designer/designer.less | 3 +++
.../app/components/dsl-editor/dsl-editor.js | 12 +++++++++
.../app/components/util/d3-blueprint.js | 30 +++++++++++++++++++++-
4 files changed, 57 insertions(+), 4 deletions(-)
[brooklyn-ui] 01/04: Filter Scope in DSL editor by clicking on the
node on the canvas
Posted by he...@apache.org.
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
commit e31eac8770c52d862d12af3aa514fb5c19ea331c
Author: Mykola Mandra <my...@cloudsoft.io>
AuthorDate: Fri Aug 6 17:37:33 2021 +0100
Filter Scope in DSL editor by clicking on the node on the canvas
Signed-off-by: Mykola Mandra <my...@cloudsoft.io>
---
.../app/components/designer/designer.directive.js | 11 ++++++++---
.../app/components/dsl-editor/dsl-editor.js | 12 ++++++++++++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/ui-modules/blueprint-composer/app/components/designer/designer.directive.js b/ui-modules/blueprint-composer/app/components/designer/designer.directive.js
index 6c37d3f..0ca6061 100644
--- a/ui-modules/blueprint-composer/app/components/designer/designer.directive.js
+++ b/ui-modules/blueprint-composer/app/components/designer/designer.directive.js
@@ -31,12 +31,12 @@ const ANY_MEMBERSPEC_REGEX = /(^.*[m,M]ember[s,S]pec$)/;
const TAG = 'DIRECTIVE :: DESIGNER :: ';
angular.module(MODULE_NAME, [])
- .directive('designer', ['$log', '$state', '$q', 'iconGenerator', 'catalogApi', 'blueprintService', 'brSnackbar', 'paletteDragAndDropService', 'composerOverrides', designerDirective])
+ .directive('designer', ['$log', '$state', '$q', '$rootScope', 'iconGenerator', 'catalogApi', 'blueprintService', 'brSnackbar', 'paletteDragAndDropService', 'composerOverrides', designerDirective])
.run(['$templateCache', templateCache]);
export default MODULE_NAME;
-export function designerDirective($log, $state, $q, iconGenerator, catalogApi, blueprintService, brSnackbar, paletteDragAndDropService, composerOverrides) {
+export function designerDirective($log, $state, $q, $rootScope, iconGenerator, catalogApi, blueprintService, brSnackbar, paletteDragAndDropService, composerOverrides) {
return {
restrict: 'E',
templateUrl: function (tElement, tAttrs) {
@@ -157,7 +157,12 @@ export function designerDirective($log, $state, $q, iconGenerator, catalogApi, b
$log.debug(TAG + 'edit node ' + event.detail.entity._id, event.detail.entity);
switch (event.detail.entity.family) {
case EntityFamily.ENTITY:
- $state.go(graphicalEditEntityState, {entityId: event.detail.entity._id});
+ const blueprint = blueprintService.get();
+ if (blueprint.isInDslEdit) {
+ $rootScope.$broadcast('d3.entity-selected', event.detail.entity);
+ } else {
+ $state.go(graphicalEditEntityState, {entityId: event.detail.entity._id});
+ }
break;
case EntityFamily.SPEC:
$state.go(graphicalEditSpecState, {entityId: event.detail.entity.parent._id, specId: event.detail.entity._id});
diff --git a/ui-modules/blueprint-composer/app/components/dsl-editor/dsl-editor.js b/ui-modules/blueprint-composer/app/components/dsl-editor/dsl-editor.js
index a1cbebf..4022f2b 100644
--- a/ui-modules/blueprint-composer/app/components/dsl-editor/dsl-editor.js
+++ b/ui-modules/blueprint-composer/app/components/dsl-editor/dsl-editor.js
@@ -69,6 +69,18 @@ export function dslEditorDirective($rootScope, $filter, $log, brUtilsGeneral, bl
};
function link(scope) {
+
+ const blueprint = blueprintService.get();
+ blueprint.isInDslEdit = true;
+
+ scope.$on('$destroy', () => {
+ blueprint.isInDslEdit = false;
+ });
+
+ scope.$on('d3.entity-selected', (event, entity) => {
+ scope.state.filter = scope.filters.find(filter => filter.id === entity._id);
+ });
+
scope.DSL_KINDS = DSL_KINDS;
scope.kinds = Object.values(DSL_KINDS);
[brooklyn-ui] 02/04: Add shadow styling for nodes in blueprint
graph; drop shadow over selected node in DSL mode.
Posted by he...@apache.org.
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
commit 493c872dc494709b936dbc4ad2611968a6625a11
Author: Mykola Mandra <my...@cloudsoft.io>
AuthorDate: Mon Aug 9 11:29:07 2021 +0100
Add shadow styling for nodes in blueprint graph; drop shadow over selected node in DSL mode.
Signed-off-by: Mykola Mandra <my...@cloudsoft.io>
---
.../app/components/designer/designer.directive.js | 2 ++
.../app/components/designer/designer.less | 3 +++
.../app/components/util/d3-blueprint.js | 30 +++++++++++++++++++++-
3 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/ui-modules/blueprint-composer/app/components/designer/designer.directive.js b/ui-modules/blueprint-composer/app/components/designer/designer.directive.js
index 0ca6061..19146a2 100644
--- a/ui-modules/blueprint-composer/app/components/designer/designer.directive.js
+++ b/ui-modules/blueprint-composer/app/components/designer/designer.directive.js
@@ -160,6 +160,8 @@ export function designerDirective($log, $state, $q, $rootScope, iconGenerator, c
const blueprint = blueprintService.get();
if (blueprint.isInDslEdit) {
$rootScope.$broadcast('d3.entity-selected', event.detail.entity);
+ blueprintGraph.hideShadow();
+ blueprintGraph.dropShadow(event.detail.entity._id);
} else {
$state.go(graphicalEditEntityState, {entityId: event.detail.entity._id});
}
diff --git a/ui-modules/blueprint-composer/app/components/designer/designer.less b/ui-modules/blueprint-composer/app/components/designer/designer.less
index 272314a..19570ad 100644
--- a/ui-modules/blueprint-composer/app/components/designer/designer.less
+++ b/ui-modules/blueprint-composer/app/components/designer/designer.less
@@ -74,6 +74,9 @@ designer {
stroke-width: 6px;
stroke-alignment: inner;
}
+ &.drop-shadow {
+ filter: drop-shadow(5px 5px 5px rgb(122, 122, 128));
+ }
&.highlighted {
stroke: lighten(@color-selected, 20%);
stroke-width: 6px;
diff --git a/ui-modules/blueprint-composer/app/components/util/d3-blueprint.js b/ui-modules/blueprint-composer/app/components/util/d3-blueprint.js
index eafecc2..0039398 100755
--- a/ui-modules/blueprint-composer/app/components/util/d3-blueprint.js
+++ b/ui-modules/blueprint-composer/app/components/util/d3-blueprint.js
@@ -1226,6 +1226,32 @@ export function D3Blueprint(container, options) {
}
/**
+ * Drop the shadow over node with ID specified, or all nodes if ID is not specified.
+ * @param id The ID of the node to drop shadow over.
+ */
+ function dropShadow(id) {
+ console.log('[drop]', id);
+ if (id) {
+ _svg.select(`#entity-${id}`).classed('drop-shadow', true);
+ } else {
+ _svg.selectAll('.entity').classed('drop-shadow', true);
+ }
+ }
+
+ /**
+ * Hide the shadow of node with ID specified, or all nodes if ID is not specified.
+ * @param id The ID of the node to hide shadow of.
+ */
+ function hideShadow(id) {
+ console.log('[hide]', id);
+ if (id) {
+ _svg.select(`#entity-${id}`).classed('drop-shadow', false);
+ } else {
+ _svg.selectAll('.entity').classed('drop-shadow', false);
+ }
+ }
+
+ /**
* Draw menu with a confirmation request on the canvas for a node with a specified ID, under the node, in the middle.
*
* Single-selection mode offers choices as buttons:
@@ -1462,6 +1488,8 @@ export function D3Blueprint(container, options) {
center: center,
select: selectNode,
confirm: confirmNode,
- unselect: unselectNode
+ unselect: unselectNode,
+ dropShadow: dropShadow,
+ hideShadow: hideShadow,
};
}
[brooklyn-ui] 03/04: Hide shadows of all nodes on exit from DSL mode
Posted by he...@apache.org.
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
commit 9cb77994c595d96f04c08fa4ea27baf8fba32537
Author: Mykola Mandra <my...@cloudsoft.io>
AuthorDate: Mon Aug 9 11:32:04 2021 +0100
Hide shadows of all nodes on exit from DSL mode
Signed-off-by: Mykola Mandra <my...@cloudsoft.io>
---
.../blueprint-composer/app/components/designer/designer.directive.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ui-modules/blueprint-composer/app/components/designer/designer.directive.js b/ui-modules/blueprint-composer/app/components/designer/designer.directive.js
index 19146a2..0670cde 100644
--- a/ui-modules/blueprint-composer/app/components/designer/designer.directive.js
+++ b/ui-modules/blueprint-composer/app/components/designer/designer.directive.js
@@ -276,6 +276,9 @@ export function designerDirective($log, $state, $q, $rootScope, iconGenerator, c
} else {
blueprintGraph.unselect();
}
+ if (!$scope.blueprint.isInDslEdit) {
+ blueprintGraph.hideShadow();
+ }
}
}
}
[brooklyn-ui] 04/04: This closes #265
Posted by he...@apache.org.
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
commit 99f51dd9c4a22b8c269c4eb5f8b7e620e43aa16f
Merge: 24a84bd 9cb7799
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Mon Aug 9 11:52:29 2021 +0100
This closes #265
.../app/components/designer/designer.directive.js | 16 +++++++++---
.../app/components/designer/designer.less | 3 +++
.../app/components/dsl-editor/dsl-editor.js | 12 +++++++++
.../app/components/util/d3-blueprint.js | 30 +++++++++++++++++++++-
4 files changed, 57 insertions(+), 4 deletions(-)