Renamed some of the goal fields to align with business logic

This commit is contained in:
ivan-pelly
2026-03-14 16:30:17 -07:00
parent 7f91e2e557
commit 4d9b83c327
50 changed files with 279 additions and 149 deletions
@@ -4,7 +4,7 @@
<button class="back-btn" (click)="onBack()">← Back</button>
<span class="student-name">{{ studentIdentifier() }}</span>
</div>
<h2 class="goal-title">{{ goalTitle() }}</h2>
<h2 class="goal-title">{{ goalCategory() }}</h2>
<!-- Error message -->
@if (error()) {
@@ -17,7 +17,7 @@ export class AddProgressEvent {
// ************************** Constructor **************************
constructor() {
this.goalTitle.set(this.route.snapshot.queryParamMap.get('goalTitle') ?? '');
this.goalCategory.set(this.route.snapshot.queryParamMap.get('goalCategory') ?? '');
this.studentIdentifier.set(this.route.snapshot.queryParamMap.get('studentIdentifier') ?? '');
this.studentId = this.route.snapshot.paramMap.get('studentId') ?? '';
this.goalId = this.route.snapshot.paramMap.get('goalId') ?? '';
@@ -32,7 +32,7 @@ export class AddProgressEvent {
private readonly studentId: string;
private readonly goalId: string;
protected readonly goalTitle = signal('');
protected readonly goalCategory = signal('');
protected readonly studentIdentifier = signal('');
protected readonly notes = signal('');
protected readonly error = signal<string | null>(null);
@@ -9,8 +9,8 @@
<h2 class="section-heading">Goals</h2>
<div class="goal-cards">
@for (goal of data()?.goals; track goal.goalId) {
<div class="goal-card" (click)="onGoalClick(goal.goalId, goal.title)">
<span class="goal-title">{{ goal.title }}</span>
<div class="goal-card" (click)="onGoalClick(goal.goalId, goal.category)">
<span class="goal-title">{{ goal.category }}</span>
<span class="event-count">{{ goal.progressEventCount }}</span>
</div>
}
@@ -46,10 +46,10 @@ export class StudentGoals {
// *****************************************************************
// Navigates to the add-progress-event page for the selected goal.
// *****************************************************************
onGoalClick(goalId: string, goalTitle: string) {
onGoalClick(goalId: string, goalCategory: string) {
this.router.navigate(
['students', this.studentId, 'goals', goalId, 'add-event'],
{ queryParams: { goalTitle, studentIdentifier: this.data()?.studentIdentifier } },
{ queryParams: { goalCategory, studentIdentifier: this.data()?.studentIdentifier } },
);
}