CLASSROOMIO-T-50: Update welcome banner and fix profile update error
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
<aside class="root bg-gray-100 dark:bg-gray-700 h-full">
|
||||
<div class="h-full flex flex-col">
|
||||
<div class="border-b border-gray-200 pt-5 px-4">
|
||||
{#if $currentOrg.avatar_url}
|
||||
{#if $currentOrg.avatar_url && $currentOrg.name}
|
||||
<Avatar
|
||||
src={$currentOrg.avatar_url}
|
||||
name={$currentOrg.name}
|
||||
@@ -67,7 +67,7 @@
|
||||
width="w-7"
|
||||
height="h-7"
|
||||
/>
|
||||
{:else}
|
||||
{:else if $currentOrg.shortName}
|
||||
<TextChip
|
||||
value={$currentOrg.shortName}
|
||||
className="bg-blue-200 font-bold"
|
||||
|
||||
@@ -1,23 +1,35 @@
|
||||
<script>
|
||||
import Modal from '../Modal/index.svelte'
|
||||
import { writable } from 'svelte/store';
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import { welcomeModalStore } from './store';
|
||||
|
||||
const closeModal = () => {
|
||||
$welcomeModalStore.open = false;
|
||||
}
|
||||
import Modal from '../Modal/index.svelte';
|
||||
import { writable } from 'svelte/store';
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import { welcomeModalStore } from './store';
|
||||
|
||||
const closeModal = () => {
|
||||
$welcomeModalStore.open = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<Modal
|
||||
onClose={closeModal}
|
||||
bind:open={$welcomeModalStore.open}
|
||||
width="w-9/12"
|
||||
modalHeading="Welcome"
|
||||
onClose={closeModal}
|
||||
bind:open={$welcomeModalStore.open}
|
||||
width="w-9/12"
|
||||
modalHeading="Welcome"
|
||||
>
|
||||
<p class="text-black text-sm md:text-base lg:text-lg">
|
||||
We at <a href="https://app.classroomio.com/" class="text-blue-700 no-underline hover:no-underline">ClassroomIO</a> are a small team with a large mission to empower educators with great technology to help them train the future generation. Education is the most powerful gift you can give anyone, and it makes so much sense to give you all the tools you need to give more people this GIFT. <span class="text-blue-700">Thank you for choosing us;</span> we deeply appreciate it and are at your service.
|
||||
</p>
|
||||
<img src="/images/welcome-modal-banner.png" alt="A welcome banner" class="w-full my-6">
|
||||
</Modal>
|
||||
<p class="text-black text-sm md:text-base lg:text-lg">
|
||||
We at <a
|
||||
href="https://app.classroomio.com/"
|
||||
class="text-blue-700 no-underline hover:no-underline">ClassroomIO</a
|
||||
>
|
||||
are a small team with a large mission to empower educators with great
|
||||
technology to help them train the future generation. Education is the most
|
||||
powerful gift you can give anyone, and it makes so much sense to give you
|
||||
all the tools you need to give more people this GIFT.
|
||||
<span class="text-blue-700">Thank you for choosing us;</span> we deeply appreciate
|
||||
it and are at your service.
|
||||
</p>
|
||||
<img
|
||||
src="/images/welcome-modal-banner.svg"
|
||||
alt="A welcome banner"
|
||||
class="w-full my-6"
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
import { supabase } from '../utils/functions/supabase';
|
||||
import { blockedSubdomain } from '../utils/constants/app';
|
||||
import { welcomeModalStore } from '../components/WelcomeModal/store';
|
||||
import { getOrganizations } from '../utils/services/org';
|
||||
|
||||
interface OnboardingField {
|
||||
fullname?: string;
|
||||
@@ -91,7 +92,7 @@
|
||||
if (!orgName || isTouched) return;
|
||||
let inputElement = event?.target as HTMLInputElement;
|
||||
let value = inputElement.name;
|
||||
console.log('set org name', orgName, isTouched, value);
|
||||
|
||||
if (value == 'orgname') {
|
||||
fields.siteName = orgName
|
||||
?.toLowerCase()
|
||||
@@ -102,7 +103,6 @@
|
||||
fields.siteName = inputElement.value;
|
||||
}
|
||||
}
|
||||
console.log('set org name', orgName, isTouched, value);
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {
|
||||
@@ -148,14 +148,6 @@
|
||||
});
|
||||
console.log('Create organisation member', data);
|
||||
|
||||
const memberId = Array.isArray(data) && data.length ? data[0].id : '';
|
||||
|
||||
orgs.set([orgData as never]);
|
||||
currentOrg.set({
|
||||
...orgData,
|
||||
memberId: memberId,
|
||||
});
|
||||
|
||||
if (error) {
|
||||
console.log('Error: create organisation member', error);
|
||||
errors.siteName =
|
||||
@@ -169,6 +161,8 @@
|
||||
loading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
await getOrganizations($profile.id);
|
||||
}
|
||||
|
||||
// client
|
||||
@@ -182,7 +176,11 @@
|
||||
|
||||
let { data, error } = await supabase
|
||||
.from('profile')
|
||||
.update(fields)
|
||||
.update({
|
||||
...fields,
|
||||
orgName: undefined,
|
||||
siteName: undefined,
|
||||
})
|
||||
.match({ id: $profile.id });
|
||||
loading = false;
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 500 KiB |
Reference in New Issue
Block a user