Skip to content

Commit 65d12d8

Browse files
committed
chore: change getLogsSearchIndex call signature to object params
1 parent 55fb60b commit 65d12d8

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/Shared/Components/CICDHistory/LogStageAccordion.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ const LogStageAccordion = ({
8585
{isOpen && (
8686
<div className="flexbox-col dc__gap-4">
8787
{logs.map((log: string, logsIndex: number) => {
88-
const doesLineContainSearchMatch = getLogSearchIndex(stageIndex, logsIndex) === searchIndex
88+
const doesLineContainSearchMatch =
89+
getLogSearchIndex({ stageIndex, lineNumberInsideStage: logsIndex }) === searchIndex
8990

9091
return (
9192
<LogsItemContainer

src/Shared/Components/CICDHistory/LogsRenderer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,12 @@ const LogsRenderer = ({
385385

386386
searchKeyStatusMap[lastStage.stage][lastStage.startTime] = true
387387

388-
searchMatchResults.push(getLogSearchIndex(acc.length - 1, lastStage.logs.length - 1))
388+
searchMatchResults.push(
389+
getLogSearchIndex({
390+
stageIndex: acc.length - 1,
391+
lineNumberInsideStage: lastStage.logs.length - 1,
392+
}),
393+
)
389394
}
390395
}
391396

src/Shared/Components/CICDHistory/utils.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,7 @@ export const getTriggerStatusIcon = (triggerDetailStatus: string): JSX.Element =
199199
}
200200
}
201201

202-
export const getLogSearchIndex = (stageIndex: number, lineNumberInsideStage: number) =>
203-
`${stageIndex}-${lineNumberInsideStage}`
202+
export const getLogSearchIndex = ({
203+
stageIndex,
204+
lineNumberInsideStage,
205+
}: Record<'stageIndex' | 'lineNumberInsideStage', number>) => `${stageIndex}-${lineNumberInsideStage}`

0 commit comments

Comments
 (0)