Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
104d112 to
859dc31
Compare
c224e35 to
829228b
Compare
829228b to
c989e8b
Compare
c989e8b to
49aad89
Compare
612670e to
4872ee4
Compare
c2d9097 to
ea2c567
Compare
ea2c567 to
753e6ea
Compare
01e9c3d to
1652f46
Compare
8b85a99 to
3f22f66
Compare
1ee9656 to
8014c5b
Compare
|
| var startDate: LocalDate? = null, | ||
|
|
||
| @Column(name = "end_date", nullable = true) | ||
| var endDate: LocalDate? = null, |
There was a problem hiding this comment.
je me demande si je suis pas un peu trop souple sur les dates
| BEGIN | ||
| CREATE TABLE IF NOT EXISTS public.mission_crew_absence ( | ||
| id SERIAL PRIMARY KEY, | ||
| mission_crew_id INTEGER NOT NULL REFERENCES public.mission_crew(id) ON DELETE CASCADE, |
There was a problem hiding this comment.
La table Absence est liée à la table MissionCrew avec un delete cascade.
En théorie, on ne delete pas de row de MissionCrew donc le delete cascade est pas si dangereux mais est ce que pour des soucis d'archivage, il faudrait pas mieux virer le delete cascade ? T'as un avis ?
| export function useMissionDates(missionId?: string): [string | undefined, string | undefined] { | ||
| const queryClient = useQueryClient() | ||
|
|
||
| const mission: Mission2 | undefined = missionId ? queryClient.getQueryData(missionsKeys.byId(missionId)) : undefined | ||
|
|
||
| return [mission?.data?.startDateTimeUtc, mission?.data?.endDateTimeUtc] | ||
| } |
There was a problem hiding this comment.
Ici dans le frontend, après avoir déjà codé ce fichier, j'ai vu que t'as un use-mission avec quelques utils dedans. T'as un avis entre laisser ce hook ou le migrer dans use-mission ?
There was a problem hiding this comment.
on peut merger plus tard
| // if a temporary absence matches the whole length of the mission | ||
| // set it as full mission absence instead of just temporary | ||
| const isAbsentFullMission = | ||
| value.isAbsentFullMission || | ||
| (missionStartDateTimeUtc && | ||
| missionEndDateTimeUtc && | ||
| startDate && | ||
| endDate && | ||
| isSameDay(new Date(startDate), new Date(missionStartDateTimeUtc)) && | ||
| isSameDay(new Date(endDate), new Date(missionEndDateTimeUtc))) |
There was a problem hiding this comment.
ça, ça pourrait être fait dans le backend aussi
| fieldArray: FieldArrayRenderProps | ||
| } | ||
|
|
||
| const MissionGeneralInformationCrewPam: React.FC<MissionGeneralInformationCrewPamProps> = ({ |
There was a problem hiding this comment.
Ce fichier il a pas vraiment changé mais au lieu d'un move, git m'a fait un delete/create
| // Local state for "new/unsaved" temporary absences | ||
| // Initialize with one empty absence so the user sees a form immediately | ||
| const [localAbsences, setLocalAbsences] = useState<MissionCrewAbsence[]>(absences.length === 0 ? [EMPTY_ABSENCE] : []) | ||
|
|
||
| // Track validity and values for each form row | ||
| const formStatesRef = React.useRef<Record<number, FormState>>({}) | ||
| const [, forceUpdate] = useState(0) | ||
|
|
||
| // Display absences: committed ones first, then local ones | ||
| const displayAbsences = [...absences, ...localAbsences] | ||
|
|
There was a problem hiding this comment.
J'ai bien galéré avec Formik pour gérer des form temporaraires dans d'autres components dans des Modal
| const allFormsValid = | ||
| displayAbsences.length > 0 && | ||
| displayAbsences.every((_, index) => { | ||
| const state = formStatesRef.current[index] | ||
| return state?.isValid === true | ||
| }) |
There was a problem hiding this comment.
Pour disable le bouton "valider" dans la modal si une des form rows est pas valide
82e9918 to
a3aba6f
Compare
40dc21d to
543876a
Compare
| crewModel.agent = agent | ||
| } | ||
| // if (crew.agent != null && crew.agent.id != null) { | ||
| // val agent = dbAgentRepository.findById(crew.agent.id).orElseThrow() |
| DO | ||
| $$ | ||
| BEGIN | ||
| CREATE TABLE IF NOT EXISTS public.mission_crew_absence ( |
There was a problem hiding this comment.
naming, peut etre juste crew_absence
| export function useMissionDates(missionId?: string): [string | undefined, string | undefined] { | ||
| const queryClient = useQueryClient() | ||
|
|
||
| const mission: Mission2 | undefined = missionId ? queryClient.getQueryData(missionsKeys.byId(missionId)) : undefined | ||
|
|
||
| return [mission?.data?.startDateTimeUtc, mission?.data?.endDateTimeUtc] | ||
| } |
There was a problem hiding this comment.
on peut merger plus tard
No description provided.