Skip to content

Commit 14fa81d

Browse files
feat: add interstitial handling for task destination changes
1 parent 3ed8710 commit 14fa81d

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

src/components/inspectors/ConditionalRedirect/TaskDestination.vue

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ export default {
110110
saveConditionDebounced: null,
111111
};
112112
},
113+
computed: {
114+
node() {
115+
return this.$root.$children[0].$refs.modeler.highlightedNode.definition;
116+
},
117+
},
113118
watch: {
114119
condition: {
115120
handler(newValue, oldValue) {
@@ -123,6 +128,10 @@ export default {
123128
if (!isEqual(newValue, oldValue)) {
124129
this.onSaveCondition();
125130
}
131+
132+
this.$nextTick(() => {
133+
this.handleInterstitial(newValue.value);
134+
});
126135
},
127136
deep: true,
128137
},
@@ -223,6 +232,30 @@ export default {
223232
onDashboardSearchChange(filter) {
224233
this.getCustomDashboardsDebounced(filter);
225234
},
235+
/**
236+
* Handles interstitial logic for supported task node types.
237+
* @param {string} newValue - The new destination type value selected.
238+
*/
239+
handleInterstitial(newValue) {
240+
const { $type: nodeType, id: nodeId } = this.node;
241+
const supportedTypes = ['bpmn:Task', 'bpmn:ManualTask'];
242+
243+
if (supportedTypes.includes(nodeType)) {
244+
this.handleTaskInterstitial(newValue, nodeId);
245+
}
246+
},
247+
/**
248+
* Handle interstitial for task elements
249+
*
250+
* @param {String} newValue - The new destination type value selected
251+
* @param {String} nodeId - The ID of the task node being modified
252+
*/
253+
handleTaskInterstitial(newValue, nodeId) {
254+
this.$root.$emit('handle-task-interstitial', {
255+
nodeId,
256+
show: newValue === 'displayNextAssignedTask',
257+
});
258+
},
226259
},
227260
};
228261
</script>

src/components/nodes/manualTask/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import advancedAccordionConfig from '@/components/inspectors/advancedAccordionCo
44
import documentationAccordionConfig from '@/components/inspectors/documentationAccordionConfig';
55
import defaultNames from '@/components/nodes/task/defaultNames';
66
import elementDestination from '@/components/inspectors/taskElementDestination';
7+
import conditionalRedirect from '@/components/inspectors/ConditionalRedirect/conditionalRedirect';
78

89
export const taskHeight = 76;
910
export const id = 'processmaker-modeler-manual-task';
@@ -52,11 +53,12 @@ export default {
5253
config: nameConfigSettings,
5354
},
5455
elementDestination,
56+
conditionalRedirect,
5557
],
5658
},
5759
documentationAccordionConfig,
5860
advancedAccordionConfig,
5961
],
6062
},
6163
],
62-
};
64+
};

0 commit comments

Comments
 (0)