mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-18 11:56:30 +00:00
parent
2dd483b950
commit
d6b8acc715
@ -48,6 +48,8 @@ export default function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) {
|
|||||||
|
|
||||||
descriptor.type = element.type;
|
descriptor.type = element.type;
|
||||||
|
|
||||||
|
copyProperties(businessObject, descriptor, 'name');
|
||||||
|
|
||||||
descriptor.di = {};
|
descriptor.di = {};
|
||||||
|
|
||||||
// fill and stroke will be set to 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
|
// resolve references e.g. default sequence flow
|
||||||
resolveReferences(descriptor);
|
resolveReferences(descriptor);
|
||||||
|
|
||||||
copyProperties(descriptor, newBusinessObject, 'isExpanded');
|
copyProperties(descriptor, newBusinessObject, [
|
||||||
|
'isExpanded',
|
||||||
|
'name'
|
||||||
|
]);
|
||||||
|
|
||||||
removeProperties(descriptor, 'oldBusinessObject');
|
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…
x
Reference in New Issue
Block a user