93 lines
4.2 KiB
HTML
93 lines
4.2 KiB
HTML
<section class="promote">
|
|
<div class="promote__toolbar">
|
|
<h3 class="promote__title">Requisitos y promoción</h3>
|
|
<span class="promote__spacer"></span>
|
|
<button mat-flat-button type="button" color="primary" (click)="promoteAll()" [disabled]="promoting() || loading() || !rows().length">
|
|
<mat-icon aria-hidden="true">rocket_launch</mat-icon>
|
|
{{ promoting() ? 'Promoviendo…' : 'Promover todas' }}
|
|
</button>
|
|
</div>
|
|
|
|
@if (loading()) {
|
|
<mat-progress-bar mode="indeterminate" aria-label="Cargando versiones"></mat-progress-bar>
|
|
}
|
|
@if (loadError(); as error) {
|
|
<p class="promote__alert" role="alert"><mat-icon aria-hidden="true">error</mat-icon>{{ error }}</p>
|
|
}
|
|
@if (!loading() && !loadError()) {
|
|
@if (rows().length) {
|
|
<table mat-table [dataSource]="rows()" class="promote__table" aria-label="Versiones a promover">
|
|
<ng-container matColumnDef="version">
|
|
<th mat-header-cell *matHeaderCellDef>Versión</th>
|
|
<td mat-cell *matCellDef="let row">
|
|
<span class="promote__label">{{ row.version.name }}:{{ row.version.version }}</span>
|
|
<app-model-status [status]="row.version.status"></app-model-status>
|
|
</td>
|
|
</ng-container>
|
|
<ng-container matColumnDef="checks">
|
|
<th mat-header-cell *matHeaderCellDef>Requisitos</th>
|
|
<td mat-cell *matCellDef="let row">
|
|
@if (row.checksError) {
|
|
<span class="promote__fail"><mat-icon aria-hidden="true">error</mat-icon>{{ row.checksError }}</span>
|
|
} @else if (row.checks === null) {
|
|
<span class="promote__muted">Cargando requisitos…</span>
|
|
} @else if (!row.checks.length) {
|
|
<span class="promote__muted">Sin requisitos registrados.</span>
|
|
} @else {
|
|
<ul class="promote__checks">
|
|
@for (check of row.checks; track check.code) {
|
|
<li [class.promote__fail]="!check.passed">
|
|
<mat-icon aria-hidden="true">{{ check.passed ? 'check_circle' : 'cancel' }}</mat-icon>
|
|
<span>{{ check.requirement }}</span>
|
|
@if (check.detail) {
|
|
<span class="promote__detail">{{ check.detail }}</span>
|
|
}
|
|
</li>
|
|
}
|
|
</ul>
|
|
}
|
|
@if (row.status === 'failed') {
|
|
@if (row.failing?.length) {
|
|
<ul class="promote__checks">
|
|
@for (check of row.failing; track check.code) {
|
|
<li class="promote__fail">
|
|
<mat-icon aria-hidden="true">error</mat-icon>
|
|
<span>No pasó: {{ check.requirement }}</span>
|
|
@if (check.detail) {
|
|
<span class="promote__detail">{{ check.detail }}</span>
|
|
}
|
|
</li>
|
|
}
|
|
</ul>
|
|
} @else {
|
|
<p class="promote__fail"><mat-icon aria-hidden="true">error</mat-icon>{{ row.error }}</p>
|
|
}
|
|
}
|
|
</td>
|
|
</ng-container>
|
|
<ng-container matColumnDef="status">
|
|
<th mat-header-cell *matHeaderCellDef>Estado</th>
|
|
<td mat-cell *matCellDef="let row">
|
|
@if (row.status === 'promoting') {
|
|
<span class="promote__muted"><mat-progress-bar mode="indeterminate" class="promote__bar"></mat-progress-bar>Promoviendo…</span>
|
|
} @else if (row.status === 'promoted') {
|
|
<span class="promote__ok"><mat-icon aria-hidden="true">check_circle</mat-icon>Promovida</span>
|
|
} @else if (row.status === 'failed') {
|
|
<span class="promote__fail"><mat-icon aria-hidden="true">error</mat-icon>Falló</span>
|
|
} @else {
|
|
<span class="promote__muted">Pendiente</span>
|
|
}
|
|
</td>
|
|
</ng-container>
|
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
</table>
|
|
} @else {
|
|
<p class="promote__muted">No hay versiones eeg-* candidatas.</p>
|
|
}
|
|
}
|
|
@if (summary(); as line) {
|
|
<p class="promote__muted" role="status">{{ line }}</p>
|
|
}
|
|
</section>
|