diff --git a/plugins/tekton/src/__fixtures__/1-pipelinesData.ts b/plugins/tekton/src/__fixtures__/1-pipelinesData.ts index b4723f7796..17335fd502 100644 --- a/plugins/tekton/src/__fixtures__/1-pipelinesData.ts +++ b/plugins/tekton/src/__fixtures__/1-pipelinesData.ts @@ -562,7 +562,7 @@ export const mockKubernetesPlrResponse = { name: 'pipeline-test-wbvtlk', namespace: 'deb-test', resourceVersion: '117337', - uid: '0a091bbf-3813-48d3-a6ce-fc43644a9b24', + uid: '0a091bbf-3813-48d3-a6ce-fc43644a9a24', creationTimestamp: new Date('2023-04-11T12:31:56Z'), }, spec: { @@ -649,7 +649,7 @@ export const mockKubernetesPlrResponse = { name: 'pipelinerun-with-scanner-task', namespace: 'deb-test', resourceVersion: '117337', - uid: '0a091bbf-3813-48d3-a6ce-fc43644a9b24', + uid: '0a091bbf-3813-48d3-a6ce-fc43644a9b14', creationTimestamp: new Date('2023-04-11T12:31:56Z'), }, spec: { @@ -716,7 +716,7 @@ export const mockKubernetesPlrResponse = { name: 'pipelinerun-with-sbom-task', namespace: 'deb-test', resourceVersion: '117337', - uid: '0a091bbf-3813-48d3-a6ce-fc43644a9b24', + uid: '0a091bbf-3813-48d3-a6ce-fc43644a8b24', creationTimestamp: new Date('2023-04-11T12:31:56Z'), }, spec: { @@ -776,7 +776,7 @@ export const mockKubernetesPlrResponse = { name: 'pipelinerun-with-external-sbom-task', namespace: 'deb-test', resourceVersion: '117337', - uid: '0a091bbf-3813-48d3-a6ce-fc43644a9b24', + uid: '0a091bbf-3813-48d3-a6ce-fc43644a9b26', creationTimestamp: new Date('2023-04-11T12:31:56Z'), }, spec: { @@ -1055,7 +1055,7 @@ export const mockKubernetesPlrResponse = { controller: true, kind: 'PipelineRun', name: 'pipelinerun-with-scanner-task', - uid: '0a091bbf-3813-48d3-a6ce-fc43644a9b24', + uid: '0a091bbf-3813-48d3-a6ce-fc43644a9t24', }, ], resourceVersion: '117189', diff --git a/plugins/tekton/src/components/PipelineRunList/PipelineRunList.tsx b/plugins/tekton/src/components/PipelineRunList/PipelineRunList.tsx index 9feb0a5501..c0848bc681 100644 --- a/plugins/tekton/src/components/PipelineRunList/PipelineRunList.tsx +++ b/plugins/tekton/src/components/PipelineRunList/PipelineRunList.tsx @@ -145,18 +145,18 @@ const PipelineRunList = () => { page * rowsPerPage, page * rowsPerPage + rowsPerPage, ); - }, [filteredPipelineRuns, page, rowsPerPage]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [filteredPipelineRuns, page, rowsPerPage, order, orderById]); - const handleRequestSort = ( - _event: React.MouseEvent, - property: string, - id: string, - ) => { - const isAsc = orderBy === property && order === 'asc'; - setOrder(isAsc ? 'desc' : 'asc'); - setOrderBy(property); - setOrderById(id); - }; + const handleRequestSort = React.useCallback( + (_event: React.MouseEvent, property: string, id: string) => { + const isAsc = orderBy === property && order === 'asc'; + setOrder(isAsc ? 'desc' : 'asc'); + setOrderBy(property); + setOrderById(id); + }, + [order, orderBy], + ); const handleChangePage = (_event: unknown, newPage: number) => { setPage(newPage);