mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-12 01:36:43 +02:00
perf+fix: parallelize article pagination, filter inactive articles, add gamme Y
Performance fixes for large suppliers (14k+ articles): - fetchAllPages now fetches page 1, reads total count from response, then fetches remaining pages in parallel (10 at a time) instead of sequentially. Falls back to sequential if no count in response. - getProductRows filters out suspended/inactive articles before calling getMensuelByArticles and getReferentielByArticles, reducing API calls from N_total to N_active (e.g. 14775→~2500 for S053). - getRankingByArticles receives only active articles for bulk fetch. - FfArticle now exposes actif and suspendu fields. Gamme Y support: - GammeSelect: add Y option with violet color - GridFilterBar: add Y filter button with violet color - BulkActionToolbar: add Y bulk assignment button Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
69c7d65482
commit
a16ec24cd7
3 files changed
+5
No files matched your search
@@ -8,6 +8,7 @@ const GAMME_OPTIONS: { label: string; code: GammeCode; color: string }[] = [
|
||||
{ label: "A — Cœur", code: "A", color: "border-emerald-600 text-emerald-400 hover:bg-emerald-900/20" },
|
||||
{ label: "B — Complémentaire", code: "B", color: "border-blue-600 text-blue-400 hover:bg-blue-900/20" },
|
||||
{ label: "C — Saisonnier", code: "C", color: "border-amber-600 text-amber-400 hover:bg-amber-900/20" },
|
||||
{ label: "Y — En veille", code: "Y", color: "border-violet-600 text-violet-400 hover:bg-violet-900/20" },
|
||||
{ label: "Z — Sortie", code: "Z", color: "border-rose-600 text-rose-400 hover:bg-rose-900/20" },
|
||||
];
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ const GAMME_STYLES: Record<string, string> = {
|
||||
A: "border-[1px] border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/20 dark:text-emerald-400",
|
||||
B: "border-[1px] border-blue-500/30 bg-blue-500/10 text-blue-700 dark:border-blue-500/30 dark:bg-blue-500/20 dark:text-blue-400",
|
||||
C: "border-[1px] border-amber-500/30 bg-amber-500/10 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/20 dark:text-amber-400",
|
||||
Y: "border-[1px] border-violet-500/30 bg-violet-500/10 text-violet-700 dark:border-violet-500/30 dark:bg-violet-500/20 dark:text-violet-400",
|
||||
Z: "border-[1px] border-rose-500/30 bg-rose-500/10 text-rose-700 dark:border-rose-500/30 dark:bg-rose-500/20 dark:text-rose-400",
|
||||
Aucune: "border-[1px] border-slate-500/30 bg-slate-500/10 text-slate-700 dark:border-slate-500/30 dark:bg-slate-500/20 dark:text-slate-400",
|
||||
};
|
||||
@@ -37,6 +38,7 @@ export function GammeSelect({ value, isDraft, onChange }: GammeSelectProps) {
|
||||
<option value="A">A</option>
|
||||
<option value="B">B</option>
|
||||
<option value="C">C</option>
|
||||
<option value="Y">Y</option>
|
||||
<option value="Z">Z</option>
|
||||
</select>
|
||||
);
|
||||
|
||||
@@ -11,6 +11,7 @@ const GAMME_FILTERS: { label: string; value: GammeCode | null }[] = [
|
||||
{ label: "A", value: "A" },
|
||||
{ label: "B", value: "B" },
|
||||
{ label: "C", value: "C" },
|
||||
{ label: "Y", value: "Y" },
|
||||
{ label: "Z", value: "Z" },
|
||||
];
|
||||
|
||||
@@ -169,6 +170,7 @@ export function GridFilterBar({ fournisseurs, magasins }: GridFilterBarProps) {
|
||||
case "A": return { background: "rgba(16, 185, 129, 0.15)", color: "rgb(5, 150, 105)" }; // Emerald
|
||||
case "B": return { background: "rgba(59, 130, 246, 0.15)", color: "rgb(37, 99, 235)" }; // Blue
|
||||
case "C": return { background: "rgba(245, 158, 11, 0.15)", color: "rgb(217, 119, 6)" }; // Amber
|
||||
case "Y": return { background: "rgba(139, 92, 246, 0.15)", color: "rgb(109, 40, 217)" }; // Violet
|
||||
case "Z": return { background: "rgba(244, 63, 94, 0.15)", color: "rgb(225, 29, 72)" }; // Rose
|
||||
case "Aucune": return { background: "rgba(100, 116, 139, 0.15)", color: "rgb(71, 85, 105)" }; // Slate
|
||||
default: return { background: "rgba(0,0,0,0.1)", color: "var(--text-primary)" };
|
||||
|
||||
Reference in new issue
Block a user