From 503172f5371fb1902b4ed6ef01cdd929c1e4efec Mon Sep 17 00:00:00 2001 From: Louis Mazin Date: Sun, 20 Sep 2026 04:17:19 +0200 Subject: [PATCH] test --- frontend/src/pages/TimeClockPage.jsx | 179 +++++++++++---------------- 1 file changed, 72 insertions(+), 107 deletions(-) diff --git a/frontend/src/pages/TimeClockPage.jsx b/frontend/src/pages/TimeClockPage.jsx index f1c2149..93909d0 100644 --- a/frontend/src/pages/TimeClockPage.jsx +++ b/frontend/src/pages/TimeClockPage.jsx @@ -1428,17 +1428,6 @@ const TimeClockPage = () => { try { - /* ===================================================== - GROUPE MULTI-JOURS - - On ne modifie que : - - start_time de la première ligne - - end_time de la dernière ligne - - Les dates restent celles du groupe car le serializer - actuel de mise à jour ne gère pas date/end_date. - ====================================================== */ - if ( editingEntry.isGrouped ) { @@ -1493,10 +1482,6 @@ const TimeClockPage = () => { } - /* - * Cas très improbable où le groupe ne possède - * qu'une seule ligne. - */ if ( firstEntry.id === lastEntry.id @@ -1511,11 +1496,6 @@ const TimeClockPage = () => { }, ); } else { - /* - * Première journée : - * on conserve son end_time = 23:59:59 - * et on change uniquement start_time. - */ await timeApi.updateTimeEntry( firstEntry.id, { @@ -1527,11 +1507,6 @@ const TimeClockPage = () => { ); - /* - * Dernière journée : - * on conserve son start_time = 00:00 - * et on change uniquement end_time. - */ await timeApi.updateTimeEntry( lastEntry.id, { @@ -1543,11 +1518,6 @@ const TimeClockPage = () => { ); } } else { - /* - * Pointage classique : - * le backend actuel ne prend en charge que - * start_time/end_time pour la modification. - */ await timeApi.updateTimeEntry( editingEntry.id, { @@ -1598,10 +1568,6 @@ const TimeClockPage = () => { entry.sourceEntries, ) ) { - /* - * Suppression de toutes les lignes - * appartenant au même group_id. - */ for ( const sourceEntry of entry.sourceEntries @@ -2328,6 +2294,9 @@ const TimeClockPage = () => { RENDER ========================================================= */ + const scanConflictConfig = + getScanConflictConfig(); + return ( @@ -2392,78 +2361,73 @@ const TimeClockPage = () => { )} - {/* ========================= - CONFLIT - ========================== */} + {/* ===================================================== + DIALOG CONFLIT DE POINTAGE + ====================================================== */} - {scanConflict && ( - - - - {scanConflict.step === + { + if (!open) { + cancelScanConflict(); + } + }} + > + + + + {scanConflict?.step === 'confirm' ? 'Confirmation du pointage' : 'Heure manquante'} - - + + - - {(() => { - const config = - getScanConflictConfig(); + {scanConflictConfig && ( +
- if (!config) { - return null; - } - - if ( - scanConflict.step === - 'confirm' - ) { - return ( - <> -

- { - config.confirmationMessage - } -

- -
- - - -
- - ); - } - - return ( + {scanConflict.step === + 'confirm' ? ( <> -

+

{ - config.confirmationMessage + scanConflictConfig.confirmationMessage + } +

+ +
+ + + +
+ + ) : ( + <> +

+ { + scanConflictConfig.confirmationMessage }

@@ -2479,16 +2443,7 @@ const TimeClockPage = () => {
-
- - +
+ +
- ); - })()} - - - )} + )} + +
+ )} + + {/* =====================================================