From 19e4e19bb5a7887c3fc29cd767646f10fdc6b946 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Tue, 27 Feb 2018 09:57:22 +0100 Subject: [PATCH] chore(project): migrate to new SECTION comments --- lib/draw/BpmnRenderUtil.js | 6 +++--- lib/draw/PathMap.js | 2 +- lib/features/auto-place/AutoPlace.js | 2 +- lib/features/auto-place/AutoPlaceUtil.js | 2 +- .../label-editing/LabelEditingProvider.js | 2 +- lib/features/modeling/BpmnUpdater.js | 8 ++++---- lib/features/modeling/ElementFactory.js | 2 +- .../modeling/behavior/ImportDockingFix.js | 2 +- .../modeling/behavior/RemoveElementBehavior.js | 2 +- .../behavior/ToggleElementCollapseBehaviour.js | 2 +- .../behavior/UnsetDefaultFlowBehavior.js | 2 +- .../modeling/behavior/util/LabelLayoutUtil.js | 3 +-- .../modeling/cmd/UpdatePropertiesHandler.js | 2 +- lib/features/snapping/BpmnSnapping.js | 18 +++++++++++++----- lib/features/snapping/BpmnSnappingUtil.js | 2 +- lib/import/BpmnTreeWalker.js | 8 ++++---- test/spec/features/auto-place/AutoPlaceSpec.js | 2 +- .../features/copy-paste/BpmnCopyPasteSpec.js | 2 +- .../spec/features/modeling/MoveElementsSpec.js | 2 +- .../behavior/RemoveElementBehaviorSpec.js | 2 +- .../ToggleElementCollapseBehaviourSpec.js | 2 +- .../modeling/layout/LayoutConnectionSpec.js | 2 +- test/spec/import/ImporterSpec.js | 2 +- 23 files changed, 43 insertions(+), 36 deletions(-) diff --git a/lib/draw/BpmnRenderUtil.js b/lib/draw/BpmnRenderUtil.js index 193f2725..123900b2 100644 --- a/lib/draw/BpmnRenderUtil.js +++ b/lib/draw/BpmnRenderUtil.js @@ -6,7 +6,7 @@ var every = require('lodash/collection/every'), var componentsToPath = require('diagram-js/lib/util/RenderUtil').componentsToPath; -///////// element utils ///////////////////////////// +// element utils ////////////////////// /** * Checks if eventDefinition of the given element matches with semantic type. @@ -59,7 +59,7 @@ function getSemantic(element) { module.exports.getSemantic = getSemantic; -/////// color access //////////////////////////////////////// +// color access ////////////////////// function getFillColor(element, defaultColor) { return getDi(element).get('bioc:fill') || defaultColor || 'white'; @@ -74,7 +74,7 @@ function getStrokeColor(element, defaultColor) { module.exports.getStrokeColor = getStrokeColor; -/////// cropping path customizations ///////////////////////// +// cropping path customizations ////////////////////// function getCirclePath(shape) { diff --git a/lib/draw/PathMap.js b/lib/draw/PathMap.js index ad2bb070..8fa1bb30 100644 --- a/lib/draw/PathMap.js +++ b/lib/draw/PathMap.js @@ -449,7 +449,7 @@ function PathMap() { module.exports = PathMap; -////////// helpers ////////// +// helpers ////////////////////// // copied from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js var tokenRegex = /\{([^}]+)\}/g, diff --git a/lib/features/auto-place/AutoPlace.js b/lib/features/auto-place/AutoPlace.js index de9e6b77..9bb10ae2 100644 --- a/lib/features/auto-place/AutoPlace.js +++ b/lib/features/auto-place/AutoPlace.js @@ -62,7 +62,7 @@ AutoPlace.$inject = [ module.exports = AutoPlace; -/////////// helpers ///////////////////////////////////// +// helpers ////////////////////// /** * Find the new position for the target element to diff --git a/lib/features/auto-place/AutoPlaceUtil.js b/lib/features/auto-place/AutoPlaceUtil.js index a409a1a9..202be434 100644 --- a/lib/features/auto-place/AutoPlaceUtil.js +++ b/lib/features/auto-place/AutoPlaceUtil.js @@ -377,7 +377,7 @@ module.exports.deconflictPosition = deconflictPosition; -///////// helpers ///////////////////// +// helpers ////////////////////// function noneFilter() { return true; diff --git a/lib/features/label-editing/LabelEditingProvider.js b/lib/features/label-editing/LabelEditingProvider.js index 16145930..239ca6de 100644 --- a/lib/features/label-editing/LabelEditingProvider.js +++ b/lib/features/label-editing/LabelEditingProvider.js @@ -333,7 +333,7 @@ LabelEditingProvider.prototype.update = function( -////////// helpers //////////////////////////////// +// helpers ////////////////////// function isCollapsedSubProcess(element) { return is(element, 'bpmn:SubProcess') && !isExpanded(element); diff --git a/lib/features/modeling/BpmnUpdater.js b/lib/features/modeling/BpmnUpdater.js index 67e234bc..b6cdb213 100644 --- a/lib/features/modeling/BpmnUpdater.js +++ b/lib/features/modeling/BpmnUpdater.js @@ -27,7 +27,7 @@ function BpmnUpdater(eventBus, bpmnFactory, connectionDocking, translate) { - ////// connection cropping ///////////////////////// + // connection cropping ////////////////////// // crop connection ends during create/update function cropConnection(e) { @@ -54,7 +54,7 @@ function BpmnUpdater(eventBus, bpmnFactory, connectionDocking, translate) { - ////// BPMN + DI update ///////////////////////// + // BPMN + DI update ////////////////////// // update parent @@ -290,7 +290,7 @@ module.exports = BpmnUpdater; BpmnUpdater.$inject = [ 'eventBus', 'bpmnFactory', 'connectionDocking', 'translate' ]; -/////// implementation ////////////////////////////////// +// implementation ////////////////////// BpmnUpdater.prototype.updateAttachment = function(context) { @@ -660,7 +660,7 @@ BpmnUpdater.prototype.updateConnection = function(context) { }; -/////// helpers ///////////////////////////////////////// +// helpers ////////////////////// BpmnUpdater.prototype._getLabel = function(di) { if (!di.label) { diff --git a/lib/features/modeling/ElementFactory.js b/lib/features/modeling/ElementFactory.js index 0e920ffe..6d88b3d6 100644 --- a/lib/features/modeling/ElementFactory.js +++ b/lib/features/modeling/ElementFactory.js @@ -189,7 +189,7 @@ ElementFactory.prototype.createParticipantShape = function(collapsed) { }; -//////////// helpers //////////////////////////////////// +// helpers ////////////////////// /** * Apply attributes from a map to the given element, diff --git a/lib/features/modeling/behavior/ImportDockingFix.js b/lib/features/modeling/behavior/ImportDockingFix.js index 93728c53..8024bac5 100644 --- a/lib/features/modeling/behavior/ImportDockingFix.js +++ b/lib/features/modeling/behavior/ImportDockingFix.js @@ -74,7 +74,7 @@ ImportDockingFix.$inject = [ 'eventBus' ]; module.exports = ImportDockingFix; -/////// helpers ////////////////////////////////// +// helpers ////////////////////// function getDistance(p1, p2) { return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); diff --git a/lib/features/modeling/behavior/RemoveElementBehavior.js b/lib/features/modeling/behavior/RemoveElementBehavior.js index 94eac0f0..8ead4804 100644 --- a/lib/features/modeling/behavior/RemoveElementBehavior.js +++ b/lib/features/modeling/behavior/RemoveElementBehavior.js @@ -45,7 +45,7 @@ RemoveElementBehavior.$inject = [ 'eventBus', 'bpmnRules', 'modeling' ]; module.exports = RemoveElementBehavior; -///////// helpers ////////////////////////////// +// helpers ////////////////////// function getDocking(point) { return point.original || point; diff --git a/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js b/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js index d5bd7fda..9fdd637e 100644 --- a/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js +++ b/lib/features/modeling/behavior/ToggleElementCollapseBehaviour.js @@ -130,7 +130,7 @@ module.exports = ToggleElementCollapseBehaviour; -/////// helpers /////////////////////////// +// helpers ////////////////////// function filterVisible(elements) { return elements.filter(function(e) { diff --git a/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js b/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js index e2a3d046..f7af60db 100644 --- a/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js +++ b/lib/features/modeling/behavior/UnsetDefaultFlowBehavior.js @@ -40,7 +40,7 @@ DeleteSequenceFlowBehavior.$inject = [ 'eventBus', 'modeling' ]; module.exports = DeleteSequenceFlowBehavior; -/////// helpers /////////////////////////// +// helpers ////////////////////// function isDefaultFlow(connection, source) { diff --git a/lib/features/modeling/behavior/util/LabelLayoutUtil.js b/lib/features/modeling/behavior/util/LabelLayoutUtil.js index 318d6796..fee3f117 100644 --- a/lib/features/modeling/behavior/util/LabelLayoutUtil.js +++ b/lib/features/modeling/behavior/util/LabelLayoutUtil.js @@ -184,7 +184,7 @@ function getLabelAdjustment(label, newWaypoints, oldWaypoints, hints) { module.exports.getLabelAdjustment = getLabelAdjustment; -//// HELPERS /////// +// HELPERS ////////////////////// function relativePositionMidWaypoint(waypoints, idx) { @@ -194,7 +194,6 @@ function relativePositionMidWaypoint(waypoints, idx) { var relativePosition = distanceSegment1 / ( distanceSegment1 + distanceSegment2 ); return relativePosition; - } function getLabelMid(label) { diff --git a/lib/features/modeling/cmd/UpdatePropertiesHandler.js b/lib/features/modeling/cmd/UpdatePropertiesHandler.js index 274a3181..3f73dd64 100644 --- a/lib/features/modeling/cmd/UpdatePropertiesHandler.js +++ b/lib/features/modeling/cmd/UpdatePropertiesHandler.js @@ -42,7 +42,7 @@ UpdatePropertiesHandler.$inject = [ 'elementRegistry', 'moddle', 'translate', 'm module.exports = UpdatePropertiesHandler; -////// api ///////////////////////////////////////////// +// api ////////////////////// /** * Updates a BPMN element with a list of new properties diff --git a/lib/features/snapping/BpmnSnapping.js b/lib/features/snapping/BpmnSnapping.js index 199e2a3e..72046df1 100644 --- a/lib/features/snapping/BpmnSnapping.js +++ b/lib/features/snapping/BpmnSnapping.js @@ -181,7 +181,11 @@ function BpmnSnapping(eventBus, canvas, bpmnRules, elementRegistry) { } if (is(shape, 'bpmn:Lane') || is(shape, 'bpmn:Participant')) { - context.resizeConstraints = getParticipantSizeConstraints(shape, context.direction, context.balanced); + context.resizeConstraints = getParticipantSizeConstraints( + shape, + context.direction, + context.balanced + ); } if (is(shape, 'bpmn:TextAnnotation')) { @@ -193,7 +197,12 @@ function BpmnSnapping(eventBus, canvas, bpmnRules, elementRegistry) { inherits(BpmnSnapping, Snapping); -BpmnSnapping.$inject = [ 'eventBus', 'canvas', 'bpmnRules', 'elementRegistry' ]; +BpmnSnapping.$inject = [ + 'eventBus', + 'canvas', + 'bpmnRules', + 'elementRegistry' +]; module.exports = BpmnSnapping; @@ -347,7 +356,7 @@ BpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) { }; -/////// participant snapping ////////////////// +// participant snapping ////////////////////// function initParticipantSnapping(context, shape, elements) { @@ -406,8 +415,7 @@ function snapParticipant(snapBox, shape, event, offset) { } -/////// boundary event snapping ///////////////////////// - +// boundary event snapping ////////////////////// function snapBoundaryEvent(event, shape, target) { var targetTRBL = asTRBL(target); diff --git a/lib/features/snapping/BpmnSnappingUtil.js b/lib/features/snapping/BpmnSnappingUtil.js index 8aa60c52..ec3a94b2 100644 --- a/lib/features/snapping/BpmnSnappingUtil.js +++ b/lib/features/snapping/BpmnSnappingUtil.js @@ -18,7 +18,7 @@ module.exports.getBoundaryAttachment = getBoundaryAttachment; -// participant snapping box implementation ///////////////// +// participant snapping box implementation ////////////////////// var is = require('../../util/ModelUtil').is; diff --git a/lib/import/BpmnTreeWalker.js b/lib/import/BpmnTreeWalker.js index 6bc79718..154796bf 100644 --- a/lib/import/BpmnTreeWalker.js +++ b/lib/import/BpmnTreeWalker.js @@ -43,7 +43,7 @@ function BpmnTreeWalker(handler, translate) { // prerequisites are drawn var deferred = []; - ///// Helpers ///////////////////////////////// + // Helpers ////////////////////// function contextual(fn, ctx) { return function(e) { @@ -98,7 +98,7 @@ function BpmnTreeWalker(handler, translate) { handler.error(message, context); } - ////// DI handling //////////////////////////// + // DI handling ////////////////////// function registerDi(di) { var bpmnElement = di.bpmnElement; @@ -140,7 +140,7 @@ function BpmnTreeWalker(handler, translate) { } - ////// Semantic handling ////////////////////// + // Semantic handling ////////////////////// /** * Handle definitions and return the rendered diagram (if any) @@ -448,7 +448,7 @@ function BpmnTreeWalker(handler, translate) { }); } - ///// API //////////////////////////////// + // API ////////////////////// return { handleDefinitions: handleDefinitions diff --git a/test/spec/features/auto-place/AutoPlaceSpec.js b/test/spec/features/auto-place/AutoPlaceSpec.js index c0490709..225f4328 100644 --- a/test/spec/features/auto-place/AutoPlaceSpec.js +++ b/test/spec/features/auto-place/AutoPlaceSpec.js @@ -231,7 +231,7 @@ describe('features/auto-place', function() { -////////// helpers ///////////////////////////////////////// +// helpers ////////////////////// function autoPlace(cfg) { diff --git a/test/spec/features/copy-paste/BpmnCopyPasteSpec.js b/test/spec/features/copy-paste/BpmnCopyPasteSpec.js index 2effc4a6..4332fd60 100644 --- a/test/spec/features/copy-paste/BpmnCopyPasteSpec.js +++ b/test/spec/features/copy-paste/BpmnCopyPasteSpec.js @@ -661,7 +661,7 @@ describe('features/copy-paste', function() { -////// test helpers ////////////////////////////////////////////////// +// test helpers ////////////////////// function integrationTest(ids) { diff --git a/test/spec/features/modeling/MoveElementsSpec.js b/test/spec/features/modeling/MoveElementsSpec.js index efc5db82..b3a955a4 100644 --- a/test/spec/features/modeling/MoveElementsSpec.js +++ b/test/spec/features/modeling/MoveElementsSpec.js @@ -110,7 +110,7 @@ describe('features/modeling - move elements', function() { }); -///////// helpers ///////////////////////////////// +// helpers ////////////////////// function moveWaypoint(p, delta) { return { diff --git a/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js b/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js index 5859ffe7..3eb1aab1 100644 --- a/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js @@ -241,7 +241,7 @@ describe('features/modeling - remove element behavior', function() { -////////////////////////// helper ///////////////////////////////// +// helper ////////////////////// function point(p) { return { diff --git a/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js b/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js index 4b50ac23..206d98b5 100644 --- a/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js +++ b/test/spec/features/modeling/behavior/ToggleElementCollapseBehaviourSpec.js @@ -620,7 +620,7 @@ describe('features/modeling - collapse and expand elements', function() { }); -/////////// helpers ///////////////////////////// +// helpers ////////////////////// function allHidden() { diff --git a/test/spec/features/modeling/layout/LayoutConnectionSpec.js b/test/spec/features/modeling/layout/LayoutConnectionSpec.js index 5dd7c11c..2a2c502f 100644 --- a/test/spec/features/modeling/layout/LayoutConnectionSpec.js +++ b/test/spec/features/modeling/layout/LayoutConnectionSpec.js @@ -114,7 +114,7 @@ describe('features/modeling - layout connection', function() { -///////// helpers /////////////////////////// +// helpers ////////////////////// function toPoint(p) { return { diff --git a/test/spec/import/ImporterSpec.js b/test/spec/import/ImporterSpec.js index d46e3601..dabe98bf 100644 --- a/test/spec/import/ImporterSpec.js +++ b/test/spec/import/ImporterSpec.js @@ -464,7 +464,7 @@ describe('import - Importer', function() { -////////// helpers ///////////////////////////////////// +// helpers ////////////////////// function expectChildren(diagram, parent, children) {