From 7ffb1e66421312f74aa694442e7a8f3acc05e58a Mon Sep 17 00:00:00 2001 From: Lucieo Date: Mon, 4 Mar 2024 18:26:46 +0000 Subject: [PATCH] Feat/style fixes 04 03 (#109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix home encart dispositif * Fix campaign document upload * Présélectionner les candidatures - empty message * Compagnie listing applications fix * Change preselect button * New account menu layout * Delete double link --- .../1.0.0/full_documentation.json | 2 +- web/components/Account/AccountMenu.tsx | 18 ++- .../Place/ApplicationPlaceList.tsx | 103 ++++++++++-------- .../ApplicationPlaceHelper.tsx | 9 +- .../ApplicationPreselectButton.tsx | 14 +-- .../DisponibilitiesSelector.tsx | 2 +- .../Account/Info/InfoCompanyApplications.tsx | 42 ++++--- .../Places/Admin/CampaignFileUpload.tsx | 2 +- web/components/FooterMenu.tsx | 1 - web/components/Home/HomePlacesCampaign.tsx | 2 +- web/pages/compte/mes-candidatures/index.tsx | 5 +- web/public/locales/fr/account.json | 6 +- web/public/locales/fr/application.json | 3 +- 13 files changed, 120 insertions(+), 89 deletions(-) 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 1ae8bbf9..365daa9b 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": "03/01/2024 5:58:22 PM" + "x-generation-date": "03/04/2024 1:59:48 PM" }, "x-strapi-config": { "path": "/documentation", diff --git a/web/components/Account/AccountMenu.tsx b/web/components/Account/AccountMenu.tsx index 95cc82ae..cf426185 100644 --- a/web/components/Account/AccountMenu.tsx +++ b/web/components/Account/AccountMenu.tsx @@ -73,11 +73,6 @@ const getApplicationsItems = ({ const getPlaceItems = (hasCampaigns) => ({ title: hasCampaigns ? 'solidarity' : 'dashboard', items: [ - { - icon: , - label: 'place.home', - url: ROUTE_ACCOUNT_PLACES, - }, { icon: , label: 'place.question', @@ -241,6 +236,19 @@ const AccountMenu = ({ user }: { user: UsersPermissionsUser }) => { + {user?.confirmed && + user?.accepted && + user?.type === 'place' && + displayMenu({ + title: '', + items: [ + { + icon: , + label: 'place.home', + url: ROUTE_ACCOUNT_PLACES, + }, + ], + })} {user?.confirmed && user?.accepted && displayMenu(user?.type === 'company' ? companyItems : placeItems)} diff --git a/web/components/Account/Application/Place/ApplicationPlaceList.tsx b/web/components/Account/Application/Place/ApplicationPlaceList.tsx index 6a984303..81167e3a 100644 --- a/web/components/Account/Application/Place/ApplicationPlaceList.tsx +++ b/web/components/Account/Application/Place/ApplicationPlaceList.tsx @@ -66,56 +66,65 @@ const ApplicationPlaceList = ({ applications = [] }: Props) => { return ( - - - {t('place.table.head.number')} - - - - - {t('place.table.head.artist')} - - - - - - - - {t('place.table.head.email')} - - - - {t('place.table.head.creation')} - - {['preselections', 'closed']?.includes(selectedCampaign?.mode) && ( + + {filteredList.length ? ( + + + {t('place.table.head.number')} + + + + + {t('place.table.head.artist')} + + + + + + {t('place.table.head.email')} - )} - {filteredList.map((application) => ( - { - onApplicationSelect(application) - onOpen() - }} - /> - ))} - + + + {t('place.table.head.creation')} + + {['preselections', 'closed']?.includes(selectedCampaign?.mode) && ( + + + + )} + + {filteredList.map((application) => ( + { + onApplicationSelect(application) + onOpen() + }} + /> + ))} + + ) : ( + + {t('place.no_applications')} + + )} + 0) { return } - if (selectedCampaign?.mode === 'preselections' && missingPreselections > 0) { + if ( + selectedCampaign?.mode === 'preselections' && + missingPreselections > 0 && + applications?.length > 0 + ) { return } if ( selectedCampaign?.mode === 'preselections' && - missingPreselections === 0 + missingPreselections === 0 && + preselections > 0 ) { return ( diff --git a/web/components/Account/Application/Place/DetailDrawer/ApplicationPreselectButton.tsx b/web/components/Account/Application/Place/DetailDrawer/ApplicationPreselectButton.tsx index a0c095c5..6784f131 100644 --- a/web/components/Account/Application/Place/DetailDrawer/ApplicationPreselectButton.tsx +++ b/web/components/Account/Application/Place/DetailDrawer/ApplicationPreselectButton.tsx @@ -54,7 +54,7 @@ const ApplicationPreselectButton = ({ borderRadius={0} leftIcon={ application?.status === 'preselected' ? ( - + ) : ( ) @@ -64,17 +64,15 @@ const ApplicationPreselectButton = ({ p={3} backgroundColor={ application?.status === 'preselected' - ? 'transparent' + ? 'rgba(182,37,37, 0.18)' : 'rgba(110, 174, 127, 0.25)' } - border={ - application?.status === 'preselected' - ? '2px solid rgba(110, 174, 127, 0.25)' - : 'none' - } color="black" _hover={{ - backgroundColor: 'rgba(110, 174, 127, 0.4)', + backgroundColor: + application?.status === 'preselected' + ? 'rgba(182,37,37, 0.28)' + : 'rgba(110, 174, 127, 0.4)', }} _active={{ backgroundColor: 'rgba(110, 174, 127, 0.6)', diff --git a/web/components/Account/Application/Place/DisponibilitiesSelector/DisponibilitiesSelector.tsx b/web/components/Account/Application/Place/DisponibilitiesSelector/DisponibilitiesSelector.tsx index 2498c9e5..7211d64f 100644 --- a/web/components/Account/Application/Place/DisponibilitiesSelector/DisponibilitiesSelector.tsx +++ b/web/components/Account/Application/Place/DisponibilitiesSelector/DisponibilitiesSelector.tsx @@ -49,7 +49,7 @@ const DisponibilitiesSelector = () => { if (!places?.length) { return ( - + {t('place.no_places')} ) diff --git a/web/components/Account/Info/InfoCompanyApplications.tsx b/web/components/Account/Info/InfoCompanyApplications.tsx index 30654816..265215c2 100644 --- a/web/components/Account/Info/InfoCompanyApplications.tsx +++ b/web/components/Account/Info/InfoCompanyApplications.tsx @@ -5,6 +5,7 @@ import { ROUTE_PLACES } from '~constants' import { UsersPermissionsUser } from '~typings/api' import useCampaignContext from '~components/Campaign/useCampaignContext' import { format } from '~utils/date' +import { Text } from '@chakra-ui/react' interface Props { user: UsersPermissionsUser @@ -34,28 +35,35 @@ const InfoCompanyApplications = ({ user }: Props) => { text: t('applications.info.cta.no_applications'), url: ROUTE_PLACES + '?tab=1', } - : { + : currentCampaign?.article_link + ? { text: t('applications.info.cta.next'), url: currentCampaign?.article_link, } + : [] } > - {currentCampaign?.mode === 'applications' - ? t(`applications.info.text.no_applications`, { - ...currentCampaign, - application_end: format( - currentCampaign?.application_end, - 'dd/MM/yyyy', - ), - }) - : t(`applications.info.text.next`, { - ...currentCampaign, - application_start: format( - currentCampaign?.application_start, - 'dd/MM', - ), - application_end: format(currentCampaign?.application_end, 'dd/MM'), - })} + + {currentCampaign?.mode === 'applications' + ? t(`applications.info.text.no_applications`, { + ...currentCampaign, + application_end: format( + currentCampaign?.application_end, + 'dd/MM/yyyy', + ), + }) + : t(`applications.info.text.next`, { + ...currentCampaign, + application_start: format( + currentCampaign?.application_start, + 'dd/MM', + ), + application_end: format( + currentCampaign?.application_end, + 'dd/MM', + ), + })} + ) } diff --git a/web/components/Campaign/Places/Admin/CampaignFileUpload.tsx b/web/components/Campaign/Places/Admin/CampaignFileUpload.tsx index fd82618d..6818145b 100644 --- a/web/components/Campaign/Places/Admin/CampaignFileUpload.tsx +++ b/web/components/Campaign/Places/Admin/CampaignFileUpload.tsx @@ -59,7 +59,7 @@ const CampaignFileUpload = ({ place }: { place: Espace }) => { const methods = useForm({ defaultValues: { removedCampaign_files: [], - campaign_files: [], + campaign_files: place?.campaign_files || [], }, mode: 'onChange', }) diff --git a/web/components/FooterMenu.tsx b/web/components/FooterMenu.tsx index 01ff15d7..08458646 100644 --- a/web/components/FooterMenu.tsx +++ b/web/components/FooterMenu.tsx @@ -44,7 +44,6 @@ const FooterMenu = () => { - {!loading && !session && ( diff --git a/web/components/Home/HomePlacesCampaign.tsx b/web/components/Home/HomePlacesCampaign.tsx index ab1fa126..cff3c930 100644 --- a/web/components/Home/HomePlacesCampaign.tsx +++ b/web/components/Home/HomePlacesCampaign.tsx @@ -73,7 +73,7 @@ const HomePlacesCampaign = () => {