Implement full-day events #3

Open
agroudiev wants to merge 20 commits from agroudiev/fullday into main
Owner

Closes #1

Implements events where participants need to select the full day instead of specific hours.

Backend:

  • New is_fullday field for Event, etc

Frontend:

  • Toggle in form to select fullday
  • No timezone choice if fullday type is selected
  • New fullday-DDMMYYYY format for serialized cell names
  • Square selection cells to select full days
Closes #1 Implements events where participants need to select the full day instead of specific hours. Backend: - New `is_fullday` field for `Event`, etc Frontend: - Toggle in form to select fullday - No timezone choice if fullday type is selected - New `fullday-DDMMYYYY` format for serialized cell names - Square selection cells to select full days
Author
Owner

En y repensant, il faudrait peut-être désactiver le choix de la timezone sur la page de sélection de disponibilité pour éviter la confusion

Edit: done

En y repensant, il faudrait peut-être désactiver le choix de la timezone sur la page de sélection de disponibilité pour éviter la confusion Edit: done
thubrecht left a comment
Owner

Il faut penser à bien rentrer dans le shell nix pour avoir les hooks de pre-push qui tournent quand tu pousses ton code, le formatage n'est pas bon en particulier

Il faut penser à bien rentrer dans le shell nix pour avoir les hooks de pre-push qui tournent quand tu pousses ton code, le formatage n'est pas bon en particulier
@ -220,6 +221,7 @@ impl From<event::Model> for Event {
visited_at: value.visited_at.and_utc(),
times: serde_json::from_value(value.times).unwrap_or(vec![]),
timezone: value.timezone,
is_fullday: value.is_fullday,
Owner

Il va y avoir une migration à créer avec sea-orm-cli migrate generate add_fullday_event lancé dans src/api/adaptors/sql/src

Il va y avoir une migration à créer avec `sea-orm-cli migrate generate add_fullday_event` lancé dans `src/api/adaptors/sql/src`
agroudiev marked this conversation as resolved
@ -38,3 +38,2 @@
const expandedTimes = useMemo(
() => expandTimes(event?.times ?? []),
[event?.times],
() => expandTimes(event?.times ?? [], event?.is_fullday ?? false),
Owner

!!event?.is_fullday plutôt

`!!event?.is_fullday` plutôt
agroudiev marked this conversation as resolved
@ -207,6 +208,7 @@ const EventAvailabilities = ({ event }: EventAvailabilitiesProps) => {
times={expandedTimes}
people={people}
table={table}
isFullday={event?.is_fullday ?? false}
Owner

Bof, il vaut mieux déclarer isFullDay en boolean | undefined dans le composant

Bof, il vaut mieux déclarer `isFullDay` en `boolean | undefined` dans le composant
agroudiev marked this conversation as resolved
@ -1,3 +1,5 @@
import { is } from "zod/v4/locales";
Owner

C'est inutilisé ?

C'est inutilisé ?
agroudiev marked this conversation as resolved
@ -15,6 +15,7 @@ interface AvailabilityEditorProps {
eventId?: string;
times: string[];
timezone: string;
isFullday: boolean;
Owner

isFullDay?: boolean

`isFullDay?: boolean`
agroudiev marked this conversation as resolved
@ -116,0 +108,4 @@
<div
className={makeClass(
viewerStyles.timeLabels,
isFullday && viewerStyles.timeLabelsFullday,
Owner

Cette classe n'existe pas, y'a une typo maybe ?

Cette classe n'existe pas, y'a une typo maybe ?
Author
Owner

Ah oui, c’est une ancienne classe que j’ai refactor

Ah oui, c’est une ancienne classe que j’ai refactor
agroudiev marked this conversation as resolved
@ -29,32 +32,41 @@ export const calculateTable = ({
const isSpecificDates = times[0]?.length === 13;
Owner

À modifier, les dates ne s'affichent pas sur la vue journée entière

À modifier, les dates ne s'affichent pas sur la vue journée entière
agroudiev marked this conversation as resolved
thubrecht left a comment
Owner

La migration sql va pas marcher actuellement, je te fais un fix demain

La migration sql va pas marcher actuellement, je te fais un fix demain
@ -15,6 +15,7 @@ interface AvailabilityEditorProps {
eventId?: string;
times: string[];
timezone: string;
isFullday?: boolean | undefined;
Owner

Avec le ? y'a pas besoin de mettre le | undefined

Avec le `?` y'a pas besoin de mettre le `| undefined`
agroudiev marked this conversation as resolved
@ -23,12 +23,14 @@ import { useLocale, useTranslations } from "next-intl";
interface AvailabilityViewerProps {
times: string[];
isFullday: boolean | undefined;
Owner

nit: isFullday?: boolean

nit: `isFullday?: boolean`
agroudiev marked this conversation as resolved
@ -0,0 +33,4 @@
}: TimeFieldProps<TValues>) => {
const t = useTranslations("Home");
const [type, setType] = useState<"timeRange" | "fullday">("timeRange");
Owner

nit: Je mettrais kind plutôt que type vu qu'en typescript c'est un keyword

nit: Je mettrais `kind` plutôt que `type` vu qu'en typescript c'est un keyword
agroudiev marked this conversation as resolved
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin agroudiev/fullday:agroudiev/fullday
git switch agroudiev/fullday

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff agroudiev/fullday
git switch agroudiev/fullday
git rebase main
git switch main
git merge --ff-only agroudiev/fullday
git switch agroudiev/fullday
git rebase main
git switch main
git merge --no-ff agroudiev/fullday
git switch main
git merge --squash agroudiev/fullday
git switch main
git merge --ff-only agroudiev/fullday
git switch main
git merge agroudiev/fullday
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DGNum/crab.fit!3
No description provided.