Skip to content

Commit 5d6c514

Browse files
committed
Updated the attribute that checks workflow validity
1 parent b8e151c commit 5d6c514

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

app/javascript/components/workflows/helper.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const cellInfo = (workflow) => [
1616
const rowInfo = (headers, response) => {
1717
const headerKeys = headers.map((item) => item.key);
1818
const rows = response.resources.map((workflow) => {
19-
const isValid = !!workflow.payload;
19+
const isValid = workflow.payload_valid;
2020
return {
2121
id: workflow.id.toString(),
2222
name: workflow.name,
@@ -26,17 +26,18 @@ const rowInfo = (headers, response) => {
2626
};
2727
});
2828

29-
// Sort: valid workflows first (alphabetically), then invalid workflows (alphabetically)
30-
const sortedRows = rows.sort((a, b) => {
31-
// If both have same validity status, sort alphabetically by name
32-
if (a.disabled === b.disabled) {
33-
return a.name.localeCompare(b.name);
34-
}
35-
// Valid workflows come first
36-
return a.disabled ? 1 : -1;
37-
});
29+
// // Sort: valid workflows first (alphabetically), then invalid workflows (alphabetically)
30+
// const sortedRows = rows.sort((a, b) => {
31+
// // If both have same validity status, sort alphabetically by name
32+
// if (a.disabled === b.disabled) {
33+
// return a.name.localeCompare(b.name);
34+
// }
35+
// // Valid workflows come first
36+
// return a.disabled ? 1 : -1;
37+
// });
3838

39-
const miqRows = rowData(headerKeys, sortedRows, false);
39+
// const miqRows = rowData(headerKeys, sortedRows, false);
40+
const miqRows = rowData(headerKeys, rows, false);
4041
return miqRows.rowItems;
4142
};
4243

app/javascript/components/workflows/workflow-entry-points.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ const WorkflowEntryPoints = ({
155155
open
156156
modalHeading={sprintf(__('Select Embedded Workflow - %s Entry Point'), workflowTypes[type])}
157157
primaryButtonText={__('Apply')}
158-
primaryButtonDisabled={!data.selectedItemId}
159-
// primaryButtonDisabled={!isValidSelection()}
158+
primaryButtonDisabled={!isValidSelection()}
160159
secondaryButtonText={__('Cancel')}
161160
onRequestSubmit={onApply}
162161
onRequestClose={onCloseModal}

0 commit comments

Comments
 (0)