diff --git a/back/extensions/documentation/documentation/1.0.0/full_documentation.json b/back/extensions/documentation/documentation/1.0.0/full_documentation.json index bf50c7f3..15d438a5 100644 --- a/back/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/back/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "02/22/2024 12:58:52 PM" + "x-generation-date": "02/22/2024 1:55:11 PM" }, "x-strapi-config": { "path": "/documentation", diff --git a/web/components/Account/Application/Company/ApplicationCompanyHelper.tsx b/web/components/Account/Application/Company/ApplicationCompanyHelper.tsx deleted file mode 100644 index 0793a0c0..00000000 --- a/web/components/Account/Application/Company/ApplicationCompanyHelper.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { Box, Button, Stack, Text } from '@chakra-ui/react' -import { useTranslation } from 'next-i18next' -import useCampaignContext from '~components/Campaign/useCampaignContext' -import { ROUTE_PLACES } from '~constants' -import { useCurrentUser } from '~hooks/useCurrentUser' -import { format } from '~utils/date' -import Link from '~components/Link' - -const ApplicationCompanyHelper = () => { - const { remainingApplications } = useCurrentUser() - const { currentCampaign } = useCampaignContext() - const { t } = useTranslation('application') - if (remainingApplications > 0 && currentCampaign.mode === 'applications') - return ( - - - - - {t( - `company.helper.start${remainingApplications > 1 ? 's' : ''}`, - { - num: remainingApplications, - }, - )} - - - {t('company.helper.end', { - date: format(currentCampaign.application_end), - })} - - - - - - ) - return null -} - -export default ApplicationCompanyHelper diff --git a/web/components/Account/Application/Company/ApplicationCompanyList.tsx b/web/components/Account/Application/Company/ApplicationCompanyList.tsx index 91db1475..dbad50d6 100644 --- a/web/components/Account/Application/Company/ApplicationCompanyList.tsx +++ b/web/components/Account/Application/Company/ApplicationCompanyList.tsx @@ -13,7 +13,7 @@ import Chevron from 'public/assets/img/chevron-down.svg' import Cell from '~components/Account/Booking/Cell' import ApplicationCompanyListItem from '~components/Account/Application/Company/ApplicationCompanyListItem' import useCampaignContext from '~components/Campaign/useCampaignContext' -import ApplicationCompanyHelper from '~components/Account/Application/Company/ApplicationCompanyHelper' +import ApplicationCompanyHelper from '~components/Account/Application/Company/ApplicationsHelpers/ApplicationCompanyHelper' interface Props { applications: Application[] diff --git a/web/components/Account/Application/Company/ApplicationCompanyListItem.tsx b/web/components/Account/Application/Company/ApplicationCompanyListItem.tsx index 0240f774..772d1bea 100644 --- a/web/components/Account/Application/Company/ApplicationCompanyListItem.tsx +++ b/web/components/Account/Application/Company/ApplicationCompanyListItem.tsx @@ -8,12 +8,14 @@ import ConfirmButton from '~components/Account/Application/ConfirmButton' import { client } from '~api/client-api' import useToast from '~hooks/useToast' import { useQueryClient } from 'react-query' +import useCampaignContext from '~components/Campaign/useCampaignContext' interface Props { application: Application } const ApplicationCompanyListItem = ({ application }: Props) => { + const { currentCampaign } = useCampaignContext() const { errorToast, successToast } = useToast() const { t } = useTranslation('application') const queryClient = useQueryClient() @@ -60,24 +62,26 @@ const ApplicationCompanyListItem = ({ application }: Props) => { {application?.creation_title} - - - + + + )} ) diff --git a/web/components/Account/Application/Company/ApplicationsHelpers/ApplicationCompanyHelper.tsx b/web/components/Account/Application/Company/ApplicationsHelpers/ApplicationCompanyHelper.tsx new file mode 100644 index 00000000..11fa2644 --- /dev/null +++ b/web/components/Account/Application/Company/ApplicationsHelpers/ApplicationCompanyHelper.tsx @@ -0,0 +1,24 @@ +import { Box, Button, Stack, Text } from '@chakra-ui/react' +import { useTranslation } from 'next-i18next' +import useCampaignContext from '~components/Campaign/useCampaignContext' +import { ROUTE_PLACES } from '~constants' +import { useCurrentUser } from '~hooks/useCurrentUser' +import { format } from '~utils/date' +import Link from '~components/Link' +import OpenApplications from '~components/Account/Application/Company/ApplicationsHelpers/OpenApplications' +import ClosedApplications from '~components/Account/Application/Company/ApplicationsHelpers/ClosedApplications' + +const ApplicationCompanyHelper = () => { + const { remainingApplications } = useCurrentUser() + const { currentCampaign } = useCampaignContext() + const { t } = useTranslation('application') + if (remainingApplications > 0 && currentCampaign.mode === 'applications') + return + + if (currentCampaign.mode === 'preselections') { + return + } + return null +} + +export default ApplicationCompanyHelper diff --git a/web/components/Account/Application/Company/ApplicationsHelpers/ClosedApplications.tsx b/web/components/Account/Application/Company/ApplicationsHelpers/ClosedApplications.tsx new file mode 100644 index 00000000..dc0f59c8 --- /dev/null +++ b/web/components/Account/Application/Company/ApplicationsHelpers/ClosedApplications.tsx @@ -0,0 +1,38 @@ +import { Box, Stack, Text } from '@chakra-ui/react' +import { useTranslation } from 'next-i18next' +import useCampaignContext from '~components/Campaign/useCampaignContext' +import { format } from '~utils/date' + +const ClosedApplications = () => { + const { currentCampaign } = useCampaignContext() + const { t } = useTranslation('application') + + return ( + + + + + {t(`company.helper.closed_start`, { + title: currentCampaign.title, + })} + + + {t('company.helper.closed_end', { + date: format(currentCampaign.preselection_end), + })} + + + + + ) +} + +export default ClosedApplications diff --git a/web/components/Account/Application/Company/ApplicationsHelpers/OpenApplications.tsx b/web/components/Account/Application/Company/ApplicationsHelpers/OpenApplications.tsx new file mode 100644 index 00000000..eaec0175 --- /dev/null +++ b/web/components/Account/Application/Company/ApplicationsHelpers/OpenApplications.tsx @@ -0,0 +1,54 @@ +import { Box, Button, Stack, Text } from '@chakra-ui/react' +import { useTranslation } from 'next-i18next' +import useCampaignContext from '~components/Campaign/useCampaignContext' +import { ROUTE_PLACES } from '~constants' +import { format } from '~utils/date' +import Link from '~components/Link' + +const OpenApplications = ({ + remainingApplications, +}: { + remainingApplications: number +}) => { + const { currentCampaign } = useCampaignContext() + const { t } = useTranslation('application') + + return ( + + + + + {t(`company.helper.start${remainingApplications > 1 ? 's' : ''}`, { + num: remainingApplications, + })} + + + {t('company.helper.end', { + date: format(currentCampaign.application_end), + })} + + + + + + ) +} + +export default OpenApplications diff --git a/web/components/Account/Application/Place/SelectionHelpers/ValidatedSelections.tsx b/web/components/Account/Application/Place/SelectionHelpers/ValidatedSelections.tsx index 0ed1ea11..d63c0fd3 100644 --- a/web/components/Account/Application/Place/SelectionHelpers/ValidatedSelections.tsx +++ b/web/components/Account/Application/Place/SelectionHelpers/ValidatedSelections.tsx @@ -1,5 +1,5 @@ import { Box, HStack, Text } from '@chakra-ui/react' -import PreselectionsValidated from 'public/assets/img/PreselectionsValidated.svg' +import PreselectionsValidated from 'public/assets/img/preselectionsValidated.svg' import { useTranslation } from 'next-i18next' const ValidatedSelections = () => { diff --git a/web/components/Account/Application/Place/ApplicationSelector.tsx b/web/components/Account/Application/Place/Selectors/ApplicationSelector.tsx similarity index 83% rename from web/components/Account/Application/Place/ApplicationSelector.tsx rename to web/components/Account/Application/Place/Selectors/ApplicationSelector.tsx index 749a0f38..0891ae15 100644 --- a/web/components/Account/Application/Place/ApplicationSelector.tsx +++ b/web/components/Account/Application/Place/Selectors/ApplicationSelector.tsx @@ -1,6 +1,7 @@ import { HStack, Select } from '@chakra-ui/react' import { useRouter } from 'next/router' import { useEffect, useMemo, useState } from 'react' +import SelectMenu from '~components/Account/Application/Place/Selectors/SelectMenu' import useCampaignContext from '~components/Campaign/useCampaignContext' import { ROUTE_ACCOUNT_APPLICATIONS } from '~constants' import { Espace } from '~typings/api' @@ -54,7 +55,23 @@ const ApplicationSelector = ({ places }: { places: Espace[] }) => { const dispoOptions = useMemo(() => getDispoOptions(espace), [espace]) return ( - + + ({ + value: place.id, + label: place.name, + }))} + onChange={(data) => { + console.log(data) + + // const disponibility = getDispoOptions(e.target.value)[0]?.id + // router.push({ + // pathname: router.pathname, + // query: { espace: e.target.value, disponibility }, + // }) + }} + value={espace as string} + /> + ) +} + +export default SelectMenu diff --git a/web/pages/compte/candidatures/index.tsx b/web/pages/compte/candidatures/index.tsx index 3972970c..48a9649c 100644 --- a/web/pages/compte/candidatures/index.tsx +++ b/web/pages/compte/candidatures/index.tsx @@ -6,11 +6,13 @@ import { requireAuth } from '~utils/auth' import { NextSeo } from 'next-seo' import { useTranslation } from 'next-i18next' import useCampaignContext from '~components/Campaign/useCampaignContext' -import { Flex, Text } from '@chakra-ui/react' -import ApplicationSelector from '~components/Account/Application/Place/ApplicationSelector' +import { Box, Flex, HStack, Text } from '@chakra-ui/react' +import ApplicationSelector from '~components/Account/Application/Place/Selectors/ApplicationSelector' import ApplicationPlaceData from '~components/Account/Application/Place/ApplicationPlaceData' import { useRouter } from 'next/router' import { useMyPlaces } from '~hooks/useMyPlaces' +import PlacesAdminCampaignHelper from '~components/Campaign/Places/Admin/PlacesAdminCampaignHelper' +import { format } from '~utils/date' const PlaceApplications = () => { const { t } = useTranslation('application') @@ -41,6 +43,16 @@ const PlaceApplications = () => { return ( <> + {currentCampaign?.mode === 'applications' && ( + + + + )} { {Boolean(places?.length) && ( - ({ - ...p, - disponibilities: p.disponibilities?.filter( - //@ts-expect-error - (d) => d.campaign === currentCampaign?.id, - ), - }))} - /> + + ({ + ...p, + disponibilities: p.disponibilities?.filter( + //@ts-expect-error + (d) => d.campaign === currentCampaign?.id, + ), + }))} + /> + )} {Boolean(searchParams && Object.keys(searchParams)?.length) && ( diff --git a/web/public/locales/fr/application.json b/web/public/locales/fr/application.json index 8102fc30..e14ee124 100644 --- a/web/public/locales/fr/application.json +++ b/web/public/locales/fr/application.json @@ -17,7 +17,9 @@ "start": "Il est encore possible de déposer {{num}} candidature,", "starts": "Il est encore possible de déposer {{num}} candidatures,", "end": " avant le {{date}}.", - "cta": "Voir les espaces partenaires" + "cta": "Voir les espaces partenaires", + "closed_start": "Le créneau de candidatures pour le dispositif {{title}} est maintenant clôturé,", + "closed_end": "la décision de chaque lieu sera connue d’ici au {{date}}. En cas de sélection, le lieu prendra contact directement avec vous hors de cette plateforme." }, "delete_error": "Une erreur est survenue lors de la suppression de votre candidature", "delete_success": "Votre candidature a bien été supprimée" @@ -42,7 +44,9 @@ "confirm_preselection": "Vous avez pré-sélectionné {{num}} candidatures.", "confirm_preselections": "Vous avez pré-sélectionné {{num}} candidatures.", "confirm_cta": "Confirmer et transmettre la pré-selection à StudioD", - "validated": "Votre pré-sélection a bien été prise en compte pour ce créneau !" + "validated": "Votre pré-sélection a bien été prise en compte pour ce créneau !", + "open_applications_start": "La période de candidatures pour le dispositif {{title}} est en cours :", + "open_applications_end": "vous pouvez consulter un aperçu des candidatures durant cette période mais ne pourrez consulter et télécharger les dossiers qu’au terme de celle-ci." } } }