Skip to content

Commit

Permalink
fix(variable-mapping-props): remove target attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Jun 11, 2018
1 parent b4b01c8 commit 5b62661
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/provider/camunda/parts/VariableMappingProps.js
Expand Up @@ -134,7 +134,7 @@ module.exports = function(group, element, bpmnFactory, translate) {

var newElement = function(type) {
return function(element, extensionElements, value) {
var newElem = elementHelper.createElement(type, { source : '' }, extensionElements, bpmnFactory);
var newElem = elementHelper.createElement(type, { source: '' }, extensionElements, bpmnFactory);

return cmdHelper.addElementsTolist(element, extensionElements, 'values', [ newElem ]);
};
Expand Down Expand Up @@ -259,6 +259,7 @@ module.exports = function(group, element, bpmnFactory, translate) {
}
else if (inOutType === 'variables') {
props.variables = 'all';
props.target = undefined;
}

var mapping = getSelected(element, node);
Expand Down
26 changes: 26 additions & 0 deletions test/spec/provider/camunda/SignalEventVariableMappingSpec.js
Expand Up @@ -408,6 +408,32 @@ describe('SignalEvent - variable mapping', function() {
}));


it('should remove target attribute when inOutType have value "All"', inject(function(propertiesPanel, selection, elementRegistry) {

// given
var shape = elementRegistry.get('IntermediateThrowEvent_1');
selection.select(shape);

var selectBox = domQuery('select[id=cam-extensionElements-variableMapping-in]', propertiesPanel._container),
typeSelectBox = domQuery('select[id=camunda-variableMapping-inOutType-select]', propertiesPanel._container),
businessObject = getBusinessObject(shape),
signalEventDefinition = eventDefinitionHelper.getSignalEventDefinition(businessObject);

expect(selectBox.options).to.have.length(3);

selectBox.options[0].selected = 'selected';
TestHelper.triggerEvent(selectBox, 'change');

// when
typeSelectBox.options[2].selected = 'selected';
TestHelper.triggerEvent(typeSelectBox, 'change');

// then
var variablesMappings = getMappingsWithVariablesAttr(signalEventDefinition.extensionElements, CAMUNDA_IN_EXTENSION_ELEMENT);
expect(variablesMappings[0].target).not.to.exist;
}));


it('should remove the variables attr of a camunda:in mapping of a signal intermediate throw event', inject(function(propertiesPanel, selection, elementRegistry) {

var shape = elementRegistry.get('IntermediateThrowEvent_4');
Expand Down

0 comments on commit 5b62661

Please sign in to comment.