From 26796290a20cd5635554183e31eb6d9e7572c424 Mon Sep 17 00:00:00 2001 From: Sidney Date: Thu, 28 May 2026 09:05:45 -0300 Subject: [PATCH] feat: change pre-enrollment custom slug format to use single slash with pre-matricula- prefix --- manager/components/PreMatricula.tsx | 20 ++++++++++++-------- manager/server.selfhosted.js | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/manager/components/PreMatricula.tsx b/manager/components/PreMatricula.tsx index 9b0a1da..2ce51c5 100644 --- a/manager/components/PreMatricula.tsx +++ b/manager/components/PreMatricula.tsx @@ -145,9 +145,7 @@ const PreMatricula: React.FC = ({ data, onConvert }) => { const copyLink = () => { if (!config) return; - const url = config.slug === 'pre-matricula' - ? `${window.location.origin}/pre-matricula` - : `${window.location.origin}/pre-matricula/${config.slug}`; + const url = `${window.location.origin}/${config.slug}`; navigator.clipboard.writeText(url); setCopied(true); setTimeout(() => setCopied(false), 2000); @@ -229,11 +227,17 @@ const PreMatricula: React.FC = ({ data, onConvert }) => { value={config?.descricao || ''} onChange={e => setConfig(prev => prev ? { ...prev, descricao: e.target.value } : prev)} />
- +
- /pre-matricula/ + /pre-matricula- setConfig(prev => prev ? { ...prev, slug: e.target.value.replace(/[^a-z0-9-]/g, '') } : prev)} /> + value={config?.slug ? config.slug.replace(/^pre-matricula-?/, '') : ''} + onChange={e => { + const val = e.target.value.replace(/[^a-z0-9-]/g, ''); + const newSlug = val ? `pre-matricula-${val}` : 'pre-matricula'; + setConfig(prev => prev ? { ...prev, slug: newSlug } : prev); + }} + />
@@ -289,9 +293,9 @@ const PreMatricula: React.FC = ({ data, onConvert }) => {