From 07b92fbe92d97166eb62cf51e9bc0cb520f72657 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Tue, 26 Sep 2023 11:57:31 +0100 Subject: [PATCH] CLASSROOMIO-T-182: Validation --- src/lib/components/Form/TextField.svelte | 2 +- .../Org/Settings/Integrations.svelte | 48 +++++++------- src/lib/components/Org/Settings/index.svelte | 64 ++++++++++--------- 3 files changed, 60 insertions(+), 54 deletions(-) diff --git a/src/lib/components/Form/TextField.svelte b/src/lib/components/Form/TextField.svelte index 33f3145f..a433fcfd 100644 --- a/src/lib/components/Form/TextField.svelte +++ b/src/lib/components/Form/TextField.svelte @@ -5,7 +5,7 @@ export let label = ''; export let placeholder = ''; - export let value: string | number; + export let value: string | number | null; export let name = ''; export let onKeyDown = () => {}; export let className = ''; diff --git a/src/lib/components/Org/Settings/Integrations.svelte b/src/lib/components/Org/Settings/Integrations.svelte index 494f414a..bdd4d302 100644 --- a/src/lib/components/Org/Settings/Integrations.svelte +++ b/src/lib/components/Org/Settings/Integrations.svelte @@ -1,6 +1,6 @@ - - - - + + + Telegram {#if $profile.telegram_chat_id !== null} -
- - Telegram Integration Successful +
+
+ + Integration Successful +
Unlink TelegramDisconnect
{:else}

- You can connect your account to telegram to get notified of any change to your account. + Connect your account to telegram to get notified of any change within the application.

-

- Follow the below steps: -

-

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

+

Step 1: Authenticate your account via the ClassroomIO bot.

window.open('https://t.me/classroomio_bot', '_blank')} - >Open BotOpen 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 f468e4c7..d10620fd 100644 --- a/src/lib/components/Org/Settings/index.svelte +++ b/src/lib/components/Org/Settings/index.svelte @@ -15,36 +15,7 @@ let query = new URLSearchParams($page.url.search); let tabKey = query.get('tab') || ''; - const tabs = [ - { - key: 0, - label: 'Profile', - tabKey: '', - href: $page.url.pathname, - disabled: false - }, - { - key: 1, - label: 'Organization', - tabKey: 'org', - href: `${$page.url.pathname}?tab=org`, - disabled: !$isOrgAdmin - }, - { - key: 2, - label: 'LandingPage', - tabKey: 'landingpage', - href: `${$page.url.pathname}?tab=landingpage`, - disabled: !$isOrgAdmin - }, - { - key: 3, - label: 'Integrations', - tabKey: 'integrations', - href: `${$page.url.pathname}?tab=integrations`, - disabled: false - } - ]; + let tabs = []; function getSelectedByTab(tabKey = '') { const tab = tabs.find((t) => t.tabKey === tabKey); @@ -67,6 +38,39 @@ changeRouteOnTabChange(selected); } } + + $: { + tabs = [ + { + key: 0, + label: 'Profile', + tabKey: '', + href: $page.url.pathname, + disabled: false + }, + { + key: 1, + label: 'Organization', + tabKey: 'org', + href: `${$page.url.pathname}?tab=org`, + disabled: !$isOrgAdmin + }, + { + key: 2, + label: 'LandingPage', + tabKey: 'landingpage', + href: `${$page.url.pathname}?tab=landingpage`, + disabled: !$isOrgAdmin + }, + { + key: 3, + label: 'Integrations', + tabKey: 'integrations', + href: `${$page.url.pathname}?tab=integrations`, + disabled: false + } + ]; + }