feat(pasarela): campo opcional de descripción en la pasarela de proponer local
deploy-branch / deploy (push) Successful in 3m11s
deploy-branch / teardown (push) Skipped
tests / Unitarias + componente + build (push) Failing after 3m27s
tests / Integración (Nominatim real, opt-in) (push) Skipped
tests / Unitarias + componente + build (pull_request) Failing after 3m0s
tests / Integración (Nominatim real, opt-in) (pull_request) Skipped
deploy-branch / deploy (push) Successful in 3m11s
deploy-branch / teardown (push) Skipped
tests / Unitarias + componente + build (push) Failing after 3m27s
tests / Integración (Nominatim real, opt-in) (push) Skipped
tests / Unitarias + componente + build (pull_request) Failing after 3m0s
tests / Integración (Nominatim real, opt-in) (pull_request) Skipped
Nueva pantalla "Descripción" (paso 5 de 6, opcional, máx. 200 caracteres) entre Tipo específico y Revisión. La descripción viaja en la propuesta (trim; vacía → ausente/NULL), el filtro de palabras prohibidas la cubre y el resumen la muestra. Backend/BD ya la soportaban: cambio frontend-only. Incluye el archivo del cambio hide-admin-route y la propuesta openspec del nuevo cambio. Suite: 114/114.
This commit is contained in:
@@ -4,6 +4,7 @@ import PasoUbicacion from "./PasoUbicacion.jsx";
|
||||
import PasoDatosLocal from "./PasoDatosLocal.jsx";
|
||||
import PasoCategoria from "./PasoCategoria.jsx";
|
||||
import PasoSubcategoria from "./PasoSubcategoria.jsx";
|
||||
import PasoDescripcion from "./PasoDescripcion.jsx";
|
||||
import PasoResumen from "./PasoResumen.jsx";
|
||||
|
||||
// Definición declarativa de las pantallas de la pasarela: orden, título y
|
||||
@@ -14,6 +15,7 @@ const PASOS = [
|
||||
{ id: "datos", titulo: "Datos del local", Componente: PasoDatosLocal, puedeContinuar: (f) => (f.nombre || "").trim().length >= 2 && !!f.provincia },
|
||||
{ id: "categoria", titulo: "Categoría", Componente: PasoCategoria, puedeContinuar: (f) => !!f.categoria },
|
||||
{ id: "subcategoria", titulo: "Tipo específico", Componente: PasoSubcategoria, puedeContinuar: () => true },
|
||||
{ id: "descripcion", titulo: "Descripción", Componente: PasoDescripcion, puedeContinuar: () => true },
|
||||
{ id: "resumen", titulo: "Revisión y envío", Componente: PasoResumen, puedeContinuar: () => true },
|
||||
];
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { inputStyle } from "../styles/shared.js";
|
||||
|
||||
// Paso 5 de la pasarela: descripción corta del local, opcional. Se puede
|
||||
// continuar sin escribir nada. El texto (recortado de espacios) viaja en la
|
||||
// propuesta: el admin lo ve al revisarla y la ficha pública al aprobarse.
|
||||
export default function PasoDescripcion({ form, setForm }) {
|
||||
return (
|
||||
<div>
|
||||
<label htmlFor="paso-descripcion" style={{ fontSize: 12, color: "var(--color-text-secondary)", display: "block", marginBottom: 4 }}>
|
||||
Descripción
|
||||
</label>
|
||||
<textarea
|
||||
id="paso-descripcion"
|
||||
style={{ ...inputStyle, resize: "vertical", minHeight: 72, fontFamily: "inherit", lineHeight: 1.5 }}
|
||||
maxLength={200}
|
||||
rows={3}
|
||||
value={form.descripcion}
|
||||
onChange={(e) => setForm((f) => ({ ...f, descripcion: e.target.value }))}
|
||||
placeholder="Qué se vende, el ambiente, algún detalle que te gustaría contar…"
|
||||
/>
|
||||
<p style={{ fontSize: 11, color: "var(--color-text-tertiary)", margin: "6px 0 0" }}>
|
||||
Paso opcional: puedes continuar sin escribir descripción. Máximo 200 caracteres.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -45,12 +45,18 @@ export default function PasoResumen({
|
||||
<span style={clave}>📂 Categoría</span>
|
||||
<span style={valor}>{categoria ? `${categoria.emoji} ${form.categoria}` : ""}</span>
|
||||
</div>
|
||||
<div style={{ ...fila, borderBottom: "none" }}>
|
||||
<div style={fila}>
|
||||
<span style={clave}>🔖 Tipo específico</span>
|
||||
<span style={{ ...valor, fontWeight: form.subcategoria ? 500 : 400, color: form.subcategoria ? "inherit" : "var(--color-text-tertiary)" }}>
|
||||
{form.subcategoria || "—"}
|
||||
</span>
|
||||
</div>
|
||||
<div style={{ ...fila, borderBottom: "none" }}>
|
||||
<span style={clave}>💬 Descripción</span>
|
||||
<span style={{ ...valor, fontWeight: form.descripcion ? 500 : 400, color: form.descripcion ? "inherit" : "var(--color-text-tertiary)", whiteSpace: "pre-line" }}>
|
||||
{form.descripcion || "—"}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label style={{ display: "flex", alignItems: "flex-start", gap: 8, marginBottom: 12, fontSize: 12, color: "var(--color-text-secondary)", cursor: "pointer" }}>
|
||||
|
||||
Reference in New Issue
Block a user