mirror of
https://github.com/sartography/bpmn-js-spiffworkflow.git
synced 2025-02-23 13:08:11 +00:00
we can delete messages w/ burnettk cullerton
This commit is contained in:
parent
feb1d64a5a
commit
51aa461a04
@ -1,5 +1,6 @@
|
||||
import { useService } from 'bpmn-js-properties-panel';
|
||||
import { TextFieldEntry } from '@bpmn-io/properties-panel';
|
||||
import { without } from 'min-dash';
|
||||
import {
|
||||
findCorrelationKeys,
|
||||
getRoot,
|
||||
@ -28,6 +29,12 @@ export function MessageArray(props) {
|
||||
translate,
|
||||
}),
|
||||
autoFocusEntry: id,
|
||||
remove: removeFactory({
|
||||
element,
|
||||
messageElement,
|
||||
commandStack,
|
||||
moddle,
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
@ -54,6 +61,27 @@ export function MessageArray(props) {
|
||||
return { items, add };
|
||||
}
|
||||
|
||||
function removeFactory(props) {
|
||||
const { element, messageElement, moddle, commandStack } = props;
|
||||
|
||||
return function (event) {
|
||||
event.stopPropagation();
|
||||
const rootElement = getRoot(element.businessObject);
|
||||
const { rootElements } = rootElement;
|
||||
const messageElementIndex = rootElements.indexOf(messageElement);
|
||||
if (messageElementIndex > -1) {
|
||||
rootElements.splice(messageElementIndex, 1);
|
||||
}
|
||||
commandStack.execute('element.updateProperties', {
|
||||
element,
|
||||
moddleElement: moddle,
|
||||
properties: {
|
||||
messages: rootElements,
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function messageGroup(props) {
|
||||
const { messageElement, commandStack, translate } = props;
|
||||
const id = `message-${messageElement.name}`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user