Skip to content

Commit

Permalink
Merge pull request #7754 from vikram-raj/odc-5304
Browse files Browse the repository at this point in the history
Bug 1913851: sort cluster task in pipeline builder
  • Loading branch information
openshift-merge-robot committed Jan 12, 2021
2 parents 37b7b1d + ab5c02a commit 7337ae7
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import { useTranslation } from 'react-i18next';
import { Button, Flex, FlexItem, FocusTrap } from '@patternfly/react-core';
import { CaretDownIcon } from '@patternfly/react-icons';
Expand Down Expand Up @@ -43,10 +44,13 @@ const TaskListNode: React.FC<TaskListNodeProps> = ({ element, unselectedText })
const { height, width } = element.getBounds();
const { clusterTaskList, namespaceTaskList, onNewTask, onRemoveTask } = element.getData();

const options = [
...namespaceTaskList.map((task) => taskToOption(task, onNewTask)),
...clusterTaskList.map((task) => taskToOption(task, onNewTask)),
];
const options = _.sortBy(
[
...namespaceTaskList.map((task) => taskToOption(task, onNewTask)),
...clusterTaskList.map((task) => taskToOption(task, onNewTask)),
],
(o) => o.label,
);

return (
<foreignObject width={width} height={height} className="odc-task-list-node">
Expand Down

0 comments on commit 7337ae7

Please sign in to comment.