From 8ea3bd00f7a0926cd496493700da2d7f7acc854a Mon Sep 17 00:00:00 2001 From: Beatriz Mendes Date: Thu, 9 Nov 2023 19:29:09 +0100 Subject: [PATCH] feat(outline): connection outline only in multi-select --- assets/diagram-js.css | 5 ++++ .../selection/SelectionVisualsSpec.js | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/assets/diagram-js.css b/assets/diagram-js.css index aa73088be..ada938d74 100644 --- a/assets/diagram-js.css +++ b/assets/diagram-js.css @@ -121,8 +121,13 @@ stroke: var(--element-selected-outline-stroke-color); } +.djs-connection.selected .djs-outline { + display: none; +} + .djs-multi-select .djs-element.selected .djs-outline { stroke: var(--element-selected-outline-secondary-stroke-color); + display: block; } .djs-shape.connect-ok .djs-visual > :nth-child(1) { diff --git a/test/spec/features/selection/SelectionVisualsSpec.js b/test/spec/features/selection/SelectionVisualsSpec.js index a105ed7c5..0c240afe8 100755 --- a/test/spec/features/selection/SelectionVisualsSpec.js +++ b/test/spec/features/selection/SelectionVisualsSpec.js @@ -88,6 +88,21 @@ describe('features/selection/SelectionVisuals', function() { expect(domClasses(element).has('djs-multi-select')); })); + + it('should not show box for connection', inject(function(selection, canvas) { + + // when + // debugger; + selection.select(connection); + + // then + var gfx = canvas.getGraphics(connection), + outline = domQuery('.djs-outline', gfx); + + expect(outline).to.exist; + expect(getComputedStyle(outline).display).to.equal('none'); + })); + }); @@ -192,6 +207,15 @@ describe('features/selection/SelectionVisuals', function() { })); + + it('should show box for connection', inject(function(canvas) { + var gfx = canvas.getGraphics(connection), + outlineShape = domQuery('.djs-outline', gfx); + + expect(outlineShape).to.exist; + expect(getComputedStyle(outlineShape).display).to.not.equal('none'); + })); + }); });