File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
app/javascript/components/workflows Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,24 @@ const rowInfo = (headers, response) => {
1717 const isValid = ! ! workflow . payload ;
1818 return {
1919 id : workflow . id . toString ( ) ,
20+ name : workflow . name ,
2021 cells : celInfo ( workflow ) ,
2122 clickable : isValid ,
2223 disabled : ! isValid ,
2324 } ;
2425 } ) ;
25- const miqRows = rowData ( headerKeys , rows , false ) ;
26+
27+ // Sort: valid workflows first (alphabetically), then invalid workflows (alphabetically)
28+ const sortedRows = rows . sort ( ( a , b ) => {
29+ // If both have same validity status, sort alphabetically by name
30+ if ( a . disabled === b . disabled ) {
31+ return a . name . localeCompare ( b . name ) ;
32+ }
33+ // Valid (not disabled) workflows come first
34+ return a . disabled ? 1 : - 1 ;
35+ } ) ;
36+
37+ const miqRows = rowData ( headerKeys , sortedRows , false ) ;
2638 return miqRows . rowItems ;
2739} ;
2840
You can’t perform that action at this time.
0 commit comments