diff --git a/frontend/benefit/applicant/browser-tests/pages/company.testcafe.ts b/frontend/benefit/applicant/browser-tests/pages/company.testcafe.ts index 613e7dcf3a..e9f39e1148 100644 --- a/frontend/benefit/applicant/browser-tests/pages/company.testcafe.ts +++ b/frontend/benefit/applicant/browser-tests/pages/company.testcafe.ts @@ -2,7 +2,8 @@ import { HttpRequestHook } from '@frontend/shared/browser-tests/http-utils/http- import requestLogger from '@frontend/shared/browser-tests/utils/request-logger'; import { clearDataToPrintOnFailure } from '@frontend/shared/browser-tests/utils/testcafe.utils'; import { convertToUIDateFormat } from '@frontend/shared/src/utils/date.utils'; -import { addMonths, subMonths } from 'date-fns'; +import addDays from 'date-fns/addDays'; +import subMonths from 'date-fns/subMonths'; import { t } from 'testcafe'; import DeMinimisAid from '../page-model/deminimis'; @@ -28,7 +29,7 @@ fixture('Company') }); const startDate = subMonths(new Date(), 4); -const endDate = addMonths(new Date(), 3); +const endDate = addDays(startDate, 30); const form: ApplicationFormData = { organization: { iban: '6051437344779954', diff --git a/frontend/benefit/handler/src/components/applicationList/HandlerIndex.tsx b/frontend/benefit/handler/src/components/applicationList/HandlerIndex.tsx index acf7baab9c..0e8338fed7 100644 --- a/frontend/benefit/handler/src/components/applicationList/HandlerIndex.tsx +++ b/frontend/benefit/handler/src/components/applicationList/HandlerIndex.tsx @@ -52,12 +52,16 @@ const HandlerIndex: React.FC = ({ [APPLICATION_STATUSES.ACCEPTED].includes(app.status) ).length; + const getTabCountAll = (): number => + list.filter((app: ApplicationListItemData) => !app.batch).length; + const getTabCount = ( statuses: APPLICATION_STATUSES[], handled?: 'inPayment' | 'pending' ): number => { if (handled === 'pending') return getTabCountPending(); if (handled === 'inPayment') return getTabCountInPayment(); + if (handled === 'all') return getTabCountAll(); return list.filter((app: ApplicationListItemData) => statuses.includes(app.status) ).length; @@ -133,7 +137,7 @@ const HandlerIndex: React.FC = ({ !app.batch)} heading={t(`${translationBase}.all`)} status={ALL_APPLICATION_STATUSES} /> diff --git a/frontend/benefit/handler/src/pages/index.tsx b/frontend/benefit/handler/src/pages/index.tsx index 0e2d5c05c3..d44d11696e 100644 --- a/frontend/benefit/handler/src/pages/index.tsx +++ b/frontend/benefit/handler/src/pages/index.tsx @@ -42,12 +42,13 @@ const ApplicantIndex: NextPage = () => { const translationBase = 'common:applications.list.headings'; + const isNewAhjoMode = useDetermineAhjoMode(); + const { list, shouldShowSkeleton } = useApplicationListData( ALL_APPLICATION_STATUSES, - true + !isNewAhjoMode ); const { t } = useApplicationList(); - const isNewAhjoMode = useDetermineAhjoMode(); const getHeadingTranslation = ( headingStatus: APPLICATION_STATUSES | 'all'