Skip to content

Commit

Permalink
fix: applications would show up in decision list even though complete (
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Jun 24, 2024
1 parent 7ec660c commit 019d149
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ export interface ApplicationListProps {
}
const translationBase = 'common:applications.list.headings';

const batchStatusesHandlingComplete = (batchStatus: BATCH_STATUSES): boolean =>
[
BATCH_STATUSES.DECIDED_ACCEPTED,
BATCH_STATUSES.DECIDED_REJECTED,
BATCH_STATUSES.SENT_TO_TALPA,
BATCH_STATUSES.COMPLETED,
BATCH_STATUSES.REJECTED_BY_TALPA,
].includes(batchStatus);

const HandlerIndex: React.FC<ApplicationListProps> = ({
// heading,
// status,
layoutBackgroundColor,
list = [],
isLoading = true,
Expand All @@ -44,11 +51,7 @@ const HandlerIndex: React.FC<ApplicationListProps> = ({
[APPLICATION_STATUSES.ACCEPTED, APPLICATION_STATUSES.REJECTED].includes(
app.status
) &&
![
BATCH_STATUSES.DECIDED_ACCEPTED,
BATCH_STATUSES.DECIDED_REJECTED,
BATCH_STATUSES.SENT_TO_TALPA,
].includes(app.batch?.status)
!batchStatusesHandlingComplete(app?.batch?.status)
).length;

const getTabCountInPayment = (): number =>
Expand Down Expand Up @@ -202,10 +205,7 @@ const HandlerIndex: React.FC<ApplicationListProps> = ({
APPLICATION_STATUSES.ACCEPTED,
APPLICATION_STATUSES.REJECTED,
].includes(app.status) &&
![
BATCH_STATUSES.DECIDED_ACCEPTED,
BATCH_STATUSES.DECIDED_REJECTED,
].includes(app?.batch?.status)
!batchStatusesHandlingComplete(app?.batch?.status)
)}
heading={t(`${translationBase}.pending`)}
status={[
Expand Down

0 comments on commit 019d149

Please sign in to comment.