Add campaign filter and duplication, pack activity, and gift pack rate fallback
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 22m9s
Validate and deploy Sokko G / deploy (push) Successful in 17s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-19 12:48:15 +01:00
parent 048d9a0c91
commit 99724cb6ba
8 changed files with 121 additions and 10 deletions

View file

@ -30,6 +30,15 @@ function CollectionBadges({ collection }) {
return <div className="nebula-admin-collection-badges"><span className="nds-badge" data-variant={collection.packCategory === "permanent" ? "neutral" : "gold"}>{{ event: "Événement", shop: "Boutique", expedition: "Expéditions" }[collection.packCategory] || "Permanente"}</span><span className="nds-badge" data-variant={collection.active ? "success" : "neutral"}>{collection.active ? "Ouverte" : "Fermée"}</span></div>;
}
// Ouvertures du paquet sur 7 jours, en précisant la part des paquets offerts.
function PackActivity({ activity }) {
const openings = activity?.openings || 0;
const gifted = activity?.gifted || 0;
return <span className="nebula-admin-pack-activity" data-empty={openings ? undefined : ""}>
<b>{openings.toLocaleString("fr-FR")}</b> {openings > 1 ? "ouvertures" : "ouverture"} sur 7 jours{gifted > 0 && <small> · dont {gifted.toLocaleString("fr-FR")} {gifted > 1 ? "offertes" : "offerte"}</small>}
</span>;
}
function CollectionsIndex({ catalog, lookup, dashboard, busy, runMutation, refreshDashboard }) {
return <section className="nebula-admin-collections" aria-labelledby="nebula-admin-collections-title">
<RechargeSetting key={dashboard?.rechargeSetting?.intervalMs || 0} setting={dashboard?.rechargeSetting} busy={busy} runMutation={runMutation} refreshDashboard={refreshDashboard} />
@ -48,6 +57,7 @@ function CollectionsIndex({ catalog, lookup, dashboard, busy, runMutation, refre
<span data-rarity="mythic"><b>{activeMythics}</b><small>{activeMythics > 1 ? "mythiques tirables" : "mythique tirable"}</small></span>
</span>
<span className="nebula-admin-rarity-counts" aria-label={`Variations par rareté de ${collection.name}`}>{byRarity.map(({ rarity, count }) => <span key={rarity.id} data-rarity={rarity.id}><small>{rarity.label}</small><b>{count}</b></span>)}</span>
{collection.packCategory !== "expedition" && dashboard && <PackActivity activity={dashboard.packActivity7d?.[collection.id]} />}
<span className="nebula-admin-collection-open" aria-hidden="true">Voir la collection →</span>
</span>
</a>;