diff --git a/BACKLOG.md b/BACKLOG.md index ca52892..72491ee 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -48,6 +48,16 @@ *(Sprint 3 y posteriores — ver ARCHITECTURE.md y BRIEF por sprint)* +### [BACKLOG-001] Consentimiento inicial editable desde admin +- **Estado:** hoy el texto del consentimiento está hardcoded en `consent-screen.tsx`. +- **Necesidad:** cuando se construya el motor de formularios (builder), el texto del + consentimiento debe ser editable por encuesta desde la administración, para reflejar + cambios en política de privacidad o ajustes específicos por tipo de relevamiento. +- **Bloquea:** implementación del builder visual. +- **Decisión cerrada:** la edición es desde admin, no desde el código. + +--- + - Dashboard / reportes (Sprint 3) - Formulario de consentimiento + persistencia de respuestas (Etapa 2B) - Builder visual de encuestas (post-validación del caso fijo) diff --git a/app/globals.css b/app/globals.css index 97ba1ca..84f9ff8 100644 --- a/app/globals.css +++ b/app/globals.css @@ -147,16 +147,6 @@ body { border-radius: 0 var(--radius) var(--radius) 0; color: var(--color-primary-hover); } -.section-sensitive-note { - font-size: 0.8125rem; - color: #92400e; - background: var(--color-sensitive); - border: 1px solid var(--color-sensitive-border); - border-radius: var(--radius); - padding: 8px 12px; - margin: 0; -} - /* ── Question wrapper ── */ .question-wrapper { background: var(--color-surface); @@ -183,6 +173,12 @@ body { line-height: 1.4; } .required-mark { color: var(--color-error); } +.q-code { + font-size: 0.78em; + font-weight: 700; + color: #7A8FA0; + letter-spacing: 0.02em; +} /* ── Options list ── */ .options-list { display: flex; flex-direction: column; gap: 8px; } diff --git a/components/question-renderer.tsx b/components/question-renderer.tsx index 65ce2f0..904211b 100644 --- a/components/question-renderer.tsx +++ b/components/question-renderer.tsx @@ -32,6 +32,7 @@ export function QuestionRenderer({ const error = errors[code] // A1 (Departamento) renders a combined geo widget that also handles A2 (Ciudad) + // Code badges for A1/A2 are rendered inside GeoSelectWidget. if (code === 'A1') { return ( {code} · {prompt} + if (type === 'single_choice' && isArrayOptions(options)) { return ( onChange(code, v)} @@ -107,7 +110,7 @@ export function QuestionRenderer({ return ( onChange(code, v)} diff --git a/components/survey-form.tsx b/components/survey-form.tsx index f3b3e42..50563b9 100644 --- a/components/survey-form.tsx +++ b/components/survey-form.tsx @@ -9,9 +9,9 @@ import { ProgressBar } from './progress-bar' import { QuestionRenderer } from './question-renderer' // Section metadata (code prefix → display title) -const SECTIONS: { prefix: string; title: string; sensitive?: boolean }[] = [ +const SECTIONS: { prefix: string; title: string }[] = [ { prefix: 'A', title: 'Datos Generales' }, - { prefix: '1', title: 'Prevalencia: cuidado y discapacidad', sensitive: true }, + { prefix: '1', title: 'Prevalencia: cuidado y discapacidad' }, { prefix: '2', title: 'Intensidad y rol del cuidado' }, { prefix: '3', title: 'Impacto económico del cuidado' }, { prefix: '4', title: 'Tiempo y descanso' }, @@ -190,13 +190,13 @@ export function SurveyForm({ survey, questions }: SurveyFormProps) { return v !== null && v !== undefined && v !== '' && !(Array.isArray(v) && v.length === 0) }).length - type Section = { prefix: string; title: string; sensitive?: boolean; questions: Question[] } + type Section = { prefix: string; title: string; questions: Question[] } const sectionMap = new Map() for (const q of visibleQuestions) { const prefix = getSectionPrefix(q.code) if (!sectionMap.has(prefix)) { const meta = SECTIONS.find((s) => s.prefix === prefix) - sectionMap.set(prefix, { prefix, title: meta?.title ?? prefix, sensitive: meta?.sensitive, questions: [] }) + sectionMap.set(prefix, { prefix, title: meta?.title ?? prefix, questions: [] }) } sectionMap.get(prefix)!.questions.push(q) } @@ -242,13 +242,7 @@ export function SurveyForm({ survey, questions }: SurveyFormProps) { aria-labelledby={`section-${section.prefix}`} >
-

{section.title}

- {section.sensitive && ( -

- Esta sección contiene preguntas sensibles sobre salud o discapacidad. - Responder es completamente voluntario. -

- )} +

Sección {section.prefix} · {section.title}

{section.questions.map((q) => (
diff --git a/components/widgets/checkbox-group.tsx b/components/widgets/checkbox-group.tsx index 3732876..9c3c7f7 100644 --- a/components/widgets/checkbox-group.tsx +++ b/components/widgets/checkbox-group.tsx @@ -1,9 +1,10 @@ 'use client' +import type { ReactNode } from 'react' import type { QuestionOption } from '@/lib/types' interface CheckboxGroupProps { name: string - legend: string + legend: ReactNode options: QuestionOption[] value: string[] maxSelect: number | null diff --git a/components/widgets/geo-select-widget.tsx b/components/widgets/geo-select-widget.tsx index d4d3141..7cd3568 100644 --- a/components/widgets/geo-select-widget.tsx +++ b/components/widgets/geo-select-widget.tsx @@ -31,7 +31,7 @@ export function GeoSelectWidget({ {/* Departamento */}