Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bpmn-js

Package Overview
Dependencies
Maintainers
4
Versions
344
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpmn-js - npm Package Compare versions

Comparing version 0.14.0 to 0.14.1

8

lib/features/rules/BpmnRules.js

@@ -5,2 +5,3 @@ 'use strict';

any = require('lodash/collection/any'),
filter = require('lodash/collection/filter'),
forEach = require('lodash/collection/forEach'),

@@ -95,2 +96,9 @@ inherits = require('inherits');

this.addRule([ 'elements.delete' ], function(context) {
// do not allow deletion of labels
return filter(context.elements, function(e) {
return !isLabel(e);
});
});
};

@@ -97,0 +105,0 @@

2

package.json
{
"name": "bpmn-js",
"version": "0.14.0",
"version": "0.14.1",
"description": "A bpmn 2.0 toolkit and web modeler",

@@ -5,0 +5,0 @@ "scripts": {

@@ -67,3 +67,3 @@ 'use strict';

// given
customRules.addRule('elements.delete', function() {
customRules.addRule('elements.delete', 1500, function() {
return true;

@@ -86,3 +86,3 @@ });

// given
customRules.addRule('elements.delete', function() {
customRules.addRule('elements.delete', 1500, function() {
return false;

@@ -106,3 +106,3 @@ });

customRules.addRule('elements.delete', function(context) {
customRules.addRule('elements.delete', 1500, function(context) {

@@ -126,3 +126,3 @@ // element array is actually passed

// given
customRules.addRule('elements.delete', function(context) {
customRules.addRule('elements.delete', 1500, function(context) {
return context.elements;

@@ -145,3 +145,3 @@ });

// given
customRules.addRule('elements.delete', function() {
customRules.addRule('elements.delete', 1500, function() {
return [];

@@ -148,0 +148,0 @@ });

@@ -1320,2 +1320,27 @@ 'use strict';

describe('labels', function() {
var testXML = require('./BpmnRules.process.bpmn');
beforeEach(bootstrapModeler(testXML, { modules: testModules }));
it('should filter labels', inject(function(elementRegistry, rules) {
// given
var startEventShape = elementRegistry.get('StartEvent_None'),
startEventLabel = startEventShape.label;
// when
var allowed = rules.allowed('elements.delete', {
elements: [ startEventShape, startEventLabel ]
});
// then
expect(allowed).to.eql([ startEventShape ]);
}));
});
});

@@ -377,6 +377,11 @@ 'use strict';

var diagramXML = require('./BpmnSnapping.subProcess-resize.bpmn');
var testResizeModules = [ coreModule, resizeModule, rulesModule, snappingModule ];
var testResizeModules = [
coreModule,
modelingModule,
resizeModule,
rulesModule,
snappingModule
];

@@ -403,6 +408,11 @@ beforeEach(bootstrapModeler(diagramXML, { modules: testResizeModules }));

var diagramXML = require('./BpmnSnapping.textAnnotation-resize.bpmn');
var testResizeModules = [ coreModule, resizeModule, rulesModule, snappingModule ];
var testResizeModules = [
coreModule,
modelingModule,
resizeModule,
rulesModule,
snappingModule
];

@@ -412,3 +422,3 @@ beforeEach(bootstrapModeler(diagramXML, { modules: testResizeModules }));

it('should snap a TextAnnotation to minimum bounds', inject(function(elementRegistry, resize, dragging) {
it('should snap to minimum bounds', inject(function(elementRegistry, resize, dragging) {

@@ -415,0 +425,0 @@ var textAnnotation = elementRegistry.get('TextAnnotation');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc