Use API order instead of reordering timeline (#1503)
This commit is contained in:
@@ -56,8 +56,6 @@ function WorkflowRunTimeline({
|
||||
|
||||
const workflowRunIsNotFinalized = statusIsNotFinalized(workflowRun);
|
||||
|
||||
const timeline = workflowRunTimeline.slice().reverse();
|
||||
|
||||
const numberOfActions = workflowRunTimeline.reduce((total, current) => {
|
||||
if (isTaskVariantBlockItem(current)) {
|
||||
return total + current.block!.actions!.length;
|
||||
@@ -98,8 +96,10 @@ function WorkflowRunTimeline({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{timeline.length === 0 && <div>Workflow timeline is empty</div>}
|
||||
{timeline?.map((timelineItem) => {
|
||||
{workflowRunTimeline.length === 0 && (
|
||||
<div>Workflow timeline is empty</div>
|
||||
)}
|
||||
{workflowRunTimeline?.map((timelineItem) => {
|
||||
if (isBlockItem(timelineItem)) {
|
||||
return (
|
||||
<WorkflowRunTimelineBlockItem
|
||||
|
||||
@@ -31,7 +31,7 @@ function WorkflowRunTimelineBlockItem({
|
||||
onBlockItemClick,
|
||||
onActionClick,
|
||||
}: Props) {
|
||||
const actions = block.actions ? [...block.actions].reverse() : [];
|
||||
const actions = block.actions ?? [];
|
||||
|
||||
const hasActiveAction =
|
||||
isAction(activeItem) &&
|
||||
|
||||
@@ -37,15 +37,13 @@ function findActiveItem(
|
||||
return "stream";
|
||||
}
|
||||
if (timeline?.length > 0) {
|
||||
const last = timeline.length - 1;
|
||||
const timelineItem = timeline![last];
|
||||
const timelineItem = timeline![0];
|
||||
if (isBlockItem(timelineItem)) {
|
||||
if (
|
||||
timelineItem.block.actions &&
|
||||
timelineItem.block.actions.length > 0
|
||||
) {
|
||||
const last = timelineItem.block.actions.length - 1;
|
||||
return timelineItem.block.actions[last]!;
|
||||
return timelineItem.block.actions[0]!;
|
||||
}
|
||||
return timelineItem.block;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user