Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
206571627b | ||
|
|
d64218f45f | ||
|
|
7695ca0dea | ||
|
|
bd956328db | ||
|
|
20bc559a6c | ||
|
|
2abfec57ae | ||
|
|
f1f5f3612b |
No files matched your search
+14
-11
@@ -214,22 +214,25 @@ jobs:
|
||||
exit 1
|
||||
}
|
||||
|
||||
grep -q 'currentCollection' "${NAVBAR_FILE}" || {
|
||||
echo "ERROR: navbar.tsx no calcula currentCollection."
|
||||
# Desde Etapa 2 sub-fase 2 (2026-08-25) el nav es data-driven
|
||||
# contra el arbol real de categorias de Medusa, no un array
|
||||
# hardcodeado -- esta version anterior del check no detectaba
|
||||
# que "category=Mochilas"/"collection=Marvel" eran strings
|
||||
# hardcodeadas que ya no correspondian a ningun dato real (rotas
|
||||
# en silencio desde que se elimino legacyProductMeta, PR #29).
|
||||
# "currentCollection" tampoco existe mas: las colecciones ya no
|
||||
# se usan para resaltar el item activo del menu de categorias.
|
||||
grep -q 'buildCategoryTree' "${NAVBAR_FILE}" || {
|
||||
echo "ERROR: navbar.tsx ya no arma el arbol de categorias desde datos reales."
|
||||
exit 1
|
||||
}
|
||||
|
||||
grep -q 'collection=Marvel' "${NAVBAR_FILE}" || {
|
||||
echo "ERROR: falta collection=Marvel en navbar.tsx."
|
||||
grep -q 'encodeURIComponent(root.name)' "${NAVBAR_FILE}" || {
|
||||
echo "ERROR: navbar.tsx ya no linkea por el nombre real de categoria."
|
||||
exit 1
|
||||
}
|
||||
|
||||
grep -q 'category=Mochilas' "${NAVBAR_FILE}" || {
|
||||
echo "ERROR: falta category=Mochilas en navbar.tsx."
|
||||
exit 1
|
||||
}
|
||||
|
||||
grep -q 'aria-current={active ? "page" : undefined}' "${NAVBAR_FILE}" || {
|
||||
grep -q 'aria-current={isActive(' "${NAVBAR_FILE}" || {
|
||||
echo "ERROR: navbar.tsx no expone correctamente el menú activo."
|
||||
exit 1
|
||||
}
|
||||
@@ -258,7 +261,7 @@ jobs:
|
||||
|
||||
echo "Validando remontaje por parámetros: ${PAGE_FILE}"
|
||||
|
||||
grep -q 'key={`${category}:${collection}:${query}:${section}`}' "${PAGE_FILE}" || {
|
||||
grep -q 'key={`${category}:${collection}:${query}`}' "${PAGE_FILE}" || {
|
||||
echo "ERROR: app/catalog/page.tsx no remonta CatalogClient al cambiar la URL."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -6,6 +6,13 @@ import { Navbar } from "@/components/layout/navbar";
|
||||
import { WishlistDrawer } from "@/components/wishlist/wishlist-drawer";
|
||||
import { getCategories, getProducts } from "@/lib/headless/client";
|
||||
|
||||
// El Navbar (categorias/colecciones/predictive search) vive en este layout
|
||||
// compartido -- si alguna pagina futura queda estatica, este fetch se
|
||||
// congelaria con datos de build time (mock) igual que le paso al home
|
||||
// (ver app/page.tsx). Forzarlo aca protege el nav en cualquier ruta, no
|
||||
// solo en las que hoy ya son dinamicas por otro motivo (searchParams, etc.).
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL ?? "https://shop.cruzcloud.net"),
|
||||
title: { default: "ARI Shopping | Juguetes, regalos y variedades", template: "%s | ARI Shopping" },
|
||||
|
||||
@@ -7,6 +7,13 @@ import { ProductCarousel } from "@/components/product/product-carousel";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { getCategories, getProducts } from "@/lib/headless/client";
|
||||
|
||||
// Sin esto, Next.js prerenderiza "/" en build time dentro del Dockerfile,
|
||||
// donde HEADLESS_PROVIDER/MEDUSA_* todavia no existen (solo se inyectan en
|
||||
// runtime via el Deployment) -- cae al provider mock y ese HTML queda
|
||||
// cacheado 1 año (visto en vivo: x-nextjs-prerender:1, s-maxage=31536000),
|
||||
// violando el flujo Admin -> revalidate del ADR 0005 justo en el home.
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function HomePage() {
|
||||
const [products, categories] = await Promise.all([getProducts(), getCategories()]);
|
||||
const treasures = products.filter((product) => product.isNew || product.featured).slice(0, 8);
|
||||
|
||||
@@ -3,11 +3,13 @@ import Link from "next/link";
|
||||
import { ArrowUpRight } from "lucide-react";
|
||||
import type { Category } from "@/lib/headless/types";
|
||||
|
||||
type TileContent = { subtitle: string; image?: string; color: string };
|
||||
|
||||
// No hay fotografia real todavia para las 6 categorias raiz de la taxonomia
|
||||
// (ver ADR 0005) -- solo se mapean imagen/subtitulo para las que ya tienen
|
||||
// un asset en public/images/categories/. Las demas caen al tile de solo
|
||||
// gradiente en vez de mostrar una imagen que no les corresponde.
|
||||
const tileContent: Record<string, { subtitle: string; image?: string; color: string }> = {
|
||||
const tileContent: Record<string, TileContent> = {
|
||||
juguetes: { subtitle: "Personajes que inspiran", image: "/images/categories/figuras.webp", color: "from-yellow-300 to-orange-400" },
|
||||
"mochilas-y-morrales": { subtitle: "Estilo para cada aventura", image: "/images/categories/mochilas.webp", color: "from-cyan-400 to-blue-500" },
|
||||
"bebes-y-primera-infancia": { subtitle: "Primeros descubrimientos", color: "from-pink-300 to-fuchsia-400" },
|
||||
@@ -16,7 +18,7 @@ const tileContent: Record<string, { subtitle: string; image?: string; color: str
|
||||
variedades: { subtitle: "Un poco de todo", color: "from-violet-400 to-purple-600" },
|
||||
};
|
||||
|
||||
const defaultTile = { subtitle: "Explora esta categoría", color: "from-slate-400 to-slate-600" };
|
||||
const defaultTile: TileContent = { subtitle: "Explora esta categoría", color: "from-slate-400 to-slate-600" };
|
||||
|
||||
export function CategoryTiles({ categories }: { categories: Category[] }) {
|
||||
const roots = categories.filter((category) => !category.parentId);
|
||||
|
||||
@@ -25,7 +25,7 @@ spec:
|
||||
runAsUser: 1001
|
||||
containers:
|
||||
- name: app
|
||||
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.135
|
||||
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.141
|
||||
env:
|
||||
- name: HEADLESS_PROVIDER
|
||||
value: medusa
|
||||
|
||||
Reference in new issue
Block a user