From f3de6a063ef1d93fb2fd1b5a9f893913b6f33799 Mon Sep 17 00:00:00 2001 From: Nwosu Emmanuel Date: Tue, 16 Sep 2025 09:21:41 +0100 Subject: [PATCH] feat: Trigger confirm warning for unsaved changes (#547) * added the triger warning for the settings page * all done * added translation to the window message * window issue now fixed --- .../Course/components/Settings/index.svelte | 2 +- .../Org/Settings/LandingpageSettings.svelte | 168 +++++++++++++----- .../Org/Settings/OrgSettings.svelte | 68 +++---- .../components/Org/Settings/Profile.svelte | 30 +++- .../components/UnsavedChanges/index.svelte | 33 ++-- .../lib/components/UploadImage/index.svelte | 21 ++- .../src/lib/utils/translations/de.json | 5 + .../src/lib/utils/translations/en.json | 6 + .../src/lib/utils/translations/es.json | 5 + .../src/lib/utils/translations/fr.json | 5 + .../src/lib/utils/translations/hi.json | 5 + .../src/lib/utils/translations/pt.json | 5 + .../src/lib/utils/translations/ru.json | 5 + .../src/lib/utils/translations/vi.json | 5 + 14 files changed, 256 insertions(+), 107 deletions(-) diff --git a/apps/dashboard/src/lib/components/Course/components/Settings/index.svelte b/apps/dashboard/src/lib/components/Course/components/Settings/index.svelte index 2ec6c0fb..c87d84a0 100644 --- a/apps/dashboard/src/lib/components/Course/components/Settings/index.svelte +++ b/apps/dashboard/src/lib/components/Course/components/Settings/index.svelte @@ -199,7 +199,7 @@ $: courseLink = `${$currentOrgDomain}/course/${$course.slug}`; - + diff --git a/apps/dashboard/src/lib/components/Org/Settings/LandingpageSettings.svelte b/apps/dashboard/src/lib/components/Org/Settings/LandingpageSettings.svelte index 548daa07..13821b9f 100644 --- a/apps/dashboard/src/lib/components/Org/Settings/LandingpageSettings.svelte +++ b/apps/dashboard/src/lib/components/Org/Settings/LandingpageSettings.svelte @@ -1,25 +1,33 @@ - - + + + {$t('settings.landing_page.heading')} - + (hasUnsavedChanges = true)} + > {$t('settings.landing_page.hide_section')} {$t('settings.landing_page.show_section')} @@ -136,6 +149,7 @@ label={$t('settings.landing_page.title')} placeholder={$t('course.navItem.lessons.exercises.all_exercises.write_your_title')} bind:value={$landingPageSettings.header.title} + onChange={() => (hasUnsavedChanges = true)} className="w-full mb-5" /> (hasUnsavedChanges = true)} />