Skip to content

Commit 2c51fe2

Browse files
authored
Merge pull request #8553 from ProcessMaker/FOUR-26806
FOUR-26806 User cannot select a display screen when the condition is selected Display Next Assigned Task option
2 parents 7a65997 + 87b29b7 commit 2c51fe2

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

resources/js/processes/modeler/components/inspector/TaskInterstitial.vue

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,28 @@ export default {
6767
this.$set(this.node, "allowInterstitial", value);
6868
},
6969
},
70+
/**
71+
* Get the value of the elementDestination property
72+
*/
73+
elementDestination: {
74+
get() {
75+
// Get the value of elementDestination or set it to null if it hasn't been defined yet.
76+
const value = get(this.node, "elementDestination", "{}");
77+
const parsedValue = JSON.parse(value);
78+
79+
return parsedValue;
80+
},
81+
},
82+
/**
83+
* Get the value of the conditionalRedirect property
84+
*/
85+
conditionalRedirect: {
86+
get() {
87+
const value = get(this.node, "conditionalRedirect", "{}");
88+
const parsedValue = JSON.parse(value);
89+
return parsedValue;
90+
},
91+
},
7092
7193
node() {
7294
return this.$root.$children[0].$refs.modeler.highlightedNode.definition;
@@ -94,13 +116,24 @@ export default {
94116
*
95117
* @param {Object} { nodeId, isDisabled }
96118
*/
97-
handleInterstitial({ nodeId, show }) {
119+
handleInterstitial({ nodeId, show, isConditionalRedirect = false }) {
98120
if (nodeId !== this.node.id) {
99121
return;
100122
}
101123
if (show) {
102124
this.$set(this.node, "allowInterstitial", true);
103125
} else {
126+
// Prevent disabling interstitial if displayNextAssignedTask is set via conditional redirect or element destination
127+
const isDisplayNextAssignedTask =
128+
(isConditionalRedirect && this.elementDestination?.type === "displayNextAssignedTask") ||
129+
(!isConditionalRedirect &&
130+
Array.isArray(this.conditionalRedirect?.conditions) &&
131+
this.conditionalRedirect.conditions.some(
132+
(condition) => condition?.taskDestination?.value === "displayNextAssignedTask"
133+
));
134+
135+
if (isDisplayNextAssignedTask) return;
136+
104137
this.$set(this.node, "allowInterstitial", false);
105138
}
106139
},

0 commit comments

Comments
 (0)