Chore: Visual fix.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
@let p = summary();
|
||||
<button class="back-button" mat-stroked-button type="button" (click)="back.emit()"><mat-icon aria-hidden="true">arrow_back</mat-icon><span>Regresar</span></button>
|
||||
<div class="toolbar">
|
||||
<button class="back-button" mat-stroked-button type="button" (click)="back.emit()"><mat-icon aria-hidden="true">arrow_back</mat-icon><span>Regresar</span></button>
|
||||
<button class="export-button" mat-stroked-button type="button" [disabled]="generating()" (click)="exportPdf()"><mat-icon aria-hidden="true">picture_as_pdf</mat-icon><span>Exportar ficha PDF</span></button>
|
||||
@if (generating()) { <p class="toolbar-message" role="status">Generando PDF…</p> }
|
||||
@if (failed()) { <p class="toolbar-message" role="alert">No se pudo generar el PDF. Intenta nuevamente.</p> }
|
||||
</div>
|
||||
<header>
|
||||
<h2 #title tabindex="-1">Paciente {{ p.pseudonymId }}</h2>
|
||||
<p>Fecha de corte: {{ p.cutoff }}.</p>
|
||||
<button mat-stroked-button type="button" [disabled]="generating()" (click)="exportPdf()"><mat-icon aria-hidden="true">picture_as_pdf</mat-icon><span>Exportar ficha PDF</span></button>
|
||||
@if (generating()) { <p role="status">Generando PDF…</p> }
|
||||
@if (failed()) { <p role="alert">No se pudo generar el PDF. Intenta nuevamente.</p> }
|
||||
<dl class="summary">
|
||||
<div><dt>Identificador seudónimo</dt><dd>{{ p.pseudonymId }}</dd></div>
|
||||
<div><dt>Grupo de edad</dt><dd>{{ p.ageGroup ?? notAvailable }}</dd></div>
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
header { margin-block: 1.5rem; }
|
||||
h2 { margin-block: .5rem 1rem; font-size: 1.65rem; }
|
||||
h3 { margin-block: 0 1rem; font-size: 1.2rem; }
|
||||
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; }
|
||||
.toolbar-message { flex: 0 0 100%; margin: 0; }
|
||||
.export-button { margin-inline-start: auto; }
|
||||
.back-button { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding-inline: .65rem; }
|
||||
.back-button mat-icon { width: 1.15rem; height: 1.15rem; font-size: 1.15rem; }
|
||||
.availability { margin-block: .75rem; color: var(--issste-text-secondary); }
|
||||
|
||||
@@ -106,6 +106,18 @@ describe('Ficha CaMa: componente', () => {
|
||||
vi.restoreAllMocks();
|
||||
}, 30000);
|
||||
|
||||
// Fails if the two buttons leave the row above the title: back on the left, the PDF export on the right.
|
||||
it('puts "Regresar" first and "Exportar ficha PDF" last in one row above the identifier', () => {
|
||||
montar(toCamaPatientSummary(complete(), '2026-10-20')!);
|
||||
const row = root().querySelector('.toolbar')!;
|
||||
const buttons = [...row.querySelectorAll('button')];
|
||||
expect(buttons).toHaveLength(2);
|
||||
expect(buttons[0].textContent).toContain('Regresar');
|
||||
expect(buttons[1].textContent).toContain('Exportar ficha PDF');
|
||||
expect(row.compareDocumentPosition(root().querySelector('h2')!) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
||||
expect(root().querySelector('header')!.querySelector('button')).toBeNull();
|
||||
});
|
||||
|
||||
// Fails if the back button stops telling the list to return.
|
||||
it('emits back when "Regresar" is pressed', () => {
|
||||
montar(toCamaPatientSummary(complete(), '2026-10-20')!);
|
||||
|
||||
Reference in New Issue
Block a user