fix: replace stale program references (#749)

This commit is contained in:
Rotimi Best
2026-07-13 02:09:57 +01:00
committed by GitHub
parent 484e4fb674
commit 5e8188fbd3
57 changed files with 524 additions and 533 deletions
@@ -128,7 +128,7 @@
<Empty
title={$t('cohorts.courses.empty_title') || 'No courses yet'}
description={searchValue.trim()
? $t('cohorts.courses.no_matching_program_courses') || 'No cohort courses match your search.'
? $t('cohorts.courses.no_matching_cohort_courses') || 'No cohort courses match your search.'
: $t('cohorts.courses.empty_description') || 'Add courses to this cohort.'}
icon={BookOpenIcon}
variant="page"
@@ -44,15 +44,15 @@
];
const hasUnsavedChanges = $derived.by(() => {
const currentProgram = cohortApi.program;
if (!currentProgram) {
const currentCohort = cohortApi.cohort;
if (!currentCohort) {
return false;
}
return (
name.trim() !== currentProgram.name ||
description.trim() !== (currentProgram.description ?? '') ||
status !== ((currentProgram.status as 'ACTIVE' | 'INACTIVE' | 'ARCHIVED') ?? 'ACTIVE')
name.trim() !== currentCohort.name ||
description.trim() !== (currentCohort.description ?? '') ||
status !== ((currentCohort.status as 'ACTIVE' | 'INACTIVE' | 'ARCHIVED') ?? 'ACTIVE')
);
});
@@ -102,13 +102,13 @@
<h2 class="mb-4 text-sm font-semibold">{$t('cohorts.settings.general') || 'General'}</h2>
<div class="flex flex-col gap-4">
<div class="flex flex-col gap-1.5">
<Label for="prog-name">{$t('cohorts.settings.name_label') || 'Name'} *</Label>
<Input id="prog-name" bind:value={name} maxlength={255} />
<Label for="cohort-name">{$t('cohorts.settings.name_label') || 'Name'} *</Label>
<Input id="cohort-name" bind:value={name} maxlength={255} />
</div>
<div class="flex flex-col gap-1.5">
<Label for="prog-desc">{$t('cohorts.settings.description_label') || 'Description'}</Label>
<Textarea id="prog-desc" bind:value={description} rows={4} maxlength={2000} />
<Label for="cohort-desc">{$t('cohorts.settings.description_label') || 'Description'}</Label>
<Textarea id="cohort-desc" bind:value={description} rows={4} maxlength={2000} />
</div>
<div class="flex flex-col gap-1.5">
@@ -142,7 +142,7 @@
'Once deleted, this cohort and all its data cannot be recovered.'}
</p>
<Button variant="destructive" onclick={handleDelete} disabled={cohortApi.isLoading}>
{$t('cohorts.settings.delete') || 'Delete Program'}
{$t('cohorts.settings.delete') || 'Delete Cohort'}
</Button>
</section>
</div>
@@ -108,7 +108,7 @@
<Page.Action>
<Button onclick={() => (showCreateModal = true)}>
<Plus size={16} />
{$t('cohorts.create') || 'New Program'}
{$t('cohorts.create') || 'New Cohort'}
</Button>
</Page.Action>
</Page.Header>
@@ -123,7 +123,7 @@
>
<Button onclick={() => (showCreateModal = true)}>
<Plus size={16} />
{$t('cohorts.create') || 'New Program'}
{$t('cohorts.create') || 'New Cohort'}
</Button>
</Empty>
{:else}