File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed
packages/orchestrator-ui-components/src/components/WfoStartButton Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @orchestrator-ui/orchestrator-ui-components ' : patch
3+ ---
4+
5+ 1406 Added sorting for new tasks and workflow dropdowns
Original file line number Diff line number Diff line change @@ -18,14 +18,14 @@ export const WfoStartTaskButtonComboBox = () => {
1818 const { data } = useGetTaskOptionsQuery ( ) ;
1919 const taskOptions = data ?. startOptions || [ ] ;
2020
21- const comboBoxOptions : StartComboBoxOption [ ] = taskOptions . map (
22- ( option ) => ( {
21+ const comboBoxOptions : StartComboBoxOption [ ] = [ ... taskOptions ]
22+ . map ( ( option ) => ( {
2323 data : {
2424 workflowName : option . name ,
2525 } ,
26- label : option . description || '' ,
27- } ) ,
28- ) ;
26+ label : option . description ?? option . name ,
27+ } ) )
28+ . sort ( ( taskA , taskB ) => taskA . label . localeCompare ( taskB . label ) ) ;
2929
3030 const handleOptionChange = async ( selectedProduct : StartComboBoxOption ) => {
3131 if ( await isEngineRunningNow ( ) ) {
Original file line number Diff line number Diff line change @@ -18,15 +18,17 @@ export const WfoStartWorkflowButtonComboBox = () => {
1818 const { data } = useGetWorkflowOptionsQuery ( ) ;
1919 const workflowOptions = data ?. startOptions || [ ] ;
2020
21- const comboBoxOptions : StartComboBoxOption [ ] = workflowOptions . map (
22- ( option ) => ( {
21+ const comboBoxOptions : StartComboBoxOption [ ] = [ ...workflowOptions ]
22+ . sort ( ( workflowA , workflowB ) =>
23+ workflowA . productName . localeCompare ( workflowB . productName ) ,
24+ )
25+ . map ( ( option ) => ( {
2326 data : {
2427 workflowName : option . workflowName ,
2528 productId : option . productId ,
2629 } ,
2730 label : option . productName || '' ,
28- } ) ,
29- ) ;
31+ } ) ) ;
3032
3133 const handleOptionChange = async ( selectedProduct : StartComboBoxOption ) => {
3234 if ( await isEngineRunningNow ( ) ) {
You can’t perform that action at this time.
0 commit comments