MSIN-4534 — Refactor bib assignment logic to streamline refresh processes, ensuring a single paint operation post-GO and deferring UI state synchronization until final stats are available. Update version code to 4.72.918.

This commit is contained in:
2026-07-30 11:56:22 -04:00
parent a4ab01fa22
commit 79d6fbfed8
4 changed files with 78 additions and 23 deletions

View File

@ -117,14 +117,16 @@
}
}
// Après reset : refresh lite sans loader plein écran ni panneau anomalies.
if (isResetMode) {
options.loader = false;
options.skipAnomalies = true;
options.refreshLite = true;
// MSIN-4534 — Après GO : une seule paint (refresh lite + stats), pas de hop-hop menus.
options.skipAnomalies = true;
options.skipQtySummary = true;
options.refreshLite = true;
options.skipSync = true;
if (options.loader === undefined) {
options.loader = !isResetMode;
}
bibAfterBatchGoRefreshOnly(row, isResetMode, options);
return bibAfterBatchGoRefreshOnly(row, isResetMode, options);
}
function bibAfterBatchGoRefreshOnly(row, isResetMode, options) {
@ -163,11 +165,12 @@
cb.disabled = false;
});
syncBibUiState(row);
// MSIN-4534 — Pas de syncBibUiState ici (stats encore stale → Réinit en retard).
var useLoader = options.loader !== false;
var skipAnomalies = options.skipAnomalies === true;
var skipQtySummary = options.skipQtySummary === true;
var refreshLite = options.refreshLite === true || isResetMode === true;
var skipSyncUntilStats = options.skipSync === true;
return bibFetch('/ajax_bib_range.php', {
method: 'POST',
@ -191,7 +194,11 @@
return;
}
let containerRef = setBibContainerFromAjax(row, refresh, { skipAnomalies: skipAnomalies });
let containerRef = setBibContainerFromAjax(row, refresh, {
skipAnomalies: skipAnomalies,
skipQtySummary: skipQtySummary,
skipSync: skipSyncUntilStats
});
if (!containerRef) {
return;
}
@ -209,11 +216,9 @@
.then(function (res) { return res.json(); })
.then(function (stats) {
if (!stats.success) {
return;
if (stats && stats.success) {
bibSyncEprBibStats(row, stats.info);
}
bibSyncEprBibStats(row, stats.info);
syncBibUiState(row);
});
});
@ -381,9 +386,18 @@
if (data.complete) {
if (showResult) {
bibAfterBatchGoSuccess(row, data, false);
} else if (!deferUiRefresh) {
bibAfterBatchGoRefreshOnly(row, false, { loader: false, skipAnomalies: true });
// MSIN-4534 — Attendre refresh+stats avant de baisser le loader (pas de hop-hop menus).
return bibAfterBatchGoSuccess(row, data, false, { loader: false })
.then(function () { return data; });
}
if (!deferUiRefresh) {
return bibAfterBatchGoRefreshOnly(row, false, {
loader: false,
skipAnomalies: true,
skipQtySummary: true,
refreshLite: true,
skipSync: true
}).then(function () { return data; });
}
return data;
}
@ -1628,7 +1642,10 @@
}
return bibAfterBatchGoRefreshOnly(row, false, {
loader: false,
skipAnomalies: true
skipAnomalies: true,
skipQtySummary: true,
refreshLite: true,
skipSync: true
});
});
});
@ -1745,7 +1762,10 @@
}
return bibAfterBatchGoRefreshOnly(row, false, {
loader: false,
skipAnomalies: true
skipAnomalies: true,
skipQtySummary: true,
refreshLite: true,
skipSync: true
});
});
});
@ -3307,7 +3327,10 @@
initModuleBibTippy(row);
initBibRangeRows(container);
}
syncBibUiState(row);
// MSIN-4534 — skipSync : différer syncBibUiState jusqu'aux stats finales (évite menus en retard).
if (!opts.skipSync) {
syncBibUiState(row);
}
if (!opts.skipAnomalies) {
refreshBibAnomaliesPanel();
}
@ -4199,7 +4222,7 @@
}
// MSIN-4528 — même chemin que reset séquence (pas de grille HTML).
bibAfterBatchGoSuccess(row, data, true);
return bibAfterBatchGoSuccess(row, data, true);
});
return;
@ -4715,7 +4738,7 @@
return;
}
bibAfterBatchGoSuccess(row, data, true);
return bibAfterBatchGoSuccess(row, data, true);
});
return;

View File

@ -3869,7 +3869,9 @@ function fxBibStaticFallback($clef) {
'bib_v4_global_batch_free_plan_invalid' => ['fr' => 'Sélection invalide : Début, Fin (ou Qté) et au moins une épreuve avec inscriptions à assigner.', 'en' => 'Invalid selection: Start, End (or Qty) and at least one race with registrations to assign.'],
'bib_v4_ajax_global_free_analysis' => ['fr' => '%d épreuve(s) · plage %d → %d · %d à assigner · %s', 'en' => '%d race(s) · range %d → %d · %d to assign · %s'],
'bib_v4_ajax_global_free_sim_summary' => ['fr' => '%d épreuve(s) · %d dossards · %d à assigner · %s', 'en' => '%d race(s) · %d bibs · %d to assign · %s'],
'bib_v4_batch_order_2' => ['fr' => 'Tri secondaire', 'en' => 'Secondary sort'],
// MSIN-4534 — Libellés homogènes niveau 14
'bib_v4_batch_order' => ['fr' => 'Tri niveau 1', 'en' => 'Sort level 1'],
'bib_v4_batch_order_2' => ['fr' => 'Tri niveau 2', 'en' => 'Sort level 2'],
'bib_v4_batch_order_3' => ['fr' => 'Tri niveau 3', 'en' => 'Sort level 3'],
'bib_v4_batch_order_4' => ['fr' => 'Tri niveau 4', 'en' => 'Sort level 4'],
'bib_v4_batch_order_none' => ['fr' => '— Aucun —', 'en' => '— None —'],

View File

@ -7,7 +7,7 @@
* Constantes *
*
**************/
define('_VERSION_CODE', '4.72.917'); // MSIN-45304 niveaux visibles comme 4514 + fix reset hide-all
define('_VERSION_CODE', '4.72.918'); // MSIN-4534fin GO sans hop-hop + libellés Tri niveau 1/2
define('_DATE_CODE', '2026-07-30');
//MSIN-4290
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');

View File

@ -0,0 +1,30 @@
-- MSIN-4534 — Libellés tris batch : Tri niveau 1 / 2 (alignés sur 3 / 4)
-- Notes : exécution UNIQUEMENT sur dev préprod ; autres env = Navicat structure + sync_static_db
UPDATE info
SET info_texte = 'Tri niveau 1',
info_aide = 'Premier critère de tri avant d''attribuer les dossards.'
WHERE info_clef = 'bib_v4_batch_order'
AND info_langue = 'fr'
AND info_prg = 'compte.php';
UPDATE info
SET info_texte = 'Sort level 1',
info_aide = 'Primary sort before assigning bibs.'
WHERE info_clef = 'bib_v4_batch_order'
AND info_langue = 'en'
AND info_prg = 'compte.php';
UPDATE info
SET info_texte = 'Tri niveau 2',
info_aide = 'Critère optionnel après le tri niveau 1.'
WHERE info_clef = 'bib_v4_batch_order_2'
AND info_langue = 'fr'
AND info_prg = 'compte.php';
UPDATE info
SET info_texte = 'Sort level 2',
info_aide = 'Optional criterion after sort level 1.'
WHERE info_clef = 'bib_v4_batch_order_2'
AND info_langue = 'en'
AND info_prg = 'compte.php';