feat: add PluginBlock component for rendering external web components in sandboxed iframes

feat: implement PluginsPage for managing plugins with create, toggle, and delete functionalities

feat: create PedagogicalAnalyticsPage for displaying course analytics including quality metrics, discrimination index, and curricular suggestions

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-27 12:22:05 -04:00
parent 675fa1e299
commit f6a3f6aedf
23 changed files with 2580 additions and 24 deletions
@@ -0,0 +1,11 @@
CREATE TABLE IF NOT EXISTS lesson_collaborative_canvases (
lesson_id UUID PRIMARY KEY REFERENCES lessons(id) ON DELETE CASCADE,
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
canvas_state JSONB NOT NULL DEFAULT '{}'::jsonb,
updated_by UUID REFERENCES users(id) ON DELETE SET NULL,
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_lesson_collaborative_canvases_org_id
ON lesson_collaborative_canvases (organization_id);
@@ -0,0 +1,2 @@
ALTER TABLE lesson_collaborative_canvases
ADD COLUMN IF NOT EXISTS revision BIGINT NOT NULL DEFAULT 0;
@@ -0,0 +1,30 @@
-- Fase 35: Ecosistema de Plugins
-- Tabla de plugins registrados por organización
CREATE TABLE IF NOT EXISTS org_plugins (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
organization_id UUID NOT NULL,
name TEXT NOT NULL,
description TEXT NOT NULL DEFAULT '',
component_url TEXT NOT NULL,
icon_url TEXT,
config JSONB NOT NULL DEFAULT '{}',
enabled BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_org_plugins_org_id ON org_plugins(organization_id);
-- Trigger para updated_at automático
CREATE OR REPLACE FUNCTION update_org_plugins_updated_at()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER trg_org_plugins_updated_at
BEFORE UPDATE ON org_plugins
FOR EACH ROW EXECUTE FUNCTION update_org_plugins_updated_at();