Files
WebApp/src/app/governance/components/cohort-versions-panel/cohort-versions-panel.html
T

80 lines
3.4 KiB
HTML

<div class="cohorts">
<div class="cohorts__toolbar">
<mat-button-toggle-group hideSingleSelectionIndicator [value]="domain()" (change)="setDomain($event.value)" aria-label="Dominio">
@for (option of domains; track option.id) {
<mat-button-toggle [value]="option.id">{{ option.label }}</mat-button-toggle>
}
</mat-button-toggle-group>
<span class="cohorts__spacer"></span>
<button
mat-stroked-button
type="button"
[matMenuTriggerFor]="scenarioMenu"
[disabled]="building() || scenarios().length === 0"
[matTooltip]="scenarios().length ? '' : 'No hay escenarios con un constructor de cohorte registrado (models.cohort)'"
>
<mat-icon aria-hidden="true">add</mat-icon>Construir versión
</button>
<mat-menu #scenarioMenu="matMenu">
@for (scenario of scenarios(); track scenario.domain + scenario.scenario) {
<button mat-menu-item type="button" (click)="build(scenario)">
{{ scenario.domain }} · {{ scenario.scenario }} ({{ scenario.criteria_version }}, {{ scenario.criteria.length }} criterio(s))
</button>
}
</mat-menu>
<button mat-icon-button type="button" (click)="reload()" aria-label="Recargar" matTooltip="Recargar">
<mat-icon aria-hidden="true">refresh</mat-icon>
</button>
</div>
@if (loading() || building()) {
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
}
@if (loadError(); as error) {
<p class="cohorts__alert" role="alert"><mat-icon aria-hidden="true">error</mat-icon>{{ error }}</p>
}
<table mat-table [dataSource]="cohorts()" class="cohorts__table">
<ng-container matColumnDef="scenario">
<th mat-header-cell *matHeaderCellDef>Dominio · escenario</th>
<td mat-cell *matCellDef="let c">{{ c.domain }} · {{ c.scenario }}</td>
</ng-container>
<ng-container matColumnDef="version_hash">
<th mat-header-cell *matHeaderCellDef>Hash de versión</th>
<td mat-cell *matCellDef="let c"><code class="cohorts__hash" [matTooltip]="c.version_hash">{{ c.version_hash.slice(0, 16) }}…</code></td>
</ng-container>
<ng-container matColumnDef="criteria_version">
<th mat-header-cell *matHeaderCellDef>Criterio</th>
<td mat-cell *matCellDef="let c">{{ c.criteria_version }}</td>
</ng-container>
<ng-container matColumnDef="counts">
<th mat-header-cell *matHeaderCellDef>Participantes</th>
<td mat-cell *matCellDef="let c">{{ c.n_included }} incluido(s) · {{ excludedCount(c) }} excluido(s) de {{ c.n_source }}</td>
</ng-container>
<ng-container matColumnDef="created_at">
<th mat-header-cell *matHeaderCellDef>Creada</th>
<td mat-cell *matCellDef="let c">{{ c.created_at | date: 'short' }}</td>
</ng-container>
<ng-container matColumnDef="acciones">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let c">
<button mat-button type="button" (click)="openExclusions(c)">
<mat-icon aria-hidden="true">rule</mat-icon>Exclusiones
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
@if (!loading() && cohorts().length === 0) {
<p class="cohorts__empty"><mat-icon aria-hidden="true">dataset</mat-icon>Aún no hay cohortes construidas para este filtro.</p>
}
</div>