fix(dashboard): Save button not showing in certificate settings page (#854)
* Fixed Validation of allowing teachers create compliance courses without setting deadline * greptile highlightCertificateSettings decraration suggestion * greptile multiple error bar showing fix suggestion * organization race condition * Delete screenshots/Screenshot 2026-07-22 at 11.52.00 AM.png * deleted unwanted files * code review fixes * Changed AttentionHightlight component to work with just one parameter created fixed Route Enums, Paths and Sections for * Kebab-case naming fix * Changes for code comments * Made changes to add tab to the query param * Apply suggestion from @greptile-apps[bot] Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Rotimi Best <[email protected]> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Rotimi Best
parent
74ab74e364
commit
564b0735f0
@@ -1,4 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { goto } from '$app/navigation';
|
||||
import { resolve } from '$app/paths';
|
||||
import { CertificatesPage } from '$features/course/pages';
|
||||
import * as Page from '@cio/ui/base/page';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
@@ -14,7 +17,12 @@
|
||||
import { openUpgradeModal } from '$lib/utils/functions/org';
|
||||
|
||||
let errors = $state<Record<string, string>>({});
|
||||
let certificateActiveTab = $state('design');
|
||||
|
||||
const certificateActiveTab = $derived.by(() => {
|
||||
const tabInParam = page.url.searchParams.get('tab');
|
||||
return tabInParam === 'settings' ? 'settings' : 'design';
|
||||
});
|
||||
|
||||
let hasUnsavedChanges = $state(false);
|
||||
let savedCertificateState = $state<string | null>(null);
|
||||
let savedCertificateStateCourseId = $state<string | null>(null);
|
||||
@@ -134,6 +142,15 @@
|
||||
hasUnsavedChanges = false;
|
||||
errors = {};
|
||||
}
|
||||
|
||||
function handleActiveTabChange(tab: string) {
|
||||
const url = new URL(page.url);
|
||||
url.searchParams.set('tab', tab);
|
||||
function handleActiveTabChange(tab: string) {
|
||||
const url = new URL(page.url);
|
||||
url.searchParams.set('tab', tab);
|
||||
replaceState(url, {});
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -160,7 +177,7 @@
|
||||
</Page.Header>
|
||||
<Page.Body>
|
||||
{#snippet child()}
|
||||
<CertificatesPage {errors} bind:activeTab={certificateActiveTab} />
|
||||
<CertificatesPage {errors} activeTab={certificateActiveTab} onActiveTabChange={handleActiveTabChange} />
|
||||
{/snippet}
|
||||
</Page.Body>
|
||||
{#if canEditCertificates && certificateActiveTab === 'settings'}
|
||||
|
||||
Reference in New Issue
Block a user