Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina committed Mar 16, 2023
1 parent 02f310b commit c87c42f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? '',
Expand All @@ -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 });
};

Expand Down

0 comments on commit c87c42f

Please sign in to comment.