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
Build and Deploy (Gitea) / build-and-deploy (push) Successful in 49s
Details
This commit is contained in:
parent
c4af3c053b
commit
ac24b3a2e6
14
server.ts
14
server.ts
|
|
@ -615,12 +615,14 @@ app.post('/api/admin/students/:id/status', authenticateToken, requireAdmin, (req
|
||||||
// Admin System Settings
|
// Admin System Settings
|
||||||
app.get('/api/admin/settings', authenticateToken, requireAdmin, (req: AuthenticatedRequest, res: Response) => {
|
app.get('/api/admin/settings', authenticateToken, requireAdmin, (req: AuthenticatedRequest, res: Response) => {
|
||||||
const db = loadDb();
|
const db = loadDb();
|
||||||
res.json(db.settings || {
|
const settings = db.settings || {};
|
||||||
trialDurationDays: 7,
|
res.json({
|
||||||
asaasEnvironment: 'sandbox',
|
trialDurationDays: settings.trialDurationDays || 7,
|
||||||
asaasApiKey: '',
|
asaasEnvironment: settings.asaasEnvironment || 'sandbox',
|
||||||
asaasWebhookUrl: '',
|
asaasApiKey: settings.asaasApiKey || '',
|
||||||
asaasWebhookSecret: ''
|
asaasWebhookUrl: settings.asaasWebhookUrl || 'https://admin-estudo.microtecinformaticacurso.com.br/api/webhooks/asaas',
|
||||||
|
asaasWebhookSecret: settings.asaasWebhookSecret || 'devflix_webhook_secret_key',
|
||||||
|
helpText: settings.helpText || ''
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,11 @@ export default function AdminDashboard({ token }: AdminDashboardProps) {
|
||||||
});
|
});
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
setSettings(data);
|
const autoWebhookUrl = data.asaasWebhookUrl || `${window.location.origin}/api/webhooks/asaas`;
|
||||||
|
setSettings({
|
||||||
|
...data,
|
||||||
|
asaasWebhookUrl: autoWebhookUrl
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error fetching settings:', err);
|
console.error('Error fetching settings:', err);
|
||||||
|
|
|
||||||
|
|
@ -391,10 +391,10 @@ export default function CourseView({ courseId, token, onBack }: CourseViewProps)
|
||||||
<div className="p-3 border-t border-white/5 bg-black/20">
|
<div className="p-3 border-t border-white/5 bg-black/20">
|
||||||
<button
|
<button
|
||||||
onClick={() => setActiveActivityModuleId(mod.id)}
|
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" />
|
<Award className="w-4 h-4 text-white flex-shrink-0" />
|
||||||
<span>Avaliação do Módulo</span>
|
<span className="truncate">Avaliação do Módulo {modIdx + 1}: {mod.title}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -115,25 +115,25 @@ export default function Navbar({ user, activeView, setView, onLogout }: NavbarPr
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* NAVIGATION LINKS */}
|
{/* 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
|
<button
|
||||||
onClick={() => setView('home')}
|
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
|
Cursos
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => setView('subscription')}
|
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>
|
<span>Minha Assinatura</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => setView('certificates')}
|
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>
|
<span>Meu Certificado</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue