Skip to content

Commit

Permalink
fix: tekton table sorting (#2287)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eswaraiahsapram authored Oct 4, 2024
1 parent 101260d commit 45f6107
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions plugins/tekton/src/__fixtures__/1-pipelinesData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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',
Expand Down
22 changes: 11 additions & 11 deletions plugins/tekton/src/components/PipelineRunList/PipelineRunList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<unknown>,
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<unknown>, 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);
Expand Down

0 comments on commit 45f6107

Please sign in to comment.