Skip to content

Commit e7eff17

Browse files
committed
Sort job step attempts
1 parent 476f15f commit e7eff17

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/job/JobDisplay.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ function JobTaskType({ value = {} }) {
5252
titleKey="step"
5353
value={
5454
Array.isArray(value.subTask)
55-
? value.subTask.sort((a, b) => b.step - a.step)
55+
? value.subTask.sort((a, b) =>
56+
b.step === a.step ? b.attempts - a.attempts : b.step - a.step,
57+
)
5658
: value.subTask
5759
}
5860
component={JobTaskType}
@@ -95,7 +97,13 @@ function StepType({ value }) {
9597
<TypeArray
9698
title="Step"
9799
titleKey="step"
98-
value={Array.isArray(value.task) ? value.task.sort((a, b) => b.step - a.step) : value.task}
100+
value={
101+
Array.isArray(value.task)
102+
? value.task.sort((a, b) =>
103+
b.step === a.step ? b.attempts - a.attempts : b.step - a.step,
104+
)
105+
: value.task
106+
}
99107
component={JobTaskType}
100108
hideNoValue
101109
hover

0 commit comments

Comments
 (0)