fix: auto-prefill webhook URL, prevent navbar text clipping for Meu Certificado, and expand evaluation button text with module name
Build and Deploy (Gitea) / build-and-deploy (push) Successful in 49s Details

This commit is contained in:
Sidney Gomes 2026-07-20 21:29:55 -03:00
parent c4af3c053b
commit ac24b3a2e6
4 changed files with 22 additions and 16 deletions

View File

@ -615,12 +615,14 @@ app.post('/api/admin/students/:id/status', authenticateToken, requireAdmin, (req
// Admin System Settings
app.get('/api/admin/settings', authenticateToken, requireAdmin, (req: AuthenticatedRequest, res: Response) => {
const db = loadDb();
res.json(db.settings || {
trialDurationDays: 7,
asaasEnvironment: 'sandbox',
asaasApiKey: '',
asaasWebhookUrl: '',
asaasWebhookSecret: ''
const settings = db.settings || {};
res.json({
trialDurationDays: settings.trialDurationDays || 7,
asaasEnvironment: settings.asaasEnvironment || 'sandbox',
asaasApiKey: settings.asaasApiKey || '',
asaasWebhookUrl: settings.asaasWebhookUrl || 'https://admin-estudo.microtecinformaticacurso.com.br/api/webhooks/asaas',
asaasWebhookSecret: settings.asaasWebhookSecret || 'devflix_webhook_secret_key',
helpText: settings.helpText || ''
});
});

View File

@ -88,7 +88,11 @@ export default function AdminDashboard({ token }: AdminDashboardProps) {
});
if (res.ok) {
const data = await res.json();
setSettings(data);
const autoWebhookUrl = data.asaasWebhookUrl || `${window.location.origin}/api/webhooks/asaas`;
setSettings({
...data,
asaasWebhookUrl: autoWebhookUrl
});
}
} catch (err) {
console.error('Error fetching settings:', err);

View File

@ -391,10 +391,10 @@ export default function CourseView({ courseId, token, onBack }: CourseViewProps)
<div className="p-3 border-t border-white/5 bg-black/20">
<button
onClick={() => setActiveActivityModuleId(mod.id)}
className="w-full flex items-center justify-center space-x-2 bg-zinc-800 hover:bg-[#E50914] hover:text-white text-zinc-300 transition-colors py-2.5 rounded-lg text-xs font-bold uppercase tracking-wider group"
className="w-full flex items-center justify-center space-x-2 glass-btn-primary hover:scale-[1.02] text-white transition-all py-2.5 px-3 rounded-lg text-xs font-extrabold uppercase tracking-wider cursor-pointer shadow-md group"
>
<Award className="w-4 h-4 text-[#E50914] group-hover:text-white transition-colors" />
<span>Avaliação do Módulo</span>
<Award className="w-4 h-4 text-white flex-shrink-0" />
<span className="truncate">Avaliação do Módulo {modIdx + 1}: {mod.title}</span>
</button>
</div>
)}

View File

@ -115,25 +115,25 @@ export default function Navbar({ user, activeView, setView, onLogout }: NavbarPr
</div>
{/* NAVIGATION LINKS */}
<div className="hidden md:flex items-center space-x-6 text-sm">
<div className="hidden md:flex items-center space-x-3 lg:space-x-6 text-sm flex-shrink-0">
<button
onClick={() => setView('home')}
className={`font-medium transition-colors hover:text-[#E50914] ${activeView === 'home' || activeView === 'course-view' ? 'text-white' : 'text-zinc-400'}`}
className={`font-semibold transition-colors hover:text-[#E50914] whitespace-nowrap flex-shrink-0 ${activeView === 'home' || activeView === 'course-view' ? 'text-white' : 'text-zinc-400'}`}
>
Cursos
</button>
<button
onClick={() => setView('subscription')}
className={`font-medium transition-colors hover:text-[#E50914] flex items-center space-x-1 whitespace-nowrap ${activeView === 'subscription' ? 'text-white' : 'text-zinc-400'}`}
className={`font-semibold transition-colors hover:text-[#E50914] flex items-center space-x-1.5 whitespace-nowrap flex-shrink-0 ${activeView === 'subscription' ? 'text-white' : 'text-zinc-400'}`}
>
<DollarSign className="w-4 h-4" />
<DollarSign className="w-4 h-4 text-[#E50914]" />
<span>Minha Assinatura</span>
</button>
<button
onClick={() => setView('certificates')}
className={`font-medium transition-colors hover:text-[#E50914] flex items-center space-x-1 whitespace-nowrap ${activeView === 'certificates' ? 'text-white' : 'text-zinc-400'}`}
className={`font-semibold transition-colors hover:text-[#E50914] flex items-center space-x-1.5 whitespace-nowrap flex-shrink-0 ${activeView === 'certificates' ? 'text-white' : 'text-zinc-400'}`}
>
<GraduationCap className="w-4 h-4" />
<GraduationCap className="w-4 h-4 text-[#E50914]" />
<span>Meu Certificado</span>
</button>
</div>