Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ Seed sample data from `hub-backend` (Postgres must be up and migrated):
Setup y comandos exactos (BD de test, `DATABASE_URL`, Playwright) en
[BUILD.md](BUILD.md#tests).

## Commit messages — Conventional Commits (required)
## Commit messages — Conventional Commits in Spanish (required)

Every commit must follow [Conventional Commits](https://www.conventionalcommits.org):

```
<type>(<optional scope>): <description>
<type>(<optional scope>): <descripción>
```

**Allowed types**
Expand All @@ -107,22 +107,27 @@ Every commit must follow [Conventional Commits](https://www.conventionalcommits.

**Rules**

- **Write commit subjects and bodies in Spanish.** The conventional `type` and
`scope` tokens stay in English, but the description and the body are Spanish.
- Description in the imperative mood, lowercase, no trailing period:
`feat(projects): add privacy flag to project detail`.
`feat(projects): agregar indicador de privacidad al detalle del proyecto`.
- Keep the subject under ~72 characters; put the "why" in the body if needed.
- Reference issues in the body (`Refs #92`), not in the subject.
- Breaking changes: add `!` after the type/scope and explain in a
`BREAKING CHANGE:` footer, e.g. `refactor(auth)!: drop legacy session cookie`.
`BREAKING CHANGE:` footer, e.g.
`refactor(auth)!: eliminar la cookie de sesión heredada`. Keep the
`BREAKING CHANGE:` keyword and write its explanation in Spanish.
- One logical change per commit; don't mix a refactor with a feature.
- PR titles should follow the same convention, since merges keep the history.
- **PR titles and descriptions are also written in Spanish.** Titles follow the
same Conventional Commits convention, since merges keep the history.

Examples:

```
feat(frontend): open every module with ModuleHeader
fix(backend): return 404 for private projects to non-members
refactor(prisma): extract project visibility into AuthorizationService
docs: document the UTB design system
feat(frontend): abrir cada módulo con ModuleHeader
fix(backend): responder 404 para proyectos privados a no miembros
refactor(prisma): extraer la visibilidad de proyectos a AuthorizationService
docs: documentar el sistema de diseño UTB
```

## General guidelines
Expand Down
3 changes: 1 addition & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ las dos suites (supertest y Playwright).
- `prisma/fixtures/milestones.json` y `observations.json`: indexados por el
nombre del proyecto.
- `prisma/fixtures/attachments/`: archivos de ejemplo que se suben a
RustFS. Las portadas `portada-*.jpg` acompañan a los proyectos finalizados;
por convención, la primera imagen de un proyecto es su portada.
RustFS.
- El historial de estados reparte las transiciones entre la fecha de inicio y
la de fin (o "hoy" si el proyecto sigue activo), de modo que los proyectos
cerrados quedan con una cronología coherente.
Expand Down
8 changes: 5 additions & 3 deletions docs/backend_arch.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,11 @@ mostrados, y si es inválido se responde `401` en lugar de degradar a anónimo.
estudiantes ven además los privados en `approved` en modo de vista previa.
- `assertProjectMember` (usado por observaciones, hitos, anexos y entregas) es
de miembros: proponente, actores asignados y roles revisores. Los proyectos
públicos solo exponen su información base en el listado y el detalle. La vista
previa de un privado expone aún menos: nombre, estado, fase, fuente, ubicación,
descripción, requisitos de equipo y resultados esperados.
públicos exponen su información base en el listado y el detalle, incluida la
descripción y el nombre del proponente; el correo, la cédula, el equipo y los
anexos quedan reservados a los miembros. La vista previa de un privado expone
aún menos: nombre, estado, fase, fuente, ubicación, descripción, requisitos de
equipo y resultados esperados.
- `canExpressInterest` exige rol global `student`, proyecto `approved`, y que el
solicitante no sea el proponente ni un actor asignado. El interés duplicado y
el estado se validan en `ProjectsService`.
3 changes: 2 additions & 1 deletion docs/frontend_arch.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Ver también: [Arquitectura del backend](./backend_arch.md),
- `app/api/` — route handlers que actúan como BFF/proxy hacia el backend.
- `app/services/` — acceso a datos y sesión.
- `app/components/` — componentes propios (shell, sidebar, navbar, auth,
formularios).
formularios y controles compartidos de listados).
- `components/ui/` — componentes base de shadcn/ui.
- `lib/utils.ts` — utilidades (por ejemplo `cn`).
- `lib/download.ts` — descarga de respuestas binarias y lectura de `Content-Disposition`.
Expand All @@ -29,6 +29,7 @@ Ver también: [Arquitectura del backend](./backend_arch.md),
| Ruta | Pantalla |
| --- | --- |
| `/` | Landing pública, sin sidebar ni topbar. |
| `/gallery` | Galería pública de proyectos finalizados y no privados (`GET /projects` sin sesión), con búsqueda, filtros de fuente y año en la barra, orden y paginación en cliente; topbar de marca y sin sidebar. |
| `/home` | Inicio interno (requiere sesión): proyectos propios y asignados del usuario. |
| `/login` | Inicio de sesión. |
| `/register` | Registro de proponentes (auto-login). |
Expand Down
10 changes: 8 additions & 2 deletions docs/frontend_design_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ izquierda y un **topbar** claro (`bg-card`) sticky sobre el contenido.
dropdown de perfil conserva **Mi perfil** y **Cerrar sesión**.
- En login y registro no hay sidebar: el topbar recupera la marca estática a la
izquierda y deja el formulario a ancho completo.
- La galería pública (`/gallery`) tampoco monta sidebar: usa el topbar con la
marca y el widget de sesión. Lista los proyectos finalizados y públicos en
tarjetas enlazadas al detalle, con búsqueda, filtros de fuente y año
integrados en la barra de búsqueda, orden y paginación de nueve tarjetas. En
móvil la barra se apila y la descripción se recorta a tres líneas. Reutiliza
los controles compartidos de listados y los estados de carga, vacío y error.
- La landing pública (`/`) no monta sidebar ni topbar. El acceso a la sesión
vive en el CTA **Iniciar sesión** del hero.

Expand All @@ -160,8 +166,8 @@ pestañas de usuario dentro del cuerpo: la navegación vive solo en la sidebar.

La landing `/` mantiene su hero y no publica header ni usa el shell. El inicio
interno (`/home`) requiere sesión y publica su header como cualquier módulo. Las
pantallas cargadas sin `PageFrame` (login, registro y algunos estados de carga)
dejan el topbar sin título de módulo.
pantallas cargadas sin `PageFrame` (login, registro, galería y algunos estados de
carga) dejan el topbar sin título de módulo.

## Convenciones para pantallas nuevas

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
38 changes: 19 additions & 19 deletions hub-backend/prisma/fixtures/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
{ "email": "student.valentina@capstonehub.test", "role": "student" },
{ "email": "student.sebastian@capstonehub.test", "role": "student" }
],
"attachments": ["portada-cacao.jpg", "anteproyecto.pdf"]
"attachments": ["anteproyecto.pdf"]
},
{
"name": "Sistema de Alerta Temprana de Deslizamientos",
Expand Down Expand Up @@ -369,7 +369,7 @@
{ "email": "student.camila@capstonehub.test", "role": "student" },
{ "email": "student.esteban@capstonehub.test", "role": "student" }
],
"attachments": ["portada-deslizamientos.jpg", "anteproyecto.pdf"]
"attachments": ["anteproyecto.pdf"]
},
{
"name": "Portal de Comercio Justo para Artesanos Salasacas",
Expand Down Expand Up @@ -403,7 +403,7 @@
{ "email": "student.daniela@capstonehub.test", "role": "student" },
{ "email": "student.isabela@capstonehub.test", "role": "student" }
],
"attachments": ["portada-comercio-justo.jpg", "logo-proyecto.png"]
"attachments": ["logo-proyecto.png"]
},
{
"name": "Gemelo Digital para Riego de Invernaderos",
Expand Down Expand Up @@ -437,7 +437,7 @@
{ "email": "student.martin@capstonehub.test", "role": "student" },
{ "email": "student.mateo@capstonehub.test", "role": "student" }
],
"attachments": ["portada-invernaderos.jpg", "anteproyecto.pdf"]
"attachments": ["anteproyecto.pdf"]
},
{
"name": "Kiosco de Salud Comunitaria Autónomo",
Expand Down Expand Up @@ -471,7 +471,7 @@
{ "email": "student.valentina@capstonehub.test", "role": "student" },
{ "email": "student.camila@capstonehub.test", "role": "student" }
],
"attachments": ["portada-kiosco-salud.jpg", "anteproyecto.pdf"]
"attachments": ["anteproyecto.pdf"]
},
{
"name": "Análisis de Flujo Turístico con Datos Abiertos",
Expand Down Expand Up @@ -505,7 +505,7 @@
{ "email": "student.daniela@capstonehub.test", "role": "student" },
{ "email": "student.esteban@capstonehub.test", "role": "student" }
],
"attachments": ["portada-turismo.jpg"]
"attachments": []
},
{
"name": "Robot de Inspección para Galerías de Riego",
Expand Down Expand Up @@ -539,7 +539,7 @@
{ "email": "student.esteban@capstonehub.test", "role": "student" },
{ "email": "student.martin@capstonehub.test", "role": "student" }
],
"attachments": ["portada-robot-riego.jpg", "anteproyecto.pdf"]
"attachments": ["anteproyecto.pdf"]
},
{
"name": "Optimización Logística de Última Milla",
Expand Down Expand Up @@ -573,7 +573,7 @@
{ "email": "student.mateo@capstonehub.test", "role": "student" },
{ "email": "student.valentina@capstonehub.test", "role": "student" }
],
"attachments": ["portada-ultima-milla.jpg"]
"attachments": []
},
{
"name": "Monitoreo Estructural de Puentes con Sensores IoT",
Expand Down Expand Up @@ -606,7 +606,7 @@
{ "email": "student.camila@capstonehub.test", "role": "student" },
{ "email": "student.martin@capstonehub.test", "role": "student" }
],
"attachments": ["portada-puentes.jpg", "anteproyecto.pdf"]
"attachments": ["anteproyecto.pdf"]
},
{
"name": "Plataforma de Economía Circular para Mipymes",
Expand Down Expand Up @@ -639,7 +639,7 @@
{ "email": "student.isabela@capstonehub.test", "role": "student" },
{ "email": "student.daniela@capstonehub.test", "role": "student" }
],
"attachments": ["portada-economia-circular.jpg"]
"attachments": []
},
{
"name": "Control de Calidad Textil con Visión por Computador",
Expand Down Expand Up @@ -673,7 +673,7 @@
{ "email": "student.sebastian@capstonehub.test", "role": "student" },
{ "email": "student.esteban@capstonehub.test", "role": "student" }
],
"attachments": ["portada-calidad-textil.jpg", "anteproyecto.pdf"]
"attachments": ["anteproyecto.pdf"]
},
{
"name": "App de Senderismo Seguro para los Andes",
Expand Down Expand Up @@ -706,7 +706,7 @@
{ "email": "student.valentina@capstonehub.test", "role": "student" },
{ "email": "student.camila@capstonehub.test", "role": "student" }
],
"attachments": ["portada-senderismo.jpg"]
"attachments": []
},
{
"name": "Módulo de Firma Electrónica para Trámites Académicos",
Expand Down Expand Up @@ -740,7 +740,7 @@
{ "email": "student.daniela@capstonehub.test", "role": "student" },
{ "email": "student.mateo@capstonehub.test", "role": "student" }
],
"attachments": ["portada-firma-electronica.jpg", "logo-proyecto.png"]
"attachments": ["logo-proyecto.png"]
},
{
"name": "Predicción de Demanda Eléctrica con Machine Learning",
Expand Down Expand Up @@ -774,7 +774,7 @@
{ "email": "student.esteban@capstonehub.test", "role": "student" },
{ "email": "student.isabela@capstonehub.test", "role": "student" }
],
"attachments": ["portada-demanda-electrica.jpg", "anteproyecto.pdf"]
"attachments": ["anteproyecto.pdf"]
},
{
"name": "Trazabilidad de Donaciones para Fundaciones",
Expand Down Expand Up @@ -807,7 +807,7 @@
{ "email": "student.martin@capstonehub.test", "role": "student" },
{ "email": "student.valentina@capstonehub.test", "role": "student" }
],
"attachments": ["portada-donaciones.jpg"]
"attachments": []
},
{
"name": "Auditoría de Seguridad de la Plataforma Académica",
Expand Down Expand Up @@ -841,7 +841,7 @@
{ "email": "student.mateo@capstonehub.test", "role": "student" },
{ "email": "student.sebastian@capstonehub.test", "role": "student" }
],
"attachments": ["portada-auditoria-seguridad.jpg"]
"attachments": []
},
{
"name": "Historia Clínica Electrónica para Convenio Hospitalario",
Expand Down Expand Up @@ -875,7 +875,7 @@
{ "email": "student.camila@capstonehub.test", "role": "student" },
{ "email": "student.daniela@capstonehub.test", "role": "student" }
],
"attachments": ["portada-historia-clinica.jpg"]
"attachments": []
},
{
"name": "Plataforma de Pasantías y Vinculación",
Expand Down Expand Up @@ -908,7 +908,7 @@
{ "email": "student.isabela@capstonehub.test", "role": "student" },
{ "email": "student.martin@capstonehub.test", "role": "student" }
],
"attachments": ["portada-pasantias.jpg"]
"attachments": []
},
{
"name": "Biofertilizantes a partir de Residuos Agroindustriales",
Expand Down Expand Up @@ -999,7 +999,7 @@
{ "email": "student.esteban@capstonehub.test", "role": "student" },
{ "email": "student.camila@capstonehub.test", "role": "student" }
],
"attachments": ["portada-glaciares.jpg", "anteproyecto.pdf"]
"attachments": ["anteproyecto.pdf"]
}
]
}
1 change: 1 addition & 0 deletions hub-backend/src/projects/project-exports.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const user: AuthenticatedUser = {
const listProject: ProjectListResponse = {
id: 1,
name: 'Proyecto Demo',
description: 'Descripción del proyecto',
status: ProjectStatus.approved,
phase: ProjectPhase.semester_1,
startDate: new Date('2026-01-15T00:00:00Z'),
Expand Down
2 changes: 2 additions & 0 deletions hub-backend/src/projects/projects.select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export type ProjectProposerResponse = {
export type ProjectListResponse = {
id: number;
name: string;
description: string;
status: ProjectStatus;
phase: ProjectPhase;
startDate: Date | null;
Expand Down Expand Up @@ -422,6 +423,7 @@ export function mapProjectListResponse(
return {
id: project.id,
name: project.name,
description: project.description,
status: project.status,
phase: project.phase,
startDate: isPrivatePreview ? null : project.startDate,
Expand Down
56 changes: 56 additions & 0 deletions hub-backend/test/projects.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
ProjectStatus,
UserRole,
} from '../src/generated/prisma/client';
import { PrismaService } from '../src/prisma.service';

describe('Projects (e2e)', () => {
const getApp = useTestApp();
Expand Down Expand Up @@ -317,4 +318,59 @@ describe('Projects (e2e)', () => {
),
).toBe(false);
});

it('expone al público solo los proyectos finalizados y no privados', async () => {
const app = getApp();
const prisma = app.get(PrismaService);
const { projectId } = await createProjectWithProposer(app, false);
const { projectId: privateProjectId } = await createProjectWithProposer(
app,
true,
);
const { projectId: pendingProjectId } = await createProjectWithProposer(
app,
false,
);

await prisma.project.updateMany({
where: { id: { in: [projectId, privateProjectId] } },
data: { status: ProjectStatus.closed },
});

const list = await request(app.getHttpServer())
.get('/projects?status=closed&isPrivate=false&sort=year-desc&limit=100')
.expect(200);

const projects = list.body as {
id: number;
description: string;
canViewSensitiveData: boolean;
isPrivatePreview: boolean;
actors: unknown[];
proposer: {
fullName: string;
email: string | null;
idNumber: string | null;
} | null;
}[];
const ids = projects.map((project) => project.id);

expect(ids).toContain(projectId);
expect(ids).not.toContain(privateProjectId);
expect(ids).not.toContain(pendingProjectId);

const project = projects.find((item) => item.id === projectId);

expect(project).toMatchObject({
description: 'Descripción del proyecto',
canViewSensitiveData: false,
isPrivatePreview: false,
});
expect(project?.proposer).toMatchObject({
fullName: 'Proponente E2E',
email: null,
idNumber: null,
});
expect(project?.actors).toEqual([]);
});
});
Loading
Loading