Skip to content

Commit

Permalink
[NOREF] Fix status column sorting on requests tables (#2757)
Browse files Browse the repository at this point in the history
Fix status column sorting on requests tables
  • Loading branch information
adamodd committed Aug 12, 2024
1 parent a11dc0f commit 5f34ced
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
17 changes: 9 additions & 8 deletions src/components/RequestRepository/useRequestTableColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ const useRequestTableColumns = (

const statusColumn: Column<SystemIntakeForTable> = {
Header: t<string>('intake:fields.status'),
accessor: 'statusAdmin',
Cell: ({
row,
value
}: CellProps<SystemIntakeForTable, SystemIntakeForTable['statusAdmin']>) =>
t(`governanceReviewTeam:systemIntakeStatusAdmin.${value}`, {
lcid: row.original.lcid
})
id: 'statusAdmin',
accessor: obj => {
return t(
`governanceReviewTeam:systemIntakeStatusAdmin.${obj.statusAdmin}`,
{
lcid: obj.lcid
}
);
}
};

const lcidExpirationDateColumn: Column<SystemIntakeForTable> = {
Expand Down
12 changes: 6 additions & 6 deletions src/views/MyRequests/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ const Table = ({
Header: t('requestsTable.headers.status'),
// The status property is just a generic property available on all request types
// See cases below for details on how statuses are determined by type
accessor: 'status',
Cell: ({ row, value }: any) => {
switch (row.original.type) {
id: 'status',
accessor: (obj: any) => {
switch (obj.type) {
case t(`requestsTable.types.GOVERNANCE_REQUEST`):
return t(
`governanceReviewTeam:systemIntakeStatusRequester.${row.original.statusRequester}`,
{ lcid: row.original.lcid }
`governanceReviewTeam:systemIntakeStatusRequester.${obj.statusRequester}`,
{ lcid: obj.lcid }
);
case t(`requestsTable.types.TRB`):
return value;
return obj.status;
default:
return '';
}
Expand Down

0 comments on commit 5f34ced

Please sign in to comment.