Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Jan 22, 2025
1 parent 931d42a commit 7cfcc42
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 41 deletions.
4 changes: 3 additions & 1 deletion src/render/BpmnPropertiesPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default function BpmnPropertiesPanel(props) {
descriptionConfig,
tooltipConfig,
feelPopupContainer,
getFeelPopupLinks
getFeelPopupLinks,
getCompletions
} = props;

const canvas = injector.get('canvas');
Expand Down Expand Up @@ -242,6 +243,7 @@ export default function BpmnPropertiesPanel(props) {
tooltipLoaded={ onTooltipLoaded }
feelPopupContainer={ feelPopupContainer }
getFeelPopupLinks={ getFeelPopupLinks }
getCompletions={ getCompletions }
eventBus={ eventBus } />
</BpmnPropertiesPanelContext.Provider>;
}
Expand Down
5 changes: 4 additions & 1 deletion src/render/BpmnPropertiesPanelRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export default class BpmnPropertiesPanelRenderer {
description: descriptionConfig,
tooltip: tooltipConfig,
feelPopupContainer,
getFeelPopupLinks
getFeelPopupLinks,
getCompletions
} = config || {};

this._eventBus = eventBus;
Expand All @@ -42,6 +43,7 @@ export default class BpmnPropertiesPanelRenderer {
this._tooltipConfig = tooltipConfig;
this._feelPopupContainer = feelPopupContainer;
this._getFeelPopupLinks = getFeelPopupLinks;
this._getCompletions = getCompletions;

this._container = domify(
'<div style="height: 100%" tabindex="-1" class="bio-properties-panel-container"></div>'
Expand Down Expand Up @@ -179,6 +181,7 @@ export default class BpmnPropertiesPanelRenderer {
tooltipConfig={ this._tooltipConfig }
feelPopupContainer={ this._feelPopupContainer }
getFeelPopupLinks={ this._getFeelPopupLinks }
getCompletions={ this._getCompletions }
/>,
this._container
);
Expand Down
97 changes: 59 additions & 38 deletions test/fixtures/simple.bpmn
Original file line number Diff line number Diff line change
@@ -1,44 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.0-nightly.20210427">
<process id="Process_1" isExecutable="false">
<startEvent id="StartEvent_1" name="start">
<outgoing>Flow_0g16wxm</outgoing>
</startEvent>
<task id="Task_1" name="task">
<incoming>Flow_0g16wxm</incoming>
<outgoing>Flow_0vce4r4</outgoing>
</task>
<sequenceFlow id="Flow_0g16wxm" sourceRef="StartEvent_1" targetRef="Task_1" />
<endEvent id="EndEvent_1" name="end">
<incoming>Flow_0vce4r4</incoming>
</endEvent>
<sequenceFlow id="Flow_0vce4r4" sourceRef="Task_1" targetRef="EndEvent_1" />
</process>
<bpmndi:BPMNDiagram id="BpmnDiagram_1">
<bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNEdge id="Flow_0vce4r4_di" bpmnElement="Flow_0vce4r4">
<di:waypoint x="340" y="120" />
<di:waypoint x="392" y="120" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0g16wxm_di" bpmnElement="Flow_0g16wxm">
<di:waypoint x="188" y="120" />
<di:waypoint x="240" y="120" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="StartEvent_1y45yut_di" bpmnElement="StartEvent_1">
<omgdc:Bounds x="152" y="102" width="36" height="36" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="159" y="145" width="22" height="14" />
</bpmndi:BPMNLabel>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_09rzwd3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.30.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.6.0">
<bpmn:process id="Process_1uxw9r3" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_12hcsou</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_12hcsou" sourceRef="StartEvent_1" targetRef="Activity_0yyfoar" />
<bpmn:callActivity id="Activity_0yyfoar">
<bpmn:extensionElements>
<zeebe:calledElement propagateAllChildVariables="false" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_12hcsou</bpmn:incoming>
<bpmn:outgoing>Flow_1f7ia4f</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:businessRuleTask id="Activity_1hf5de3">
<bpmn:incoming>Flow_1f7ia4f</bpmn:incoming>
<bpmn:outgoing>Flow_1oa1z7v</bpmn:outgoing>
</bpmn:businessRuleTask>
<bpmn:sequenceFlow id="Flow_1f7ia4f" sourceRef="Activity_0yyfoar" targetRef="Activity_1hf5de3" />
<bpmn:userTask id="Activity_0axy1ox">
<bpmn:incoming>Flow_1oa1z7v</bpmn:incoming>
<bpmn:outgoing>Flow_1t5yl7r</bpmn:outgoing>
</bpmn:userTask>
<bpmn:sequenceFlow id="Flow_1oa1z7v" sourceRef="Activity_1hf5de3" targetRef="Activity_0axy1ox" />
<bpmn:endEvent id="Event_1mp7g3e">
<bpmn:incoming>Flow_1t5yl7r</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1t5yl7r" sourceRef="Activity_0axy1ox" targetRef="Event_1mp7g3e" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1uxw9r3">
<bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
<dc:Bounds x="182" y="102" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0caoc8g_di" bpmnElement="Activity_0yyfoar">
<dc:Bounds x="270" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1hf5de3_di" bpmnElement="Activity_1hf5de3">
<dc:Bounds x="430" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0fnuvqb_di" bpmnElement="Task_1">
<omgdc:Bounds x="240" y="80" width="100" height="80" />
<bpmndi:BPMNShape id="Activity_0axy1ox_di" bpmnElement="Activity_0axy1ox">
<dc:Bounds x="590" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0mdnzgj_di" bpmnElement="EndEvent_1">
<omgdc:Bounds x="392" y="102" width="36" height="36" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="401" y="145" width="19" height="14" />
</bpmndi:BPMNLabel>
<bpmndi:BPMNShape id="Event_1mp7g3e_di" bpmnElement="Event_1mp7g3e">
<dc:Bounds x="752" y="102" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_12hcsou_di" bpmnElement="Flow_12hcsou">
<di:waypoint x="218" y="120" />
<di:waypoint x="270" y="120" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1f7ia4f_di" bpmnElement="Flow_1f7ia4f">
<di:waypoint x="370" y="120" />
<di:waypoint x="430" y="120" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1oa1z7v_di" bpmnElement="Flow_1oa1z7v">
<di:waypoint x="530" y="120" />
<di:waypoint x="590" y="120" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1t5yl7r_di" bpmnElement="Flow_1t5yl7r">
<di:waypoint x="690" y="120" />
<di:waypoint x="752" y="120" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
</bpmn:definitions>
36 changes: 35 additions & 1 deletion test/spec/BpmnPropertiesPanelRenderer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,41 @@ describe('<BpmnPropertiesPanelRenderer>', function() {
moddleExtensions: {
zeebe: ZeebeModdle
},
tooltip: ZeebeTooltipProvider
tooltip: ZeebeTooltipProvider,
propertiesPanel: {
parent: propertiesContainer,
getCompletions: (value, id, element) => {
console.log('getCompletions', value, id);

if (id !== 'targetProcessId') {
return [];
}

if (value === '') {
return [
{ value: 'foo', text: 'Foo Process' },
{ value: 'bar', text: 'Bar Process' },
{ value: 'foobar' }
];
} else if ('foo'.includes(value)) {
return [
{ value: 'foo', text: 'Foo Process' },
{ value: 'foobar' }
];
} else if ('bar'.includes(value)) {
return [
{ value: 'bar', text: 'Bar Process' },
{ value: 'foobar' }
];
} else if ('foobar'.includes(value)) {
return [
{ value: 'foobar' }
];
}

return [];
}
}
}
);

Expand Down

0 comments on commit 7cfcc42

Please sign in to comment.