feat(plugins): soporte de tooltipFields y desacoplamiento total en PluginService (v1.24.5)
parent
5257e9e63e
commit
8073408560
|
|
@ -2,9 +2,14 @@
|
|||
|
||||
## [1.24.5] - 2026-10-30
|
||||
|
||||
### Added
|
||||
- **Soporte Genérico de Tooltips Dinámicos (`PluginBadgeRule.tooltipFields`)**:
|
||||
- Incorporada la especificación declarativa `tooltipFields` en `PluginBadgeRule`, permitiendo a cualquier plugin declarar en su propio manifiesto qué campos de metadatos deben anexarse al tooltip (con `prefix` y `suffix` opcionales).
|
||||
|
||||
### Removed
|
||||
- **Eliminación Total de Sondeo Periódico (`GroupsComponent`)**:
|
||||
- Retirado el temporizador `interval(30000)` en `GroupsComponent`. La arquitectura se mantiene 100% reactiva exclusivamente mediante los eventos push de Mercure (SSE), evitando cualquier sobrecarga innecesaria en el servidor.
|
||||
- **Desacoplamiento Total de Plugins en `PluginService`**:
|
||||
- Eliminado todo código ad-hoc y variables específicas de dominio (`dni`, `remaining_minutes`, `student`, `user`, etc.) del motor genérico de `PluginService`. `oggui` pasa a ser 100% agnóstico e independiente de los plugins instalados.
|
||||
- Retirado el temporizador `interval(30000)` en `GroupsComponent`. La arquitectura se mantiene 100% reactiva exclusivamente mediante los eventos push de Mercure (SSE).
|
||||
|
||||
## [1.24.4] - 2026-10-30
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ export interface RoleDefinition {
|
|||
shortCode?: string;// Código corto usado en frontend (ej: 'super-admin')
|
||||
}
|
||||
|
||||
export interface PluginBadgeField {
|
||||
key: string;
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
}
|
||||
|
||||
export interface PluginBadgeRule {
|
||||
status: string;
|
||||
type: string;
|
||||
|
|
@ -45,6 +51,7 @@ export interface PluginBadgeRule {
|
|||
labelKey?: string;
|
||||
tooltip: string;
|
||||
tooltipKey?: string;
|
||||
tooltipFields?: PluginBadgeField[];
|
||||
}
|
||||
|
||||
export interface PluginBadge {
|
||||
|
|
@ -716,19 +723,19 @@ export class PluginService {
|
|||
}
|
||||
}
|
||||
|
||||
// Enriquecer tooltip con metadatos contextuales si están disponibles (p. ej. DNI del alumno, tiempo restante)
|
||||
// Enriquecer tooltip con metadatos contextuales si el badge declara tooltipFields
|
||||
const meta = (idKey ? this.getPluginMetadata(plugin.name, idKey) : null)
|
||||
|| (uuidKey ? this.getPluginMetadata(plugin.name, uuidKey) : null);
|
||||
|
||||
if (meta) {
|
||||
const dni = meta.dni || meta.user || meta.student;
|
||||
const mins = meta.remaining_minutes ?? meta.remainingMinutes;
|
||||
if (matchingBadge.tooltipFields && matchingBadge.tooltipFields.length > 0 && meta) {
|
||||
const infoParts: string[] = [];
|
||||
if (dni) {
|
||||
infoParts.push(`DNI: ${dni}`);
|
||||
}
|
||||
if (mins !== undefined && mins !== null && mins !== '') {
|
||||
infoParts.push(`${mins} min`);
|
||||
for (const field of matchingBadge.tooltipFields) {
|
||||
const val = meta[field.key];
|
||||
if (val !== undefined && val !== null && val !== '') {
|
||||
const prefix = field.prefix || '';
|
||||
const suffix = field.suffix || '';
|
||||
infoParts.push(`${prefix}${val}${suffix}`);
|
||||
}
|
||||
}
|
||||
if (infoParts.length > 0) {
|
||||
const detailStr = infoParts.join(' · ');
|
||||
|
|
|
|||
Loading…
Reference in New Issue