UI bug fixes

This commit is contained in:
ivan-pelly
2026-03-14 18:22:49 -07:00
parent 4d9b83c327
commit f431fb3e94
9 changed files with 32 additions and 6 deletions
@@ -82,6 +82,7 @@ export class BenchmarkCardFull implements OnDestroy {
if (result.success) {
this.successMessage.set('Benchmark created.');
this.savedBenchmarkText = this.benchmarkText;
this.studentService.notifyDataChanged();
if (result.payload?.benchmarkId) {
this.router.navigate(['/students', this.studentId, 'goals', this.goalId, 'benchmarks', result.payload.benchmarkId]);
}
@@ -15,8 +15,8 @@
@if (loaded()) {
<div class="detail-card">
<div class="field">
<label class="field-label" for="baseline">Baseline</label>
<input id="baseline" class="field-input" type="text" [(ngModel)]="baseline" />
<label class="field-label" for="category">Category</label>
<input id="category" class="field-input" type="text" [(ngModel)]="category" />
</div>
<div class="field">
<label class="field-label" for="description">Description</label>
@@ -24,8 +24,9 @@
placeholder="Enter description..."></textarea>
</div>
<div class="field">
<label class="field-label" for="category">Category</label>
<input id="category" class="field-input" type="text" [(ngModel)]="category" />
<label class="field-label" for="baseline">Baseline</label>
<textarea id="baseline" class="field-input field-textarea" [(ngModel)]="baseline" rows="3"
placeholder="Enter baseline..."></textarea>
</div>
<div class="actions">
<button class="toolbar-btn" (click)="onCancel()" [disabled]="!hasChanges()">Cancel</button>
@@ -113,7 +113,7 @@ export class GoalCardFull implements OnDestroy {
}
onBenchmarks() {
this.router.navigate(['/students', this.studentId, 'benchmarks']);
this.router.navigate(['/students', this.studentId, 'goals', this.goalId, 'benchmarks']);
}
ngOnDestroy() {
@@ -50,6 +50,7 @@ export class GoalList implements OnDestroy {
this.goals.update(list => [...list, goal]);
this.showAddModal.set(false);
this.studentService.notifyDataChanged();
this.router.navigate(['/students', this.studentId, 'goals', goal.goalId]);
}
onModalCancelled() {
@@ -1,4 +1,5 @@
import { Component, inject, signal } from '@angular/core';
import { Router } from '@angular/router';
import { StudentCard } from '../student-card/student-card';
import { AddStudentModal } from '../add-student-modal/add-student-modal';
import { DummyStudentService } from '../../../shared/services/dummy-student.service';
@@ -24,6 +25,7 @@ export class StudentCardList {
// ************************** Declarations *************************
private readonly studentService = inject(StudentService);
private readonly router = inject(Router);
protected readonly students = signal<StudentCardDto[]>([]);
protected readonly displayMode = signal<DisplayMode>('card');
protected readonly showAddModal = signal(false);
@@ -45,6 +47,7 @@ export class StudentCardList {
this.students.update(list => this.sortByIdentifier([...list, student]));
this.showAddModal.set(false);
this.studentService.notifyDataChanged();
this.router.navigate(['/students', student.studentId]);
}
onModalCancelled() {