feat: implement 8 features across full stack
- Leaderboard: rank-based percentile tiers (champion/gold/silver/bronze),
deterministic tie-breaking (xp DESC, user_id ASC)
- Mentor chat: md: breakpoints, safe-area-inset-bottom padding
- Learning progress: server-side progressPct, curriculum expansion safety
- Physical orders: hard-disabled with 410 Gone
- Certificate approval: pending/issued flow, admin issue/revoke endpoints,
certificate_requires_approval setting (migration 0031)
- Draft/publish: is_published on lessons and chapters, admin publish UI
(migration 0030)
- Video panel: static thumbnails (no preload), client-side pagination
- Rich editor: TipTap + tiptap-markdown for lesson descriptions,
marked + DOMPurify for SafeMarkdown rendering
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
-- Add draft/published state to chapters and lessons.
|
||||
-- Existing content is published immediately so nothing goes dark on deploy.
|
||||
-- New lessons created via the admin API default to is_published = false (draft).
|
||||
|
||||
ALTER TABLE lessons ADD COLUMN IF NOT EXISTS is_published BOOLEAN NOT NULL DEFAULT false;
|
||||
ALTER TABLE chapters ADD COLUMN IF NOT EXISTS is_published BOOLEAN NOT NULL DEFAULT false;
|
||||
|
||||
UPDATE lessons SET is_published = true;
|
||||
UPDATE chapters SET is_published = true;
|
||||
@@ -0,0 +1,13 @@
|
||||
-- Add manual approval flow for certificates.
|
||||
-- Existing certs keep status='issued'. New completions create status='pending'
|
||||
-- until an admin or mentor explicitly issues the certificate.
|
||||
|
||||
ALTER TABLE certificates ADD COLUMN IF NOT EXISTS status TEXT NOT NULL DEFAULT 'issued';
|
||||
ALTER TABLE certificates ALTER COLUMN public_id DROP NOT NULL;
|
||||
|
||||
UPDATE certificates SET status = 'issued';
|
||||
|
||||
INSERT INTO app_settings (key, value) VALUES
|
||||
('certificate_enabled', 'true'),
|
||||
('certificate_requires_approval', 'true')
|
||||
ON CONFLICT (key) DO NOTHING;
|
||||
Reference in New Issue
Block a user