From 71777537e1acda086b21b2fa3cb6fc371b291709 Mon Sep 17 00:00:00 2001
From: alberto
Date: Tue, 1 Dec 2026 13:49:28 -0600
Subject: [PATCH] F1h: Gobernanza without Vista previa and Subir archivos,
button spacing
Keep preview state in Modelos and reset the toggle on domain changes. Hide the form while collapsed so the current selections, run monitor and result dialog survive toggling. Keep the existing evaluation and PDF handlers.
Use one wrapping button-row class with space-3 gaps and block margins. Inside table cells use the existing cell padding between rows. Apply the same class to the indicators export and keep the existing domain navigation bottom margin.
Delete the training upload UI and hand-edit the client and OpenAPI. Preserve the generator format and update the Modelos component spec and Gobernanza page case to cover both toggle states.
---
e2e/pages.spec.ts | 43 +--
openapi.json | 146 --------
src/app/api/fn/models/training-inputs.ts | 38 ---
.../api/fn/models/upload-training-inputs.ts | 43 ---
src/app/api/functions.ts | 4 -
src/app/api/models.ts | 1 -
.../api/models/body-upload-training-inputs.ts | 6 -
src/app/gobernanza/bundles.ts | 4 +-
src/app/gobernanza/execution.ts | 8 +-
src/app/gobernanza/gobernanza.html | 6 +-
src/app/gobernanza/gobernanza.scss | 3 -
src/app/gobernanza/gobernanza.ts | 15 +-
src/app/gobernanza/models.html | 152 +++++----
src/app/gobernanza/models.scss | 10 -
src/app/gobernanza/models.spec.ts | 31 +-
src/app/gobernanza/models.ts | 5 +-
src/app/gobernanza/run-monitor.ts | 18 +-
src/app/gobernanza/tea/preview.ts | 316 +++++++++---------
src/app/gobernanza/tea/studies.html | 2 +-
src/app/gobernanza/training.ts | 134 +-------
src/app/indicadores/indicadores.ts | 2 +-
src/styles.scss | 11 +
22 files changed, 349 insertions(+), 649 deletions(-)
delete mode 100644 src/app/api/fn/models/training-inputs.ts
delete mode 100644 src/app/api/fn/models/upload-training-inputs.ts
delete mode 100644 src/app/api/models/body-upload-training-inputs.ts
diff --git a/e2e/pages.spec.ts b/e2e/pages.spec.ts
index d638cfd..e44a3bf 100644
--- a/e2e/pages.spec.ts
+++ b/e2e/pages.spec.ts
@@ -149,16 +149,11 @@ test('tea gobernanza: every section in sync mode, and the preview saved as PDF',
'Ejecución',
'Modelos',
'Entrenamiento',
- 'Subir archivos',
'Bundles',
'Estudios EEG',
]);
- await expect(page.locator('app-eeg-preview')).toHaveCount(0);
+ await expect(page.getByRole('heading', { name: 'Subir archivos', exact: true })).toHaveCount(0);
await expect(page.getByText('Archivos de entrenamiento', { exact: true })).toHaveCount(0);
- const uploads = page.getByRole('region', { name: 'Subir archivos' });
- await expect(uploads.getByLabel('Conjunto')).toBeVisible();
- await expect(uploads.getByRole('button', { name: 'Archivos', exact: true })).toBeVisible();
- await expect(uploads.getByRole('button', { name: 'Subir archivos' })).toBeDisabled();
await page.getByRole('combobox', { name: 'Modo' }).click();
await page.getByRole('option', { name: 'Sync' }).click();
await expect(page.getByRole('status').filter({ hasText: 'Disponible' })).toBeVisible();
@@ -205,14 +200,28 @@ test('tea gobernanza: every section in sync mode, and the preview saved as PDF',
{ timeout: 10 * 60_000 },
);
- await page
- .locator('app-governance-models')
- .getByRole('button', {
- name: 'Evaluar un solo estudio',
- })
- .click();
- const preview = page.locator('app-eeg-preview');
- await expect(preview.getByRole('heading', { name: 'Vista previa' })).toBeVisible();
+ const models = page.getByRole('region', { name: 'Modelos' });
+ const toggle = models.getByRole('button', { name: 'Evaluar un solo estudio' });
+ const preview = models.locator('.button-row + app-eeg-preview');
+ const edf = preview.getByRole('button', { name: 'EDF', exact: true });
+ const ados = preview.getByRole('button', { name: 'ADOS-2 (PDF)', exact: true });
+ const birth = preview.getByLabel('Fecha de nacimiento');
+ await expect(toggle).toHaveAttribute('aria-pressed', 'false');
+ await expect(edf).toBeHidden();
+ await expect(ados).toBeHidden();
+ await expect(birth).toBeHidden();
+ await toggle.click();
+ await expect(toggle).toHaveAttribute('aria-pressed', 'true');
+ await expect(page.getByRole('heading', { name: 'Vista previa', exact: true })).toHaveCount(0);
+ await expect(edf).toBeVisible();
+ await expect(ados).toBeVisible();
+ await expect(birth).toBeVisible();
+ await toggle.click();
+ await expect(toggle).toHaveAttribute('aria-pressed', 'false');
+ await expect(edf).toBeHidden();
+ await expect(ados).toBeHidden();
+ await expect(birth).toBeHidden();
+ await toggle.click();
await preview.getByLabel('EDF').setInputFiles(process.env['TEA_EDF']!);
await preview.getByLabel('ADOS-2 (PDF)').setInputFiles(process.env['TEA_ADOS2']!);
await preview.getByLabel('Fecha de nacimiento').fill(process.env['TEA_BIRTH']!);
@@ -306,9 +315,5 @@ test('cacu gobernanza: the shared sections only, none of the TEA ones', async ({
const nav = page.getByRole('navigation', { name: 'Dominios' });
await expect(nav.getByRole('link', { name: 'Cáncer de mama' })).toBeVisible();
await expect(nav.getByRole('link', { name: 'Trastorno del espectro autista' })).toBeVisible();
- expect(
- problems.filter(
- (p) => !p.endsWith('/models/cacu/all/inputs') && !p.startsWith('console: Failed to load'),
- ),
- ).toEqual([]);
+ expect(problems.filter((p) => !p.startsWith('console: Failed to load'))).toEqual([]);
});
diff --git a/openapi.json b/openapi.json
index ae92b0c..77b49fc 100644
--- a/openapi.json
+++ b/openapi.json
@@ -255,24 +255,6 @@
"title": "Body_upload",
"type": "object"
},
- "Body_upload_training_inputs": {
- "properties": {
- "files": {
- "items": {
- "format": "binary",
- "type": "string"
- },
- "minItems": 1,
- "title": "Files",
- "type": "array"
- }
- },
- "required": [
- "files"
- ],
- "title": "Body_upload_training_inputs",
- "type": "object"
- },
"Browsed": {
"properties": {
"entries": {
@@ -5121,134 +5103,6 @@
]
}
},
- "/models/{domain}/{name}/inputs": {
- "get": {
- "operationId": "training_inputs",
- "parameters": [
- {
- "in": "path",
- "name": "domain",
- "required": true,
- "schema": {
- "$ref": "#/components/schemas/Domain"
- }
- },
- {
- "in": "path",
- "name": "name",
- "required": true,
- "schema": {
- "title": "Name",
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "additionalProperties": {
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "title": "Response Training Inputs",
- "type": "object"
- }
- }
- },
- "description": "Successful Response"
- },
- "422": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- "description": "Validation Error"
- }
- },
- "summary": "Training Inputs",
- "tags": [
- "models"
- ]
- }
- },
- "/models/{domain}/{name}/inputs/{set}/files": {
- "post": {
- "operationId": "upload_training_inputs",
- "parameters": [
- {
- "in": "path",
- "name": "domain",
- "required": true,
- "schema": {
- "$ref": "#/components/schemas/Domain"
- }
- },
- {
- "in": "path",
- "name": "name",
- "required": true,
- "schema": {
- "title": "Name",
- "type": "string"
- }
- },
- {
- "in": "path",
- "name": "set",
- "required": true,
- "schema": {
- "title": "Set",
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "schema": {
- "$ref": "#/components/schemas/Body_upload_training_inputs"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Upload Training Inputs",
- "type": "object"
- }
- }
- },
- "description": "Successful Response"
- },
- "422": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- "description": "Validation Error"
- }
- },
- "summary": "Upload Training Inputs",
- "tags": [
- "models"
- ]
- }
- },
"/models/{domain}/{name}/training-config": {
"get": {
"operationId": "training_config",
diff --git a/src/app/api/fn/models/training-inputs.ts b/src/app/api/fn/models/training-inputs.ts
deleted file mode 100644
index b27ecf2..0000000
--- a/src/app/api/fn/models/training-inputs.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/* eslint-disable */
-/* Code generated by ng-openapi-gen DO NOT EDIT. */
-
-import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
-import { Observable } from 'rxjs';
-import { filter, map } from 'rxjs/operators';
-import { StrictHttpResponse } from '../../strict-http-response';
-import { RequestBuilder } from '../../request-builder';
-
-import { Domain } from '../../models/domain';
-
-export interface TrainingInputs$Params {
- domain: Domain;
- name: string;
-}
-
-export function trainingInputs(http: HttpClient, rootUrl: string, params: TrainingInputs$Params, context?: HttpContext): Observable;
-}>> {
- const rb = new RequestBuilder(rootUrl, trainingInputs.PATH, 'get');
- if (params) {
- rb.path('domain', params.domain, {});
- rb.path('name', params.name, {});
- }
-
- return http.request(
- rb.build({ responseType: 'json', accept: 'application/json', context })
- ).pipe(
- filter((r: any): r is HttpResponse => r instanceof HttpResponse),
- map((r: HttpResponse) => {
- return r as StrictHttpResponse<{
- [key: string]: Array;
- }>;
- })
- );
-}
-
-trainingInputs.PATH = '/models/{domain}/{name}/inputs';
diff --git a/src/app/api/fn/models/upload-training-inputs.ts b/src/app/api/fn/models/upload-training-inputs.ts
deleted file mode 100644
index c483dcc..0000000
--- a/src/app/api/fn/models/upload-training-inputs.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/* eslint-disable */
-/* Code generated by ng-openapi-gen DO NOT EDIT. */
-
-import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
-import { Observable } from 'rxjs';
-import { filter, map } from 'rxjs/operators';
-import { StrictHttpResponse } from '../../strict-http-response';
-import { RequestBuilder } from '../../request-builder';
-
-import { BodyUploadTrainingInputs } from '../../models/body-upload-training-inputs';
-import { Domain } from '../../models/domain';
-
-export interface UploadTrainingInputs$Params {
- domain: Domain;
- name: string;
- set: string;
- body: BodyUploadTrainingInputs
-}
-
-export function uploadTrainingInputs(http: HttpClient, rootUrl: string, params: UploadTrainingInputs$Params, context?: HttpContext): Observable> {
- const rb = new RequestBuilder(rootUrl, uploadTrainingInputs.PATH, 'post');
- if (params) {
- rb.path('domain', params.domain, {});
- rb.path('name', params.name, {});
- rb.path('set', params.set, {});
- rb.body(params.body, 'multipart/form-data');
- }
-
- return http.request(
- rb.build({ responseType: 'json', accept: 'application/json', context })
- ).pipe(
- filter((r: any): r is HttpResponse => r instanceof HttpResponse),
- map((r: HttpResponse) => {
- return r as StrictHttpResponse<{
- [key: string]: any;
- }>;
- })
- );
-}
-
-uploadTrainingInputs.PATH = '/models/{domain}/{name}/inputs/{set}/files';
diff --git a/src/app/api/functions.ts b/src/app/api/functions.ts
index d416e2c..d3d4ba4 100644
--- a/src/app/api/functions.ts
+++ b/src/app/api/functions.ts
@@ -53,10 +53,6 @@ export type { Score$Params as Score$Params } from './fn/models/score';
export { score as score } from './fn/models/score';
export type { Train$Params as Train$Params } from './fn/models/train';
export { train as train } from './fn/models/train';
-export type { TrainingInputs$Params as TrainingInputs$Params } from './fn/models/training-inputs';
-export { trainingInputs as trainingInputs } from './fn/models/training-inputs';
-export type { UploadTrainingInputs$Params as UploadTrainingInputs$Params } from './fn/models/upload-training-inputs';
-export { uploadTrainingInputs as uploadTrainingInputs } from './fn/models/upload-training-inputs';
export type { TrainingConfig$Params as TrainingConfig$Params } from './fn/models/training-config';
export { trainingConfig as trainingConfig } from './fn/models/training-config';
export type { Versions$Params as Versions$Params } from './fn/models/versions';
diff --git a/src/app/api/models.ts b/src/app/api/models.ts
index a68d2c9..eb26067 100644
--- a/src/app/api/models.ts
+++ b/src/app/api/models.ts
@@ -9,7 +9,6 @@ export type { BodyAddClinicalValidation } from './models/body-add-clinical-valid
export type { BodyImportModels } from './models/body-import-models';
export type { BodyStartPreview } from './models/body-start-preview';
export type { BodyUpload } from './models/body-upload';
-export type { BodyUploadTrainingInputs } from './models/body-upload-training-inputs';
export type { Browsed } from './models/browsed';
export type { Cancel } from './models/cancel';
export type { Catalog } from './models/catalog';
diff --git a/src/app/api/models/body-upload-training-inputs.ts b/src/app/api/models/body-upload-training-inputs.ts
deleted file mode 100644
index 56fd3a3..0000000
--- a/src/app/api/models/body-upload-training-inputs.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-/* eslint-disable */
-/* Code generated by ng-openapi-gen DO NOT EDIT. */
-
-export interface BodyUploadTrainingInputs {
- files: Array;
-}
diff --git a/src/app/gobernanza/bundles.ts b/src/app/gobernanza/bundles.ts
index 9e3726f..97415da 100644
--- a/src/app/gobernanza/bundles.ts
+++ b/src/app/gobernanza/bundles.ts
@@ -44,7 +44,7 @@ export async function exportErrorText(error: unknown): Promise {
template: `
}
-