mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Display processed products first and visually indicate their status
Adjusted product display logic to prioritize and style products that have been processed or validated, ensuring they appear at the beginning of the list with a distinct visual treatment. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 7b704198-c867-4dc2-bcfa-f3fd0e9ea029 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/LXHtbOp
This commit is contained in:
1 parent
5f30c68676
commit
42a7c494f2
2 files changed
+7
-6
No files matched your search
@@ -894,6 +894,7 @@ export default function DlcPage() {
|
||||
key={product.id}
|
||||
className={
|
||||
product.status === "valides" ? "opacity-60 bg-gray-50 dark:bg-gray-800" :
|
||||
product.processedUntilExpiry ? "opacity-60 bg-blue-50 dark:bg-blue-900/20" :
|
||||
product.stockEpuise ? "opacity-50 bg-yellow-50 dark:bg-yellow-900/20" : ""
|
||||
}
|
||||
>
|
||||
|
||||
+6
-6
@@ -1948,14 +1948,14 @@ export class DatabaseStorage implements IStorage {
|
||||
query = query.where(and(...conditions));
|
||||
}
|
||||
|
||||
// Tri intelligent : produits actifs en premier, puis produits traités/validés en dernier
|
||||
// Tri intelligent : produits traités/validés en premier (grisés), puis produits actifs
|
||||
const results = await query.orderBy(
|
||||
// Priorité 1 : Produits actifs d'abord (non validés, non traités, stock disponible)
|
||||
// Priorité 1 : Produits traités/validés d'abord (affichés en grisé)
|
||||
sql`CASE
|
||||
WHEN ${dlcProducts.status} = 'valides' THEN 3
|
||||
WHEN ${dlcProducts.stockEpuise} = true THEN 2
|
||||
WHEN ${dlcProducts.processedUntilExpiry} = true THEN 2
|
||||
ELSE 1
|
||||
WHEN ${dlcProducts.processedUntilExpiry} = true THEN 1
|
||||
WHEN ${dlcProducts.status} = 'valides' THEN 1
|
||||
WHEN ${dlcProducts.stockEpuise} = true THEN 1
|
||||
ELSE 2
|
||||
END`,
|
||||
// Priorité 2 : Date d'expiration (croissante)
|
||||
asc(dlcProducts.expiryDate)
|
||||
|
||||
Reference in new issue
Block a user