Skip to content

Commit

Permalink
Feat/style fixes 04 03 (#109)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Lucieo authored Mar 4, 2024
1 parent dde40a3 commit 7ffb1e6
Show file tree
Hide file tree
Showing 13 changed files with 120 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 13 additions & 5 deletions web/components/Account/AccountMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ const getApplicationsItems = ({
const getPlaceItems = (hasCampaigns) => ({
title: hasCampaigns ? 'solidarity' : 'dashboard',
items: [
{
icon: <Home />,
label: 'place.home',
url: ROUTE_ACCOUNT_PLACES,
},
{
icon: <Question />,
label: 'place.question',
Expand Down Expand Up @@ -241,6 +236,19 @@ const AccountMenu = ({ user }: { user: UsersPermissionsUser }) => {
</Link>
</Flex>
<VStack spacing={12}>
{user?.confirmed &&
user?.accepted &&
user?.type === 'place' &&
displayMenu({
title: '',
items: [
{
icon: <Home />,
label: 'place.home',
url: ROUTE_ACCOUNT_PLACES,
},
],
})}
{user?.confirmed &&
user?.accepted &&
displayMenu(user?.type === 'company' ? companyItems : placeItems)}
Expand Down
103 changes: 56 additions & 47 deletions web/components/Account/Application/Place/ApplicationPlaceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,56 +66,65 @@ const ApplicationPlaceList = ({ applications = [] }: Props) => {
return (
<Box>
<ApplicationPlaceHelper applications={applications} />
<SimpleGrid
gridTemplateColumns={`fit-content(300px) minmax(200px, auto) minmax(auto, auto) minmax(auto, auto)${
['preselections', 'closed']?.includes(selectedCampaign?.mode)
? 'minmax(auto, auto)'
: ''
}`}
overflowX="auto"
>
<Cell isHeader>
<Text pl="9px">{t('place.table.head.number')}</Text>
</Cell>
<Cell isHeader>
<Divider />
<Flex
justifyContent="space-between"
alignItems="center"
flex={1}
cursor="pointer"
onClick={sortByDate}
>
<Text color="black">{t('place.table.head.artist')}</Text>
<Box transform={`rotate(${isDesc ? '0' : '180'}deg)`}>
<Chevron />
</Box>
</Flex>
</Cell>
<Cell isHeader>
<Divider />
<Text>{t('place.table.head.email')}</Text>
</Cell>
<Cell isHeader>
<Divider />
<Text>{t('place.table.head.creation')}</Text>
</Cell>
{['preselections', 'closed']?.includes(selectedCampaign?.mode) && (

{filteredList.length ? (
<SimpleGrid
gridTemplateColumns={`fit-content(300px) minmax(200px, auto) minmax(auto, auto) minmax(auto, auto)${
['preselections', 'closed']?.includes(selectedCampaign?.mode)
? 'minmax(auto, auto)'
: ''
}`}
overflowX="auto"
>
<Cell isHeader>
<Text pl="9px">{t('place.table.head.number')}</Text>
</Cell>
<Cell isHeader>
<Divider />
<Flex
justifyContent="space-between"
alignItems="center"
flex={1}
cursor="pointer"
onClick={sortByDate}
>
<Text color="black">{t('place.table.head.artist')}</Text>
<Box transform={`rotate(${isDesc ? '0' : '180'}deg)`}>
<Chevron />
</Box>
</Flex>
</Cell>
<Cell isHeader>
<Divider />
<Text>{t('place.table.head.email')}</Text>
</Cell>
)}
{filteredList.map((application) => (
<ApplicationPlaceListItem
key={application.id}
application={application}
onSelect={() => {
onApplicationSelect(application)
onOpen()
}}
/>
))}
</SimpleGrid>
<Cell isHeader>
<Divider />
<Text>{t('place.table.head.creation')}</Text>
</Cell>
{['preselections', 'closed']?.includes(selectedCampaign?.mode) && (
<Cell isHeader>
<Divider />
</Cell>
)}

{filteredList.map((application) => (
<ApplicationPlaceListItem
key={application.id}
application={application}
onSelect={() => {
onApplicationSelect(application)
onOpen()
}}
/>
))}
</SimpleGrid>
) : (
<Box p={4} backgroundColor="gray.50" borderRadius={4} width="100%">
<Text>{t('place.no_applications')}</Text>
</Box>
)}

<ApplicationDetailDrawer
isOpen={isOpen}
onClose={onClose}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ const ApplicationPlaceHelper = ({
if (selectedCampaign?.mode === 'preselections' && validatedApplications > 0) {
return <ValidatedSelections />
}
if (selectedCampaign?.mode === 'preselections' && missingPreselections > 0) {
if (
selectedCampaign?.mode === 'preselections' &&
missingPreselections > 0 &&
applications?.length > 0
) {
return <MissingSelections missingPreselections={missingPreselections} />
}

if (
selectedCampaign?.mode === 'preselections' &&
missingPreselections === 0
missingPreselections === 0 &&
preselections > 0
) {
return (
<ConfirmSelections preselectedApplications={preselectedApplications} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const ApplicationPreselectButton = ({
borderRadius={0}
leftIcon={
application?.status === 'preselected' ? (
<RemoveIcon stroke="black" />
<RemoveIcon stroke="#b62525" />
) : (
<ApplicationSelected />
)
Expand All @@ -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)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const DisponibilitiesSelector = () => {

if (!places?.length) {
return (
<Box p={4}>
<Box p={4} backgroundColor="gray.50" borderRadius={4}>
<Text>{t('place.no_places')}</Text>
</Box>
)
Expand Down
42 changes: 25 additions & 17 deletions web/components/Account/Info/InfoCompanyApplications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'),
})}
<Text whiteSpace="pre-line">
{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',
),
})}
</Text>
</Info>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const CampaignFileUpload = ({ place }: { place: Espace }) => {
const methods = useForm({
defaultValues: {
removedCampaign_files: [],
campaign_files: [],
campaign_files: place?.campaign_files || [],
},
mode: 'onChange',
})
Expand Down
1 change: 0 additions & 1 deletion web/components/FooterMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const FooterMenu = () => {
<MenuItem href={ROUTE_ACTU} text={t('nav.news')} />
<MenuItem href={ROUTE_FAQ} text={t('nav.faq')} />
<MenuItem href={ROUTE_CONTACT} text={t('nav.contact')} />
<MenuItem href={ROUTE_CONTACT} text={t('nav.contact')} />
</Box>
{!loading && !session && (
<Box pl={14}>
Expand Down
2 changes: 1 addition & 1 deletion web/components/Home/HomePlacesCampaign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const HomePlacesCampaign = () => {
<Flex justifyContent="center" pt={10} pb={{ base: 6, md: 0 }}>
<Button
as={Link}
href={ROUTE_PLACES}
href={`${ROUTE_PLACES}?tab=1`}
variant="outline"
colorScheme="campaign"
color={'campaign.dark'}
Expand Down
5 changes: 4 additions & 1 deletion web/pages/compte/mes-candidatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ const CompanyApplications = ({ user }: Props) => {
return (
<Loading isLoading={isLoading} isCentered>
<NextSeo title={t('title.requests')} />
{applications?.length === 0 ? (
{Boolean(
applications?.length === 0 ||
currentCampaign?.mode === 'disponibilities',
) ? (
<InfoCompanyApplications user={user} />
) : (
<ApplicationCompanyList applications={applications} />
Expand Down
6 changes: 3 additions & 3 deletions web/public/locales/fr/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
},
"myAccount": "Mon compte",
"dashboard": "Tableau de bord",
"solidarity": "Créneaux solidaires",
"solidarity": "StudioD Solidaire",
"info": "Mes informations",
"applications": {
"menu_title": "Dispositif {{title}}",
"menu_title": "StudioD EMERGENCE",
"info": {
"title": {
"next": "Prochainement",
"no_applications": "Aucune candidature"
},
"text": {
"next": "Le dispositif {{title}} se prépare : l’appel à candidatures sera ouvert du {{application_start}} au {{application_end}}. Encore un peu de patience !",
"next": "Le dispositif {{title}} se prépare : l’appel à candidatures sera ouvert du {{application_start}} au {{application_end}}.\nEncore un peu de patience !",
"no_applications": "Vous n’avez déposé aucune candidature {{title}} cette saison. Candidatez jusqu’au {{application_end}} auprès de nos espaces partenaires ({{applications_max}} candidatures maximum)",
"no_applications_company": "Vous n'avez pas reçu de candidature pour le dispositif {{title}} pour le moment. La période de candidature se termine le {{date}}."
},
Expand Down
3 changes: 2 additions & 1 deletion web/public/locales/fr/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"confirm_success": "Vos pré-sélections ont bien été transmises à StudioD"
},
"no_places": "Aucun de vos espaces ne propose de créneau pour ce dispositif",
"no_applications": "Aucune candidature n'a été déposée pour ce créneau.",
"detail": {
"title": "Candidature n°{{id}}",
"header": {
Expand All @@ -77,7 +78,7 @@
"download_pdf": "Télécharger le pdf",
"downloading_pdf": "Création du pdf",
"preselect": "Marquer comme sélectionnée",
"deselect": "Déselectionner",
"deselect": "Annuler la sélection",
"error": "Une erreur est survenue",
"preselected_success": "Cette candidature a bien été pré-sélectionnée",
"deselected_success": "Cette candidature a bien été dé-sélectionnée",
Expand Down

0 comments on commit 7ffb1e6

Please sign in to comment.