diff --git a/src/lib/components/Course/components/Ceritficate/Design.svelte b/src/lib/components/Course/components/Ceritficate/Design.svelte index df504303..18711520 100644 --- a/src/lib/components/Course/components/Ceritficate/Design.svelte +++ b/src/lib/components/Course/components/Ceritficate/Design.svelte @@ -44,7 +44,7 @@ /> -
+
- themes + themes
{/each} diff --git a/src/lib/components/Course/components/Ceritficate/StudentCertificate/LockedCertificate.svelte b/src/lib/components/Course/components/Ceritficate/StudentCertificate/LockedCertificate.svelte index 3b3c2bee..e258a7d9 100644 --- a/src/lib/components/Course/components/Ceritficate/StudentCertificate/LockedCertificate.svelte +++ b/src/lib/components/Course/components/Ceritficate/StudentCertificate/LockedCertificate.svelte @@ -4,7 +4,7 @@
- Certificate + Certificate

Certificates not available

Your instructor needs to unlock your certificate.
If you need your certificate, please contact diff --git a/src/lib/components/Course/components/Ceritficate/StudentCertificate/UnlockedCertificate.svelte b/src/lib/components/Course/components/Ceritficate/StudentCertificate/UnlockedCertificate.svelte index 748196bf..620a5e71 100644 --- a/src/lib/components/Course/components/Ceritficate/StudentCertificate/UnlockedCertificate.svelte +++ b/src/lib/components/Course/components/Ceritficate/StudentCertificate/UnlockedCertificate.svelte @@ -42,7 +42,7 @@

- Certificate + Certificate

Certificate is now available

+ import { Grid, Column, Row } from 'carbon-components-svelte'; + import Checkmark from 'carbon-icons-svelte/lib/Checkmark.svelte'; + import { supabase } from '$lib/utils/functions/supabase'; + import { profile } from '$lib/utils/store/user'; + import { SNACKBAR_SEVERITY } from '$lib/components/Snackbar/constants'; + import { snackbarStore } from '$lib/components/Snackbar/store'; + import TextField from '$lib/components/Form/TextField.svelte'; + import PrimaryButton from '$lib/components/PrimaryButton/index.svelte'; + import { VARIANTS } from '$lib/components/PrimaryButton/constants'; + import SectionTitle from '../SectionTitle.svelte'; + + let chatId; + + async function addChatId() { + const updates = { + telegram_chat_id: chatId + }; + if ($profile.telegram_chat_id === null) { + let { error } = await supabase.from('profile').update(updates).match({ id: $profile.id }); + // Update the telegram_chat_id in the profile store with the value from the TextField + profile.update((profileData) => ({ + ...profileData, + ...updates + })); + // Clear the chatId variable after updating the store + chatId = ''; + + if (error) { + $snackbarStore.open = true; + $snackbarStore.message = 'Integration Failed, please try again later'; + $snackbarStore.severity = SNACKBAR_SEVERITY.ERROR; + console.log(error); + } else { + $snackbarStore.open = true; + $snackbarStore.message = 'Integration successful'; + $snackbarStore.severity = SNACKBAR_SEVERITY.SUCCESS; + } + } + } + + async function deleteChatId() { + const updates = { + telegram_chat_id: null + }; + let { error } = await supabase.from('profile').update(updates).match({ id: $profile.id }); + // Check if telegram_chat_id is not null before attempting to delete + if ($profile.telegram_chat_id !== null) { + // Update the telegram_chat_id in the profile store to null + profile.update((profileData) => ({ + ...profileData, + telegram_chat_id: null + })); + + if (error) { + $snackbarStore.open = true; + $snackbarStore.message = 'Deletion Failed, please try again later'; + $snackbarStore.severity = SNACKBAR_SEVERITY.ERROR; + console.log(error); + } else { + // Show a success message in the snackbar + $snackbarStore.open = true; + $snackbarStore.message = 'Integration deleted'; + $snackbarStore.severity = SNACKBAR_SEVERITY.SUCCESS; + } + } + } + + + + + + + Telegram + + + {#if $profile.telegram_chat_id !== null} +
+ + Telegram Integration Successful + Unlink Telegram +
+ {:else} +
+

+ You can connect your account to telegram to get notified of any change to your account. +

+

+ Follow the below steps: +

+

+ Step 1: Authenticate your account via the ClassroomIO bot. +

+ window.open('https://t.me/classroomio_bot', '_blank')} + >Open Bot +

Step 2: Enter the Chat ID given to you by the bot.

+ + Connect +
+ {/if} +
+
+
diff --git a/src/lib/components/Org/Settings/index.svelte b/src/lib/components/Org/Settings/index.svelte index fd34c9dd..f468e4c7 100644 --- a/src/lib/components/Org/Settings/index.svelte +++ b/src/lib/components/Org/Settings/index.svelte @@ -9,6 +9,7 @@ import { browser } from '$app/environment'; import { goto } from '$app/navigation'; import { isOrgAdmin } from '$lib/utils/store/org'; + import Integrations from './Integrations.svelte'; let selected = 0; let query = new URLSearchParams($page.url.search); @@ -35,6 +36,13 @@ tabKey: 'landingpage', href: `${$page.url.pathname}?tab=landingpage`, disabled: !$isOrgAdmin + }, + { + key: 3, + label: 'Integrations', + tabKey: 'integrations', + href: `${$page.url.pathname}?tab=integrations`, + disabled: false } ]; @@ -79,5 +87,8 @@ + + + diff --git a/src/routes/lms/settings/+page.svelte b/src/routes/lms/settings/+page.svelte index f296fe29..7191a9e5 100644 --- a/src/routes/lms/settings/+page.svelte +++ b/src/routes/lms/settings/+page.svelte @@ -2,6 +2,7 @@ import { page } from '$app/stores'; import { Tabs, Tab, TabContent } from 'carbon-components-svelte'; import Profile from '$lib/components/LMS/components/Profile.svelte'; + import Integrations from '$lib/components/Org/Settings/Integrations.svelte'; let selected = 0; const tabs = [ @@ -10,6 +11,13 @@ label: 'Profile', tabKey: '', href: $page.url.pathname + }, + { + key: 1, + label: 'Integrations', + tabKey: 'integrations', + href: `${$page.url.pathname}?tab=integrations`, + disabled: false } ]; @@ -24,6 +32,9 @@ + + +
diff --git a/static/bg-404.png b/static/bg-404.png index 0d01b468..6c4fed30 100644 Binary files a/static/bg-404.png and b/static/bg-404.png differ diff --git a/static/plain.png b/static/plain.png new file mode 100644 index 00000000..c6ddadcf Binary files /dev/null and b/static/plain.png differ diff --git a/static/plain.svg b/static/plain.svg deleted file mode 100644 index a104155b..00000000 --- a/static/plain.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/professional.png b/static/professional.png new file mode 100644 index 00000000..708ad6c2 Binary files /dev/null and b/static/professional.png differ diff --git a/static/professional.svg b/static/professional.svg deleted file mode 100644 index f2d8cfab..00000000 --- a/static/professional.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/telegram-svg.svg b/static/telegram-svg.svg new file mode 100644 index 00000000..d58c812d --- /dev/null +++ b/static/telegram-svg.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file