Skip to content

Commit 3ddbed0

Browse files
author
Sergiu Miclea
committed
Reverse progress updates sorting
The first progress update should also be the first one in the list, mimicking an actual console output.
1 parent de0a067 commit 3ddbed0

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/components/molecules/TaskItem/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class TaskItem extends React.Component<Props> {
144144
getLastMessage() {
145145
let message
146146
if (this.props.item.progress_updates.length) {
147-
message = this.props.item.progress_updates[0].message
147+
message = this.props.item.progress_updates[this.props.item.progress_updates.length - 1].message
148148
} else {
149149
message = '-'
150150
}

src/sources/MigrationSource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MigrationSourceUtils {
3333
if (sortNull !== false) {
3434
return sortNull
3535
}
36-
return moment(a.created_at).isBefore(moment(b.created_at))
36+
return moment(b.created_at).isBefore(moment(a.created_at))
3737
})
3838
}
3939
})

src/sources/ReplicaSource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class ReplicaSourceUtils {
7676
if (execution.tasks) {
7777
execution.tasks.forEach(task => {
7878
if (task.progress_updates) {
79-
task.progress_updates.sort((a, b) => moment(a.created_at).isBefore(moment(b.created_at)))
79+
task.progress_updates.sort((a, b) => moment(b.created_at).isBefore(moment(a.created_at)))
8080
}
8181
})
8282
}

0 commit comments

Comments
 (0)