parent
2dd483b950
commit
d6b8acc715
|
@ -48,6 +48,8 @@ export default function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
|
|||
|
||||
descriptor.type = element.type;
|
||||
|
||||
copyProperties(businessObject, descriptor, 'name');
|
||||
|
||||
descriptor.di = {};
|
||||
|
||||
// fill and stroke will be set to DI
|
||||
|
@ -134,7 +136,10 @@ export default function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
|
|||
// resolve references e.g. default sequence flow
|
||||
resolveReferences(descriptor);
|
||||
|
||||
copyProperties(descriptor, newBusinessObject, 'isExpanded');
|
||||
copyProperties(descriptor, newBusinessObject, [
|
||||
'isExpanded',
|
||||
'name'
|
||||
]);
|
||||
|
||||
removeProperties(descriptor, 'oldBusinessObject');
|
||||
});
|
||||
|
|
|
@ -235,6 +235,40 @@ describe('features/copy-paste', function() {
|
|||
})
|
||||
);
|
||||
|
||||
|
||||
it('should copy name property', inject(
|
||||
function(canvas, copyPaste, elementRegistry, modeling) {
|
||||
|
||||
// given
|
||||
var startEvent = elementRegistry.get('StartEvent_1'),
|
||||
rootElement = canvas.getRootElement();
|
||||
|
||||
copyPaste.copy(startEvent);
|
||||
|
||||
modeling.removeShape(startEvent);
|
||||
|
||||
// when
|
||||
var elements = copyPaste.paste({
|
||||
element: rootElement,
|
||||
point: {
|
||||
x: 300,
|
||||
y: 300
|
||||
}
|
||||
});
|
||||
|
||||
// then
|
||||
expect(elements).to.have.length(2);
|
||||
|
||||
startEvent = find(elements, function(element) {
|
||||
return is(element, 'bpmn:StartEvent');
|
||||
});
|
||||
|
||||
var startEventBo = getBusinessObject(startEvent);
|
||||
|
||||
expect(startEventBo.name).to.equal('hello');
|
||||
}
|
||||
));
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue