diff --git a/packages/console/src/components/Executions/TaskExecutionsList/utils.ts b/packages/console/src/components/Executions/TaskExecutionsList/utils.ts index 4fdb94ffc..d2809ac6f 100644 --- a/packages/console/src/components/Executions/TaskExecutionsList/utils.ts +++ b/packages/console/src/components/Executions/TaskExecutionsList/utils.ts @@ -38,6 +38,7 @@ export const getGroupedLogs = ( ): LogsByPhase => { const logsByPhase: LogsByPhase = new Map(); + // backfill the index as some resources come back without an index. resources = resources.map((r, i) => ({ index: i, ...r, @@ -70,7 +71,7 @@ export const getGroupedLogs = ( // if there is no log with active url, just create an item with externalId, // for user to understand which array items are in this state const newLogs = - item.logs.length > 0 ? item.logs.map(l => ({...l, index:item.index})) : [{ name: item.externalId, index:item.index }]; + item.logs.length > 0 ? item.logs.map(l => ({ ...l, index: item.index })) : [{ name: item.externalId, index: item.index }]; logsByPhase.set( phase, currentValue ? [...currentValue, ...newLogs] : [...newLogs], diff --git a/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx b/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx index 9a20aa2da..107b9121f 100644 --- a/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx +++ b/packages/console/src/components/common/MapTaskExecutionsList/TaskNameList.tsx @@ -43,7 +43,7 @@ export const TaskNameList = ({ return ( <> - {logs.map((log, taskIndex) => { + {logs.map((log, _taskIndex) => { const taskLogName = getTaskLogName( taskExecution.id.taskId.name, log.name ?? '', @@ -57,6 +57,7 @@ export const TaskNameList = ({ )?.cacheStatus; const handleClick = () => { + // Use the resource's index instead of the log index onTaskSelected({ ...taskExecution, taskIndex: (log as any).index }); };