-
-
+
+
+ Cette année comme il y a de nouveaux tee-shirts avec un col en V, tous les bénévoles
+ peuvent en commander un !
+ Autre nouveauté, il y a des tee-shirts taille enfant !
+
+
+
+
+
+
+
+
+
Enregistrer
{children === undefined && (
diff --git a/src/components/VolunteerBoard/TeamWishesForm/TeamWishesForm.tsx b/src/components/VolunteerBoard/TeamWishesForm/TeamWishesForm.tsx
index 2ab992a..b4355eb 100644
--- a/src/components/VolunteerBoard/TeamWishesForm/TeamWishesForm.tsx
+++ b/src/components/VolunteerBoard/TeamWishesForm/TeamWishesForm.tsx
@@ -71,8 +71,8 @@ const TeamWishesForm: FC
= ({ children, afterSubmit }): JSX.Element | nul
})}
-
-
+
+
diff --git a/src/components/VolunteerBoard/hosting.utils.ts b/src/components/VolunteerBoard/hosting.utils.ts
index ba55d28..6aa0761 100644
--- a/src/components/VolunteerBoard/hosting.utils.ts
+++ b/src/components/VolunteerBoard/hosting.utils.ts
@@ -7,10 +7,21 @@ import useAction from "../../utils/useAction"
import { VolunteerHosting } from "../../services/volunteers"
type SetFunction = (
- needsHosting: VolunteerHosting["needsHosting"],
+ hostingType: VolunteerHosting["hostingType"],
canHostCount: VolunteerHosting["canHostCount"],
+ cohostVolunteer: VolunteerHosting["cohostVolunteer"],
+ backProblems: VolunteerHosting["backProblems"],
+ hostingNights: VolunteerHosting["hostingNights"],
+ bedType: VolunteerHosting["bedType"],
+ isolatedBed: VolunteerHosting["isolatedBed"],
+ bedConfiguration: VolunteerHosting["bedConfiguration"],
+ hostAddress: VolunteerHosting["hostAddress"],
+ petAllergies: VolunteerHosting["petAllergies"],
+ transportType: VolunteerHosting["transportType"],
+ festivalProximity: VolunteerHosting["festivalProximity"],
distanceToFestival: VolunteerHosting["distanceToFestival"],
- hostingComment: VolunteerHosting["hostingComment"]
+ hostingNeedReason: VolunteerHosting["hostingNeedReason"],
+ hostingAbsoluteNeed: VolunteerHosting["hostingAbsoluteNeed"]
) => void
export const useUserHosting = (): [VolunteerHosting | undefined, SetFunction] => {
@@ -22,14 +33,41 @@ export const useUserHosting = (): [VolunteerHosting | undefined, SetFunction] =>
)
const saveWishes: SetFunction = useCallback(
- (needsHosting, canHostCount, distanceToFestival, hostingComment) => {
+ (
+ hostingType,
+ canHostCount,
+ cohostVolunteer,
+ backProblems,
+ hostingNights,
+ bedType,
+ isolatedBed,
+ bedConfiguration,
+ hostAddress,
+ petAllergies,
+ transportType,
+ festivalProximity,
+ distanceToFestival,
+ hostingNeedReason,
+ hostingAbsoluteNeed
+ ) => {
if (!userWishes) return
save(jwtToken, 0, {
id: userWishes.id,
- needsHosting,
+ hostingType,
canHostCount,
+ cohostVolunteer,
+ backProblems,
+ hostingNights,
+ bedType,
+ isolatedBed,
+ bedConfiguration,
+ hostAddress,
+ petAllergies,
+ transportType,
+ festivalProximity,
distanceToFestival,
- hostingComment,
+ hostingNeedReason,
+ hostingAbsoluteNeed,
})
},
[userWishes, save, jwtToken]
@@ -37,3 +75,57 @@ export const useUserHosting = (): [VolunteerHosting | undefined, SetFunction] =>
return [userWishes, saveWishes]
}
+
+export const bedList: string[] = [
+ "un lit une place",
+ "un lit 2 places",
+ "un canapé ",
+ "un canapé-lit",
+ "un matelas au sol",
+]
+
+type HostLocation = "Paris" | "région parisienne" | "hors région parisienne" | ""
+export const hostLocations: HostLocation[] = [
+ "Paris",
+ "région parisienne",
+ "hors région parisienne",
+]
+
+export type NightOption = { abbr: string; title: string }
+
+export const nightList: NightOption[] = [
+ {
+ abbr: "M",
+ title: "Nuit du mercredi 28 au jeudi 29 juin",
+ },
+ {
+ abbr: "J",
+ title: "Nuit du jeudi 29 au vendredi 30 juin",
+ },
+ {
+ abbr: "V",
+ title: "Nuit du vendredi 30 juin au samedi 1er juillet",
+ },
+ {
+ abbr: "S",
+ title: "Nuit du samedi 1er au dimanche 2 juillet",
+ },
+ {
+ abbr: "D",
+ title: "Nuit du dimanche 2 au lundi 3 juillet",
+ },
+ {
+ abbr: "L",
+ title: "Nuit du lundi 3 au mardi 4 juillet",
+ },
+]
+
+export interface NightChoices {
+ [key: string]: boolean
+}
+
+export const nightChoiceSelectionDefaultState = nightList.reduce((state, { abbr }) => {
+ state[abbr] = false
+ state[abbr.toLowerCase()] = false
+ return state
+}, {})
diff --git a/src/components/VolunteerBoard/meals.utils.ts b/src/components/VolunteerBoard/meals.utils.ts
index c0bb888..6869d37 100644
--- a/src/components/VolunteerBoard/meals.utils.ts
+++ b/src/components/VolunteerBoard/meals.utils.ts
@@ -16,18 +16,29 @@ export const mealDays: MealDay[] = [
{
name: "Samedi midi",
options: [
- { abbr: "V", title: "Sandwich végétarien" },
- { abbr: "F", title: "Sandwich fromage" },
- { abbr: "P", title: "Sandwich poulet" },
+ { abbr: "V", title: "Taboulé" },
+ { abbr: "F", title: "Quinoa, courgettes, fromage" },
+ { abbr: "P", title: "Riz à la Niçoise (thon)" },
+ { abbr: "", title: "Pas de repas" },
+ ],
+ },
+ {
+ name: "Samedi soir",
+ options: [
+ {
+ abbr: "V",
+ title: "Aubergines fondantes avec égrené végétal",
+ },
+ { abbr: "P", title: "Risotto poulet" },
{ abbr: "", title: "Pas de repas" },
],
},
{
name: "Dimanche midi",
options: [
- { abbr: "V", title: "Sandwich végétarien" },
- { abbr: "F", title: "Sandwich fromage" },
- { abbr: "P", title: "Sandwich poulet" },
+ { abbr: "V", title: "Sandwich aux légumes" },
+ { abbr: "F", title: "Sandwich au fromage" },
+ { abbr: "P", title: "Sandwich au poulet" },
{ abbr: "", title: "Pas de repas" },
],
},
@@ -36,15 +47,15 @@ export const mealDays: MealDay[] = [
options: [
{
abbr: "V",
- title: "Lasagnes végétariennes accompagnées de ratatouille et haricots verts",
+ title: "Risotto végétarien",
},
- { abbr: "P", title: "Aiguillettes de poulet accompagnées de riz thaï" },
+ { abbr: "P", title: "Parmentier de canard" },
{ abbr: "", title: "Pas de repas" },
],
},
]
-type SetFunction = (meals: VolunteerMeals["meals"]) => void
+type SetFunction = (meals: VolunteerMeals["meals"], food: VolunteerMeals["food"]) => void
export const useUserMeals = (): [VolunteerMeals | undefined, SetFunction] => {
const save = useAction(fetchVolunteerMealsSet)
@@ -55,11 +66,12 @@ export const useUserMeals = (): [VolunteerMeals | undefined, SetFunction] => {
)
const saveWishes: SetFunction = useCallback(
- (meals) => {
+ (meals, food) => {
if (!userWishes) return
save(jwtToken, 0, {
id: userWishes.id,
meals,
+ food,
})
},
[userWishes, save, jwtToken]
diff --git a/src/components/VolunteerBoard/participationDetails.utils.ts b/src/components/VolunteerBoard/participationDetails.utils.ts
index 4a56dbe..2b6c068 100644
--- a/src/components/VolunteerBoard/participationDetails.utils.ts
+++ b/src/components/VolunteerBoard/participationDetails.utils.ts
@@ -7,30 +7,57 @@ import { fetchVolunteerParticipationDetailsSet } from "../../store/volunteerPart
import { VolunteerParticipationDetails } from "../../services/volunteers"
export const tshirtSizes = [
- "XXS",
- "XS",
- "S",
- "M",
- "L",
- "XL",
- "XXL",
- "3XL",
- "4XL",
- "Femme S",
- "Femme M",
- "Femme L",
- "Femme XL",
- "Femme XXL",
- "Femme 3XL",
+ "Aucun",
+ "Enfant col rond 2 ans",
+ "Enfant col rond 3 ans",
+ "Enfant col rond 4 ans",
+ "Enfant col rond 5 ans",
+ "Enfant col rond 6 ans",
+ "Enfant col rond 7 ans",
+ "Enfant col rond 8 ans",
+ "Enfant col rond 9 ans",
+ "Enfant col rond 10 ans",
+ "Enfant col rond 11 ans",
+ "Enfant col rond 12 ans",
+ "Femme col V S",
+ "Femme col V M",
+ "Femme col V L",
+ "Femme col V XL",
+ "Femme col V XXL",
+ "Femme col V 3XL",
+ "Femme col rond XXS",
+ "Femme col rond XS",
+ "Femme col rond S",
+ "Femme col rond M",
+ "Femme col rond L",
+ "Femme col rond XL",
+ "Femme col rond XXL",
+ "Femme col rond 3XL",
+ "Femme col rond 4XL",
+ "Femme col rond 5XL",
+ "Homme col V S",
+ "Homme col V M",
+ "Homme col V L",
+ "Homme col V XL",
+ "Homme col V XXL",
+ "Homme col V 3XL",
+ "Homme col rond XXS",
+ "Homme col rond XS",
+ "Homme col rond S",
+ "Homme col rond M",
+ "Homme col rond L",
+ "Homme col rond XL",
+ "Homme col rond XXL",
+ "Homme col rond 3XL",
+ "Homme col rond 4XL",
+ "Homme col rond 5XL",
]
export const foodDefaultValue = "Aucune"
type SetFunction = (
tshirtSize: VolunteerParticipationDetails["tshirtSize"],
- tshirtCount: VolunteerParticipationDetails["tshirtCount"],
- adult: VolunteerParticipationDetails["adult"],
- food: VolunteerParticipationDetails["food"]
+ adult: VolunteerParticipationDetails["adult"]
) => void
export const useUserParticipationDetails = (): [
@@ -45,14 +72,12 @@ export const useUserParticipationDetails = (): [
)
const saveParticipationDetails: SetFunction = useCallback(
- (tshirtSize, tshirtCount, adult, food) => {
+ (tshirtSize, adult) => {
if (!userParticipationDetails) return
save(jwtToken, 0, {
id: userParticipationDetails.id,
tshirtSize,
- tshirtCount,
adult,
- food,
})
},
[userParticipationDetails, save, jwtToken]
diff --git a/src/server/gsheets/volunteers.ts b/src/server/gsheets/volunteers.ts
index ddb5637..c2c0d88 100644
--- a/src/server/gsheets/volunteers.ts
+++ b/src/server/gsheets/volunteers.ts
@@ -361,27 +361,71 @@ export const volunteerHostingSet = expressAccessor.set(async (list, body, id) =>
}
const newVolunteer: Volunteer = cloneDeep(volunteer)
- if (wishes.needsHosting !== undefined) {
- newVolunteer.needsHosting = wishes.needsHosting
+ if (wishes.hostingType !== undefined) {
+ newVolunteer.hostingType = wishes.hostingType
}
if (wishes.canHostCount !== undefined) {
newVolunteer.canHostCount = wishes.canHostCount
}
+ if (wishes.cohostVolunteer !== undefined) {
+ newVolunteer.cohostVolunteer = wishes.cohostVolunteer
+ }
+ if (wishes.backProblems !== undefined) {
+ newVolunteer.backProblems = wishes.backProblems
+ }
+ if (wishes.hostingNights !== undefined) {
+ newVolunteer.hostingNights = wishes.hostingNights
+ }
+ if (wishes.bedType !== undefined) {
+ newVolunteer.bedType = wishes.bedType
+ }
+ if (wishes.isolatedBed !== undefined) {
+ newVolunteer.isolatedBed = wishes.isolatedBed
+ }
+ if (wishes.bedConfiguration !== undefined) {
+ newVolunteer.bedConfiguration = wishes.bedConfiguration
+ }
+ if (wishes.hostAddress !== undefined) {
+ newVolunteer.hostAddress = wishes.hostAddress
+ }
+ if (wishes.petAllergies !== undefined) {
+ newVolunteer.petAllergies = wishes.petAllergies
+ }
+ if (wishes.transportType !== undefined) {
+ newVolunteer.transportType = wishes.transportType
+ }
+ if (wishes.festivalProximity !== undefined) {
+ newVolunteer.festivalProximity = wishes.festivalProximity
+ }
if (wishes.distanceToFestival !== undefined) {
newVolunteer.distanceToFestival = wishes.distanceToFestival
}
- if (wishes.hostingComment !== undefined) {
- newVolunteer.hostingComment = wishes.hostingComment
+ if (wishes.hostingNeedReason !== undefined) {
+ newVolunteer.hostingNeedReason = wishes.hostingNeedReason
+ }
+ if (wishes.hostingAbsoluteNeed !== undefined) {
+ newVolunteer.hostingAbsoluteNeed = wishes.hostingAbsoluteNeed
}
return {
toDatabase: newVolunteer,
toCaller: {
id: newVolunteer.id,
- needsHosting: newVolunteer.needsHosting,
+ hostingType: newVolunteer.hostingType,
canHostCount: newVolunteer.canHostCount,
+ cohostVolunteer: newVolunteer.cohostVolunteer,
+ backProblems: newVolunteer.backProblems,
+ hostingNights: newVolunteer.hostingNights,
+ bedType: newVolunteer.bedType,
+ isolatedBed: newVolunteer.isolatedBed,
+ bedConfiguration: newVolunteer.bedConfiguration,
+ hostAddress: newVolunteer.hostAddress,
+ petAllergies: newVolunteer.petAllergies,
+ transportType: newVolunteer.transportType,
+ festivalProximity: newVolunteer.festivalProximity,
distanceToFestival: newVolunteer.distanceToFestival,
- hostingComment: newVolunteer.hostingComment,
+ hostingNeedReason: newVolunteer.hostingNeedReason,
+ hostingAbsoluteNeed: newVolunteer.hostingAbsoluteNeed,
} as VolunteerHosting,
}
})
@@ -458,20 +502,23 @@ export const volunteerMealsSet = expressAccessor.set(async (list, body, id) => {
newVolunteer.meals = wishes.meals
}
+ if (wishes.food !== undefined) {
+ newVolunteer.food = wishes.food
+ }
+
return {
toDatabase: newVolunteer,
toCaller: {
id: newVolunteer.id,
meals: newVolunteer.meals,
+ food: newVolunteer.food,
} as VolunteerMeals,
}
})
export const volunteerParticipationDetailsSet = expressAccessor.set(async (list, body, id) => {
const requestedId = +body[0] || id
if (requestedId !== id && requestedId !== 0) {
- throw Error(
- `On ne peut acceder qu'à ses propres infos de t-shirt, de majorité et d'alimentation`
- )
+ throw Error(`On ne peut acceder qu'à ses propres infos de t-shirt et de majorité`)
}
const wishes = body[1] as VolunteerParticipationDetails
const volunteer: Volunteer | undefined = list.find((v) => v.id === requestedId)
@@ -483,24 +530,16 @@ export const volunteerParticipationDetailsSet = expressAccessor.set(async (list,
if (wishes.tshirtSize !== undefined) {
newVolunteer.tshirtSize = wishes.tshirtSize
}
- if (wishes.tshirtCount !== undefined) {
- newVolunteer.tshirtCount = wishes.tshirtCount
- }
if (wishes.adult !== undefined) {
newVolunteer.adult = wishes.adult
}
- if (wishes.food !== undefined) {
- newVolunteer.food = wishes.food
- }
return {
toDatabase: newVolunteer,
toCaller: {
id: newVolunteer.id,
tshirtSize: newVolunteer.tshirtSize,
- tshirtCount: newVolunteer.tshirtCount,
adult: newVolunteer.adult,
- food: newVolunteer.food,
} as VolunteerParticipationDetails,
}
})
diff --git a/src/services/accessors.ts b/src/services/accessors.ts
index add1239..99ccc82 100644
--- a/src/services/accessors.ts
+++ b/src/services/accessors.ts
@@ -107,10 +107,12 @@ export default class ServiceAccessors<
try {
const auth = { headers: { Authorization: `Bearer ${jwt}` } }
const fullAxiosConfig = _.defaultsDeep(auth, axiosConfig)
- const { data } = await axios.get(
- `${config.API_URL}/${this.elementName}${apiName}`,
- { ...fullAxiosConfig, params }
- )
+ const rawData = await axios.get(`${config.API_URL}/${this.elementName}${apiName}`, {
+ ...fullAxiosConfig,
+ params,
+ })
+ console.log("rawData", rawData)
+ const { data } = rawData
if (data.error) {
throw Error(data.error)
}
diff --git a/src/services/volunteers.ts b/src/services/volunteers.ts
index 8bbf281..8215dd8 100644
--- a/src/services/volunteers.ts
+++ b/src/services/volunteers.ts
@@ -68,13 +68,35 @@ export class Volunteer implements VolunteerPartial {
noOpinion: number[] = []
- needsHosting = false
+ hostingType = ""
canHostCount = 0
- distanceToFestival = 0
+ cohostVolunteer = ""
- hostingComment = ""
+ backProblems = false
+
+ hostingNights = ""
+
+ bedType: string[] = []
+
+ isolatedBed = false
+
+ bedConfiguration = ""
+
+ hostAddress = ""
+
+ petAllergies = ""
+
+ transportType = ""
+
+ festivalProximity = ""
+
+ distanceToFestival = ""
+
+ hostingNeedReason = ""
+
+ hostingAbsoluteNeed = true
meals: string[] = []
@@ -116,10 +138,21 @@ export const translationVolunteer: { [k in keyof Volunteer]: string } = {
playable: "jouable",
giftable: "offrable",
noOpinion: "sansAvis",
- needsHosting: "besoinHébergement",
+ hostingType: "typeHébergement",
canHostCount: "nombreHébergés",
+ cohostVolunteer: "colocBénévole",
+ backProblems: "malDeDos",
+ hostingNights: "nuitsHébergé",
+ bedType: "typeDeLit",
+ isolatedBed: "litIsolé",
+ bedConfiguration: "configurationLits",
+ hostAddress: "adresseHebergement",
+ petAllergies: "allergiesAnimaux",
+ transportType: "typeTransport",
+ festivalProximity: "proximitéAuFestival",
distanceToFestival: "distanceAuFestival",
- hostingComment: "commentaireHébergement",
+ hostingNeedReason: "reasonDêtreHebergé",
+ hostingAbsoluteNeed: "besoinDhébergement",
meals: "repas",
charter: "charte",
}
@@ -171,10 +204,21 @@ export const volunteerExample: Volunteer = {
playable: [34, 35, 36],
giftable: [13, 67],
noOpinion: [3, 4],
- needsHosting: false,
+ hostingType: "neither",
canHostCount: 0,
- distanceToFestival: 0,
- hostingComment: "",
+ cohostVolunteer: "",
+ backProblems: false,
+ hostingNights: "",
+ bedType: [],
+ isolatedBed: false,
+ bedConfiguration: "",
+ hostAddress: "",
+ petAllergies: "",
+ transportType: "",
+ festivalProximity: "",
+ distanceToFestival: "",
+ hostingNeedReason: "",
+ hostingAbsoluteNeed: true,
meals: [],
charter: false,
}
@@ -224,23 +268,33 @@ export interface VolunteerDayWishes {
export interface VolunteerHosting {
id: Volunteer["id"]
- needsHosting: Volunteer["needsHosting"]
+ hostingType: Volunteer["hostingType"]
canHostCount: Volunteer["canHostCount"]
+ cohostVolunteer: Volunteer["cohostVolunteer"]
+ backProblems: Volunteer["backProblems"]
+ hostingNights: Volunteer["hostingNights"]
+ bedType: Volunteer["bedType"]
+ isolatedBed: Volunteer["isolatedBed"]
+ bedConfiguration: Volunteer["bedConfiguration"]
+ hostAddress: Volunteer["hostAddress"]
+ petAllergies: Volunteer["petAllergies"]
+ transportType: Volunteer["transportType"]
+ festivalProximity: Volunteer["festivalProximity"]
distanceToFestival: Volunteer["distanceToFestival"]
- hostingComment: Volunteer["hostingComment"]
+ hostingNeedReason: Volunteer["hostingNeedReason"]
+ hostingAbsoluteNeed: Volunteer["hostingAbsoluteNeed"]
}
export interface VolunteerMeals {
id: Volunteer["id"]
meals: Volunteer["meals"]
+ food: Volunteer["food"]
}
export interface VolunteerParticipationDetails {
id: Volunteer["id"]
tshirtSize: Volunteer["tshirtSize"]
- tshirtCount: Volunteer["tshirtCount"]
adult: Volunteer["adult"]
- food: Volunteer["food"]
}
export interface VolunteerPersonalInfo {
diff --git a/src/store/volunteerMealsSet.ts b/src/store/volunteerMealsSet.ts
index 59a8246..b841173 100644
--- a/src/store/volunteerMealsSet.ts
+++ b/src/store/volunteerMealsSet.ts
@@ -37,8 +37,7 @@ export const fetchVolunteerMealsSet = elementFetch(
getRequesting,
getSuccess,
getFailure,
- (error: Error) =>
- toastError(`Erreur lors du chargement des choix de jours de présence: ${error.message}`)
+ (error: Error) => toastError(`Erreur lors du chargement des choix des repas: ${error.message}`)
)
const shouldFetchVolunteerMealsSet = (state: AppState, id: number) =>