diff --git a/dotCMS/src/main/webapp/html/portlet/ext/workflows/schemes/view_steps.jsp b/dotCMS/src/main/webapp/html/portlet/ext/workflows/schemes/view_steps.jsp index 7708cf070362..2183452f3e24 100644 --- a/dotCMS/src/main/webapp/html/portlet/ext/workflows/schemes/view_steps.jsp +++ b/dotCMS/src/main/webapp/html/portlet/ext/workflows/schemes/view_steps.jsp @@ -22,10 +22,10 @@ + +<% + // Split actions into primary and secondary + List primaryActions = new ArrayList<>(); + List secondaryActions = new ArrayList<>(); + + for(WorkflowAction action : actions) { + String isSecondary = action.getMetadata() != null ? String.valueOf(action.getMetadata().get("secondary")) : "false"; + if("true".equals(isSecondary)) { + secondaryActions.add(action); + } else { + primaryActions.add(action); + } + } + +%> +
@@ -86,21 +108,63 @@
-
- <%for(WorkflowAction action : actions) { - String subtype = action.getMetadata() != null ? String.valueOf(action.getMetadata().get("subtype")) : ""; - boolean isSeparator = "SEPARATOR".equals(subtype); - %> -
-
-
""> -
-
onClick="actionAdmin.viewAction('<%=scheme.getId()%>', '<%=action.getId() %>');" <% } %>> - <%=action.getName() %> ‣ <%=(WorkflowAction.CURRENT_STEP.equals(action.getNextStep())) ? WorkflowAction.CURRENT_STEP : wapi.findStep(action.getNextStep()).getName() %> -
-
+
+ +
Primary
+
"> + + <%for(WorkflowAction action : primaryActions) { %> + +
+
+
+
+ +
+
+ <%=action.getName()%> + ‣ + <%=(WorkflowAction.CURRENT_STEP.equals(action.getNextStep())) ? + WorkflowAction.CURRENT_STEP : + wapi.findStep(action.getNextStep()).getName()%> + +
+
+
+ <%}%> +
+ +
Secondary
+
""> + + <%for(WorkflowAction action : secondaryActions) { %> + +
+
+
+
+ +
+
+ <%=action.getName()%> + ‣ + <%=(WorkflowAction.CURRENT_STEP.equals(action.getNextStep())) ? + WorkflowAction.CURRENT_STEP : + wapi.findStep(action.getNextStep()).getName()%> + +
+
+
+ <%}%>
- <%} %> +
@@ -111,17 +175,10 @@ <% } %> - <% - String newContentEditorEnabled = Config.getStringProperty("CONTENT_EDITOR2_ENABLED"); - if (newContentEditorEnabled != null && newContentEditorEnabled.equalsIgnoreCase("true")) { - %> -
- Divider -
- <% } %>
Add
+
@@ -145,3 +202,16 @@
+ \ No newline at end of file diff --git a/dotCMS/src/main/webapp/html/portlet/ext/workflows/schemes/workflow_js.jsp b/dotCMS/src/main/webapp/html/portlet/ext/workflows/schemes/workflow_js.jsp index ab9a4a05ee01..4e085189282d 100644 --- a/dotCMS/src/main/webapp/html/portlet/ext/workflows/schemes/workflow_js.jsp +++ b/dotCMS/src/main/webapp/html/portlet/ext/workflows/schemes/workflow_js.jsp @@ -1140,6 +1140,48 @@ dojo.declare("dotcms.dijit.workflows.ActionAdmin", null, { dojo.xhrPost(xhrArgs); }, + + saveActionPriority : function(ele, isSecondary) { + const actionData = JSON.parse(ele.dataset.wfaction); + + const updatedData = { + schemeId: actionData.schemeId, + actionName: actionData.name, + whoCanUse: actionData.showOn, + actionIcon: actionData.icon, + actionCommentable: actionData.commentable, + showOn: actionData.showOn, + actionNextStep: actionData.nextStep, + actionNextAssign: actionData.nextAssign, + actionCondition: actionData.condition, + actionAssignable: actionData.assignable, + actionRoleHierarchyForAssign: actionData.roleHierarchyForAssign, + metadata: isSecondary + ? {...actionData.metadata, secondary: true} + : (actionData.metadata ? Object.fromEntries( + Object.entries(actionData.metadata).filter(([key]) => key !== 'secondary') + ) : {}) + }; + + + const xhrArgs = { + url: "/api/v1/workflow/actions/" + actionData.id, + headers: { + "Content-Type": "application/json" + }, + postData: dojo.toJson(updatedData), + handle: function (dataOrError, ioArgs) { + if (dojo.isString(dataOrError)) { + if (dataOrError.indexOf("FAILURE") === 0) { + showDotCMSSystemMessage(dataOrError, true); + } + } + } + }; + + dojo.xhrPut(xhrArgs); + }, + saveAction : function(schemeId) { var myForm = dijit.byId("addEditAction");