From b97a15544c95883d697129bd1fb98029e4b28a2a Mon Sep 17 00:00:00 2001 From: Sidney Date: Thu, 28 May 2026 09:35:54 -0300 Subject: [PATCH] feat: add dynamic field toggles, phone/cpf/cep input masks, and auto-textarea promotion for observations in public pre-matricula --- manager/components/PreMatricula.tsx | 24 +++++++ .../update_prematricula_config_table.cjs | 13 +++- manager/server.selfhosted.js | 65 ++++++++++++++++--- manager/types.ts | 2 + 4 files changed, 92 insertions(+), 12 deletions(-) diff --git a/manager/components/PreMatricula.tsx b/manager/components/PreMatricula.tsx index 1acf160..24ee544 100644 --- a/manager/components/PreMatricula.tsx +++ b/manager/components/PreMatricula.tsx @@ -244,6 +244,30 @@ const PreMatricula: React.FC = ({ data, onConvert }) => { {config?.corPrimaria} +
+ +
+ + +
+

Nome Completo é sempre obrigatório para identificar o interessado.

+
diff --git a/manager/scratch/update_prematricula_config_table.cjs b/manager/scratch/update_prematricula_config_table.cjs index 65dca66..1d2afdf 100644 --- a/manager/scratch/update_prematricula_config_table.cjs +++ b/manager/scratch/update_prematricula_config_table.cjs @@ -9,11 +9,18 @@ async function run() { try { await client.query(` ALTER TABLE prematricula_config - ADD COLUMN IF NOT EXISTS turmas_permitidas TEXT[] DEFAULT '{}'; + ADD COLUMN IF NOT EXISTS exibir_email BOOLEAN DEFAULT TRUE; + + ALTER TABLE prematricula_config + ADD COLUMN IF NOT EXISTS exibir_telefone BOOLEAN DEFAULT TRUE; + + UPDATE prematricula_config + SET exibir_email = TRUE, exibir_telefone = TRUE + WHERE exibir_email IS NULL OR exibir_telefone IS NULL; `); - console.log('✅ Coluna turmas_permitidas adicionada com sucesso!'); + console.log('✅ Colunas exibir_email e exibir_telefone adicionadas com sucesso!'); } catch (e) { - console.error('❌ Erro ao adicionar coluna:', e.message); + console.error('❌ Erro ao adicionar colunas:', e.message); } finally { client.release(); await pool.end(); diff --git a/manager/server.selfhosted.js b/manager/server.selfhosted.js index 714bb13..c7ca654 100644 --- a/manager/server.selfhosted.js +++ b/manager/server.selfhosted.js @@ -108,6 +108,38 @@ body{font-family:'Inter',sans-serif;background:#f8fafc;min-height:100vh;display: