Skip to content

Commit 6984183

Browse files
authored
ORV2-3417 - superseded permit versions displaying as expired in global search (#1806)
Co-authored-by: GlenAOT <[email protected]>
1 parent 5fb9ff6 commit 6984183

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

frontend/src/features/idir/search/table/PermitSearchResultColumnDef.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const PermitSearchResultColumnDef = (
2727
sortingFn: "alphanumeric",
2828
Cell: (props: { cell: any; row: any }) => {
2929
const permit = props.row.original as PermitListItem;
30+
3031
const { permitId, permitStatus, expiryDate, companyId } = permit;
3132

3233
const getDisplayedPermitStatus = (
@@ -37,6 +38,10 @@ export const PermitSearchResultColumnDef = (
3738
return PERMIT_STATUSES.VOIDED;
3839
}
3940

41+
if (permitStatus === PERMIT_STATUSES.SUPERSEDED) {
42+
return PERMIT_STATUSES.SUPERSEDED;
43+
}
44+
4045
if (hasPermitExpired(expiryDate)) {
4146
return PERMIT_EXPIRED;
4247
}
@@ -105,7 +110,10 @@ export const PermitSearchResultColumnDef = (
105110
enableSorting: true,
106111
sortingFn: dateTimeStringSortingFn,
107112
Cell: (props: { cell: any }) => {
108-
const formattedDate = formatCellValuetoDatetime(props.cell.getValue(), true);
113+
const formattedDate = formatCellValuetoDatetime(
114+
props.cell.getValue(),
115+
true,
116+
);
109117
return formattedDate;
110118
},
111119
},
@@ -115,7 +123,10 @@ export const PermitSearchResultColumnDef = (
115123
enableSorting: true,
116124
sortingFn: dateTimeStringSortingFn,
117125
Cell: (props: { cell: any }) => {
118-
const formattedDate = formatCellValuetoDatetime(props.cell.getValue(), true);
126+
const formattedDate = formatCellValuetoDatetime(
127+
props.cell.getValue(),
128+
true,
129+
);
119130
return formattedDate;
120131
},
121132
},

0 commit comments

Comments
 (0)