all repos — caroster @ c5b71a4fb82c8963c8a99496ccaaa639c16546b5

[Octree] Group carpool to your event https://caroster.io

🐛 Fixes after PO review
Tim Izzo tim@octree.ch
Mon, 04 Mar 2024 14:07:42 +0000
commit

c5b71a4fb82c8963c8a99496ccaaa639c16546b5

parent

24ba7a6fec0dcec30053774276b9653ccb312387

M backend/src/api/notification/content-types/notification/lifecycles.tsbackend/src/api/notification/content-types/notification/lifecycles.ts

@@ -19,7 +19,7 @@ },

} ); const { user, event, payload = {} } = notification; - if (user.notificationEnabled || user.notificationEnabled === null) + if (user.notificationEnabled) await strapi .service("api::email.email") .sendEmailNotif(user.email, notification.type, user.lang, {
M frontend/containers/CarosterPlusOption/index.tsxfrontend/containers/CarosterPlusOption/index.tsx

@@ -15,6 +15,7 @@ import Markdown from '../../components/Markdown';

import useLocale from '../../hooks/useLocale'; import usePermissions from '../../hooks/usePermissions'; import {Event as EventType, Module} from '../../generated/graphql'; +import useProfile from '../../hooks/useProfile'; interface Props { event: EventType;

@@ -23,6 +24,7 @@ }

const CarosterPlusOption = ({event, modulesSettings}: Props) => { const {t} = useTranslation(); + const {profile} = useProfile(); const { userPermissions: {canEditEventOptions}, } = usePermissions();

@@ -63,7 +65,7 @@ )}

> <Box> <Button - href={`${caroster_plus_payment_link}?client_reference_id=${event.uuid}&locale=${locale}`} + href={`${caroster_plus_payment_link}?client_reference_id=${event.uuid}&locale=${locale}&prefilled_email=${profile?.email}`} disabled={!canEditEventOptions()} sx={{ backgroundColor: 'primary.light',
M frontend/locales/en.jsonfrontend/locales/en.json

@@ -72,11 +72,12 @@ "event.no_travel.desc": "1. Subscribe to the waiting list\n2. Share the event\n3. You will be notified when a new travel is added",

"event.no_travel.title": "There are currently no cars", "event.not_found": "Project not found", "event.title": "{{title}} - Caroster", + "options.no_module": "There are no modules currently available.", "options.plus.title": "Caroster plus", "options.plus.admins": "Administrators", "options.plus.creator": "Creator", "options.plus.activationOK": "Add Caroster plus to your event", - "options.plus.activationForbiden": "Only the administrator is authorized to add modules", + "options.plus.activationForbiden": "Only the event creator is authorized to add modules", "options.plus.addAdmin": "Add an administrator", "options.plus.addAdmin.email": "Email", "options.plus.addAdmin.emailHelper": "The email is not valid",
M frontend/locales/fr.jsonfrontend/locales/fr.json

@@ -72,11 +72,12 @@ "event.no_travel.desc": "1. Inscrivez-vous dans la liste d’attente \n2. Partagez l’évĂ©nement \n3. Vous serez notifiĂ© lorsqu’un nouveau trajet sera ajoutĂ©",

"event.no_travel.title": "Pas de voitures pour le moment", "event.not_found": "Projet introuvable", "event.title": "{{title}} - Caroster", + "options.no_module": "Il n'y a pas de module disponible pour le moment.", "options.plus.title": "Caroster plus", "options.plus.admins": "Administrateurs", "options.plus.creator": "Créateur", "options.plus.activationOK": "Ajoutez Caroster plus à votre évÚnement", - "options.plus.activationForbiden": "Seul l'administrateur est autorisé à ajouter des modules", + "options.plus.activationForbiden": "Seul le créateur de l'événement est autorisé à ajouter des modules", "options.plus.addAdmin": "Ajouter un administrateur", "options.plus.addAdmin.email": "E-mail", "options.plus.addAdmin.emailHelper": "L e-mail n'est pas valide",
M frontend/pages/e/[uuid]/options.tsxfrontend/pages/e/[uuid]/options.tsx

@@ -13,6 +13,8 @@ Enum_Userspermissionsuser_Lang as SupportedLocales,

} from '../../../generated/graphql'; import CarosterPlusOption from '../../../containers/CarosterPlusOption'; import CarosterPlusSettings from '../../../containers/CarosterPlusSettings'; +import {Card, Typography} from '@mui/material'; +import {useTranslation} from 'react-i18next'; interface Props { modulesSettings?: Module;

@@ -25,6 +27,7 @@ return <EventLayout {...props} Tab={OptionsTab} />;

}; const OptionsTab: TabComponent<Props> = ({modulesSettings}) => { + const {t} = useTranslation(); const theme = useTheme(); const event = useEventStore(s => s.event);

@@ -47,8 +50,11 @@ },

}} > {carosterPlusActivated && <CarosterPlusSettings event={event} />}{' '} - {modulesSettings && !carosterPlusActivated && ( + {modulesSettings?.caroster_plus_enabled && ( <CarosterPlusOption event={event} modulesSettings={modulesSettings} /> + )} + {!modulesSettings?.caroster_plus_enabled && ( + <Typography variant="overline">{t`options.no_module`}</Typography> )} </Container> </Box>