Skip to content

Commit

Permalink
Fix issue where History and SubProcs buttons on Processes page were c…
Browse files Browse the repository at this point in the history
…lickable when the process was otherwise pending or disabled.
  • Loading branch information
jdrodjpl committed Dec 17, 2024
1 parent be8aee7 commit 12edaf3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions install/cws-ui/processes.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,20 @@
orderable: false
},
{
data: "procInstId",
data: { procInstId: "procInstId", status: "status" },
defaultContent: '',
className: 'details-control',
orderable: false,
render: function (data, type) {
if (type === 'display') {
if (data == null) {
return '<a onclick="viewHistory(\'' + data + '\')" href="/${base}/history?procInstId=' + data + '" ><button style=\"margin-bottom: 5px;\" class="btn btn-outline-dark btn-sm disabled">History</button></a>' +
"<a style=\"margin-bottom: 5px;\" onclick=\"viewSubProcs('" + data + "')\"><button class=\"btn btn-outline-dark btn-sm disabled\" style=\"margin-bottom: 5px\">Subprocs</button></a>";
var isDisabled = (data.status === 'pending' || data.status === 'disabled');
if (data == null || isDisabled) {
return '<a onclick="return false;"><button style=\"margin-bottom: 5px;\" class="btn btn-outline-dark btn-sm disabled">History</button></a>' +
"<a style=\"margin-bottom: 5px;\" onclick=\"return false;\"><button class=\"btn btn-outline-dark btn-sm disabled\" style=\"margin-bottom: 5px\">Subprocs</button></a>";
}
return '<a onclick="viewHistory(\'' + data + '\')" href="/${base}/history?procInstId=' + data + '" ><button style=\"margin-bottom: 5px;\" class="btn btn-outline-dark btn-sm">History</button></a>' +
"<a style=\"margin-bottom: 5px;\" onclick=\"viewSubProcs('" + data + "')\"><button class=\"btn btn-outline-dark btn-sm\">Subprocs</button></a>";
return '<a onclick="viewHistory(\'' + data.procInstId + '\')" href="/${base}/history?procInstId=' + data.procInstId + '" ><button style=\"margin-bottom: 5px;\" class="btn btn-outline-dark btn-sm">History</button></a>' +
"<a style=\"margin-bottom: 5px;\" onclick=\"viewSubProcs('" + data.procInstId + "')\"><button class=\"btn btn-outline-dark btn-sm\">Subprocs</button></a>";
}
return data;
}
Expand Down

0 comments on commit 12edaf3

Please sign in to comment.