From 21ab7d721280384b21f125330da5754e62d44b3a Mon Sep 17 00:00:00 2001 From: Steffen Ghs Date: Wed, 18 Dec 2024 02:41:52 +0100 Subject: [PATCH] Fixed areEqualOutcomes name/displayName comparison in workflow-editor.ts (#17255) --- .../OrchardCore.Workflows/Assets/Scripts/workflow-editor.ts | 2 +- .../wwwroot/Scripts/orchard.workflows-editor.js | 2 +- .../wwwroot/Scripts/orchard.workflows-editor.min.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Assets/Scripts/workflow-editor.ts b/src/OrchardCore.Modules/OrchardCore.Workflows/Assets/Scripts/workflow-editor.ts index b3e101cb5f8..0c6957f2fcf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Assets/Scripts/workflow-editor.ts +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Assets/Scripts/workflow-editor.ts @@ -39,7 +39,7 @@ class WorkflowEditor extends WorkflowCanvas { const outcome1 = outcomes1[i]; const outcome2 = outcomes2[i]; - if (outcome1.name != outcome2.displayName || outcome1.displayName != outcome2.displayName) { + if (outcome1.name != outcome2.name || outcome1.displayName != outcome2.displayName) { return false; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/wwwroot/Scripts/orchard.workflows-editor.js b/src/OrchardCore.Modules/OrchardCore.Workflows/wwwroot/Scripts/orchard.workflows-editor.js index 3e27628dec6..dcfdb7f5f8c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/wwwroot/Scripts/orchard.workflows-editor.js +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/wwwroot/Scripts/orchard.workflows-editor.js @@ -333,7 +333,7 @@ var WorkflowEditor = /** @class */function (_super) { for (var i = 0; i < outcomes1.length; i++) { var outcome1 = outcomes1[i]; var outcome2 = outcomes2[i]; - if (outcome1.name != outcome2.displayName || outcome1.displayName != outcome2.displayName) { + if (outcome1.name != outcome2.name || outcome1.displayName != outcome2.displayName) { return false; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/wwwroot/Scripts/orchard.workflows-editor.min.js b/src/OrchardCore.Modules/OrchardCore.Workflows/wwwroot/Scripts/orchard.workflows-editor.min.js index e86471d28ac..08783025b0d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/wwwroot/Scripts/orchard.workflows-editor.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/wwwroot/Scripts/orchard.workflows-editor.min.js @@ -1 +1 @@ -var applyFilter=function(t,e){var i=$(".modal-activities").data("activity-type");t=t||$(".activity-picker-categories .nav-link.active").attr("href").substr(1),e=e||$(".modal-activities input[type=search]").val();var o=$(".activity.col").show();o.filter((function(t,e){return $(e).data("activity-type")!=i})).hide(),e.length>0?o.filter((function(t,i){return $(i).find(".card-title").text().toLowerCase().indexOf(e.toLowerCase())<0&&e&&e.length>0})).hide():o.filter((function(e,i){return $(i).data("category").toLowerCase()!=t.toLowerCase()&&"all"!=t.toLowerCase()})).hide(),$(".activity-picker-categories [data-category]").each((function(t,e){var o=$(e),a=o.data("category");0==$(".activity.col[data-category='".concat(a,"'][data-activity-type='").concat(i,"']")).length?o.hide():o.show()}))};$((function(){$(".activity-picker-categories").on("click",".nav-link",(function(t){applyFilter($(t.target).attr("href").substr(1),null)})),$(".modal-activities input[type=search]").on("keyup",(function(t){applyFilter(null,$(t.target).val())})),$("#activity-picker").on("show.bs.modal",(function(t){var e=$(t.relatedTarget),i=e.data("picker-title"),o=e.data("activity-type"),a=$(this);a.find('[href="#all"]').click(),a.find(".modal-title").text(i),a.data("activity-type",o),applyFilter(null,null)}))})),$((function(){var t=function(){var t=$("[data-workflow-type-id]").data("workflow-type-id"),e=$("[data-activity-id]").data("activity-id"),i=$("#token-lifespan").val(),o=$("[data-generate-url]").data("generate-url")+"?workflowTypeId=".concat(t,"&activityId=").concat(e,"&tokenLifeSpan=").concat(i),a=$("[data-antiforgery-header-name]").data("antiforgery-header-name"),n=$("[data-antiforgery-token]").data("antiforgery-token"),r={};r[a]=n,$.post({url:o,headers:r}).done((function(t){$("#workflow-url-text").val(t)}))};$("#generate-url-button").on("click",(function(e){t()})),""==$("#workflow-url-text").val()&&t()}));var WorkflowCanvas=function(t,e){var i=this;this.container=t,this.workflowType=e,this.minCanvasHeight=400,this.getActivityElements=function(){return $(i.container).find(".activity")},this.getDefaults=function(){return{Anchor:"Continuous",DragOptions:{cursor:"pointer",zIndex:2e3},EndpointStyles:[{fillStyle:"#225588"}],Endpoints:[["Dot",{radius:7}],["Blank"]],ConnectionOverlays:[["Arrow",{width:12,length:12,location:-5}]],ConnectorZIndex:5}},this.createJsPlumbInstance=function(){return jsPlumb.getInstance({DragOptions:{cursor:"pointer",zIndex:2e3},ConnectionOverlays:[["Arrow",{location:1,visible:!0,width:11,length:11}],["Label",{location:.5,id:"label",cssClass:"connection-label"}]],Container:i.container})},this.getEndpointColor=function(t){return t.isBlocking||t.isStart?"#7ab02c":t.isEvent?"#3a8acd":"#7ab02c"},this.getSourceEndpointOptions=function(t,e){var o=i.getEndpointColor(t);return{endpoint:"Dot",anchor:"Continuous",paintStyle:{stroke:o,fill:o,radius:7,strokeWidth:1},isSource:!0,connector:["Flowchart",{stub:[40,60],gap:0,cornerRadius:5,alwaysRespectStubs:!0}],connectorStyle:{strokeWidth:2,stroke:"#999999",joinstyle:"round",outlineStroke:"white",outlineWidth:2},hoverPaintStyle:{fill:"#216477",stroke:"#216477"},connectorHoverStyle:{strokeWidth:3,stroke:"#216477",outlineWidth:5,outlineStroke:"white"},connectorOverlays:[["Label",{location:[3,-1.5],cssClass:"endpointSourceLabel"}]],dragOptions:{},uuid:"".concat(t.id,"-").concat(e.name),parameters:{outcome:e}}},this.getActivity=function(t,e){return void 0===e&&(e=null),e||(e=this.workflowType.activities),$.grep(e,(function(e){return e.id===t}))[0]},this.updateConnections=function(t){for(var e=i.workflowType.id,o=0,a=i.workflowType.transitions;oe&&(e=c,i=r.height())}var s=e+i;s-(e+i)<=100&&(s+=100),t.height(Math.max(this.minCanvasHeight,s))}},__extends=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),WorkflowEditor=function(t){function e(e,i,o,a,n){var r=t.call(this,e,i)||this;r.container=e,r.workflowType=i,r.deleteActivityPrompt=o,r.localId=a,r.getState=function(){for(var t=$(r.container).find(".activity"),e={id:r.workflowType.id,activities:[],transitions:[],removedActivities:r.workflowType.removedActivities},i=0;i-1)a.remove();else{var s=r.getActivity(c),l=r.getActivity(c,e.activities);if(n)if(null==s)s=l,r.workflowType.activities.push(s),s.x=50,s.y=50;else(function(t,e){if(t.length!=e.length)return!1;for(var i=0;i0?o.filter((function(t,i){return $(i).find(".card-title").text().toLowerCase().indexOf(e.toLowerCase())<0&&e&&e.length>0})).hide():o.filter((function(e,i){return $(i).data("category").toLowerCase()!=t.toLowerCase()&&"all"!=t.toLowerCase()})).hide(),$(".activity-picker-categories [data-category]").each((function(t,e){var o=$(e),a=o.data("category");0==$(".activity.col[data-category='".concat(a,"'][data-activity-type='").concat(i,"']")).length?o.hide():o.show()}))};$((function(){$(".activity-picker-categories").on("click",".nav-link",(function(t){applyFilter($(t.target).attr("href").substr(1),null)})),$(".modal-activities input[type=search]").on("keyup",(function(t){applyFilter(null,$(t.target).val())})),$("#activity-picker").on("show.bs.modal",(function(t){var e=$(t.relatedTarget),i=e.data("picker-title"),o=e.data("activity-type"),a=$(this);a.find('[href="#all"]').click(),a.find(".modal-title").text(i),a.data("activity-type",o),applyFilter(null,null)}))})),$((function(){var t=function(){var t=$("[data-workflow-type-id]").data("workflow-type-id"),e=$("[data-activity-id]").data("activity-id"),i=$("#token-lifespan").val(),o=$("[data-generate-url]").data("generate-url")+"?workflowTypeId=".concat(t,"&activityId=").concat(e,"&tokenLifeSpan=").concat(i),a=$("[data-antiforgery-header-name]").data("antiforgery-header-name"),n=$("[data-antiforgery-token]").data("antiforgery-token"),r={};r[a]=n,$.post({url:o,headers:r}).done((function(t){$("#workflow-url-text").val(t)}))};$("#generate-url-button").on("click",(function(e){t()})),""==$("#workflow-url-text").val()&&t()}));var WorkflowCanvas=function(t,e){var i=this;this.container=t,this.workflowType=e,this.minCanvasHeight=400,this.getActivityElements=function(){return $(i.container).find(".activity")},this.getDefaults=function(){return{Anchor:"Continuous",DragOptions:{cursor:"pointer",zIndex:2e3},EndpointStyles:[{fillStyle:"#225588"}],Endpoints:[["Dot",{radius:7}],["Blank"]],ConnectionOverlays:[["Arrow",{width:12,length:12,location:-5}]],ConnectorZIndex:5}},this.createJsPlumbInstance=function(){return jsPlumb.getInstance({DragOptions:{cursor:"pointer",zIndex:2e3},ConnectionOverlays:[["Arrow",{location:1,visible:!0,width:11,length:11}],["Label",{location:.5,id:"label",cssClass:"connection-label"}]],Container:i.container})},this.getEndpointColor=function(t){return t.isBlocking||t.isStart?"#7ab02c":t.isEvent?"#3a8acd":"#7ab02c"},this.getSourceEndpointOptions=function(t,e){var o=i.getEndpointColor(t);return{endpoint:"Dot",anchor:"Continuous",paintStyle:{stroke:o,fill:o,radius:7,strokeWidth:1},isSource:!0,connector:["Flowchart",{stub:[40,60],gap:0,cornerRadius:5,alwaysRespectStubs:!0}],connectorStyle:{strokeWidth:2,stroke:"#999999",joinstyle:"round",outlineStroke:"white",outlineWidth:2},hoverPaintStyle:{fill:"#216477",stroke:"#216477"},connectorHoverStyle:{strokeWidth:3,stroke:"#216477",outlineWidth:5,outlineStroke:"white"},connectorOverlays:[["Label",{location:[3,-1.5],cssClass:"endpointSourceLabel"}]],dragOptions:{},uuid:"".concat(t.id,"-").concat(e.name),parameters:{outcome:e}}},this.getActivity=function(t,e){return void 0===e&&(e=null),e||(e=this.workflowType.activities),$.grep(e,(function(e){return e.id===t}))[0]},this.updateConnections=function(t){for(var e=i.workflowType.id,o=0,a=i.workflowType.transitions;oe&&(e=c,i=r.height())}var s=e+i;s-(e+i)<=100&&(s+=100),t.height(Math.max(this.minCanvasHeight,s))}},__extends=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),WorkflowEditor=function(t){function e(e,i,o,a,n){var r=t.call(this,e,i)||this;r.container=e,r.workflowType=i,r.deleteActivityPrompt=o,r.localId=a,r.getState=function(){for(var t=$(r.container).find(".activity"),e={id:r.workflowType.id,activities:[],transitions:[],removedActivities:r.workflowType.removedActivities},i=0;i-1)a.remove();else{var s=r.getActivity(c),l=r.getActivity(c,e.activities);if(n)if(null==s)s=l,r.workflowType.activities.push(s),s.x=50,s.y=50;else(function(t,e){if(t.length!=e.length)return!1;for(var i=0;i