CLASSROOMIO-T-73: Fix Org site name issues
CLASSROOMIO-T-73:made the neccessary changes as noted from the review CLASSROOMIO-T-73:fixed the prettier config and saved FIX:CLASSROOMIO-T-73([BUG]Org site name),made some update to the bug fix FIX:CLASSROOMIO-T-73(ORG site name issues) Co-authored-by: Ifeanyi Nwosu <[email protected]> Co-authored-by: emmanuel <[email protected]> Merge-request: CLASSROOMIO-MR-16 Merged-by: Best Admin <[email protected]>
This commit is contained in:
committed by
Space Cloud
co-authored by
Ifeanyi Nwosu
parent
ed67d43b2a
commit
2a0e7d4d5c
@@ -6,6 +6,7 @@
|
|||||||
export let label = '';
|
export let label = '';
|
||||||
export let placeholder = '';
|
export let placeholder = '';
|
||||||
export let value = '';
|
export let value = '';
|
||||||
|
export let name = '';
|
||||||
export let onKeyDown = () => {};
|
export let onKeyDown = () => {};
|
||||||
export let className = '';
|
export let className = '';
|
||||||
export let inputClassName = '';
|
export let inputClassName = '';
|
||||||
@@ -78,6 +79,7 @@
|
|||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
autocomplete={autoComplete ? 'on' : 'off'}
|
autocomplete={autoComplete ? 'on' : 'off'}
|
||||||
on:blur={onChange}
|
on:blur={onChange}
|
||||||
|
{name}
|
||||||
/>
|
/>
|
||||||
{#if isPassword}
|
{#if isPassword}
|
||||||
<span class="password-eye">
|
<span class="password-eye">
|
||||||
|
|||||||
@@ -95,7 +95,9 @@
|
|||||||
label="Login"
|
label="Login"
|
||||||
variant={VARIANTS.NONE}
|
variant={VARIANTS.NONE}
|
||||||
className="py-3 px-6 mx-2 app-background-color"
|
className="py-3 px-6 mx-2 app-background-color"
|
||||||
onClick={() => goto('/login' + redirect)}
|
onClick={() => {
|
||||||
|
goto('/login' + redirect);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
label="Sign Up"
|
label="Sign Up"
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const maxSteps = 2;
|
const maxSteps = 2;
|
||||||
|
|
||||||
let fields: OnboardingField = {
|
let fields: OnboardingField = {
|
||||||
fullname: '',
|
fullname: '',
|
||||||
orgName: '',
|
orgName: '',
|
||||||
@@ -87,15 +86,22 @@
|
|||||||
const payload = await response.json();
|
const payload = await response.json();
|
||||||
fields.metadata = payload;
|
fields.metadata = payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setOrgSiteName(orgName: string | undefined, isTouched: boolean) {
|
function setOrgSiteName(orgName: string | undefined, isTouched: boolean) {
|
||||||
console.log('set org name', orgName, isTouched);
|
|
||||||
if (!orgName || isTouched) return;
|
if (!orgName || isTouched) return;
|
||||||
|
let inputElement = event?.target as HTMLInputElement;
|
||||||
fields.siteName = orgName
|
let value = inputElement.name;
|
||||||
// @ts-ignore
|
console.log('set org name', orgName, isTouched, value);
|
||||||
.replaceAll(' ', '-')
|
if (value == 'orgname') {
|
||||||
.toLowerCase();
|
fields.siteName = orgName
|
||||||
|
?.toLowerCase()
|
||||||
|
?.replace(/\s+/g, '-')
|
||||||
|
?.replace(/[^a-zA-Z0-9-]/g, '');
|
||||||
|
} else {
|
||||||
|
if (value == 'sitename') {
|
||||||
|
fields.siteName = inputElement.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('set org name', orgName, isTouched, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
@@ -190,6 +196,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
$: progress = Math.round((step / maxSteps) * 100);
|
$: progress = Math.round((step / maxSteps) * 100);
|
||||||
|
$: fields.siteName = fields.siteName
|
||||||
|
?.toLowerCase()
|
||||||
|
?.replace(/\s+/g, '-')
|
||||||
|
?.replace(/[^a-zA-Z0-9-]/g, '');
|
||||||
$: setOrgSiteName(fields.orgName, isSiteNameTouched);
|
$: setOrgSiteName(fields.orgName, isSiteNameTouched);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -226,6 +236,7 @@
|
|||||||
<TextField
|
<TextField
|
||||||
label="Full Name"
|
label="Full Name"
|
||||||
bind:value={fields.fullname}
|
bind:value={fields.fullname}
|
||||||
|
name="fullname"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="e.g Joke Silva"
|
placeholder="e.g Joke Silva"
|
||||||
className="mb-5 w-full"
|
className="mb-5 w-full"
|
||||||
@@ -237,12 +248,15 @@
|
|||||||
<TextField
|
<TextField
|
||||||
label="Name of Organization"
|
label="Name of Organization"
|
||||||
bind:value={fields.orgName}
|
bind:value={fields.orgName}
|
||||||
|
name="orgname"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="e.g Education For All"
|
placeholder="e.g Education For All"
|
||||||
className="mb-5 w-full"
|
className="mb-5 w-full"
|
||||||
labelClassName="text-lg font-normal"
|
labelClassName="text-lg font-normal"
|
||||||
errorMessage={errors.orgName}
|
errorMessage={errors.orgName}
|
||||||
onChange={() => (isSiteNameTouched = true)}
|
onChange={() => {
|
||||||
|
isSiteNameTouched = true;
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Org Site Name -->
|
<!-- Org Site Name -->
|
||||||
@@ -250,6 +264,7 @@
|
|||||||
label="Organisation Site name"
|
label="Organisation Site name"
|
||||||
helperMessage={`https://${fields.siteName || ''}.classroomio.com`}
|
helperMessage={`https://${fields.siteName || ''}.classroomio.com`}
|
||||||
bind:value={fields.siteName}
|
bind:value={fields.siteName}
|
||||||
|
name="sitename"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="e.g edforall"
|
placeholder="e.g edforall"
|
||||||
className="mb-5 w-full"
|
className="mb-5 w-full"
|
||||||
|
|||||||
+10
-10
@@ -5,17 +5,17 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { goto } from '@sapper/app';
|
import { goto } from "@sapper/app";
|
||||||
import TextField from '../components/Form/TextField.svelte';
|
import TextField from "../components/Form/TextField.svelte";
|
||||||
import PrimaryButton from '../components/PrimaryButton/index.svelte';
|
import PrimaryButton from "../components/PrimaryButton/index.svelte";
|
||||||
import { getSupabase } from '../utils/functions/supabase';
|
import { getSupabase } from "../utils/functions/supabase";
|
||||||
import {
|
import {
|
||||||
authValidation,
|
authValidation,
|
||||||
getConfirmPasswordError,
|
getConfirmPasswordError,
|
||||||
getDisableSubmit,
|
getDisableSubmit,
|
||||||
} from '../utils/functions/validator';
|
} from "../utils/functions/validator";
|
||||||
import { SIGNUP_FIELDS } from '../utils/constants/authentication';
|
import { SIGNUP_FIELDS } from "../utils/constants/authentication";
|
||||||
import AuthUI from '../components/AuthUI/index.svelte';
|
import AuthUI from "../components/AuthUI/index.svelte";
|
||||||
|
|
||||||
export let config;
|
export let config;
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
async function handleSubmit(e) {
|
async function handleSubmit(e) {
|
||||||
const validationRes = authValidation(fields);
|
const validationRes = authValidation(fields);
|
||||||
console.log('validationRes', validationRes);
|
console.log("validationRes", validationRes);
|
||||||
|
|
||||||
if (Object.keys(validationRes).length) {
|
if (Object.keys(validationRes).length) {
|
||||||
errors = Object.assign(errors, validationRes);
|
errors = Object.assign(errors, validationRes);
|
||||||
@@ -43,12 +43,12 @@
|
|||||||
email: fields.email,
|
email: fields.email,
|
||||||
password: fields.password,
|
password: fields.password,
|
||||||
});
|
});
|
||||||
console.log('data', data);
|
console.log("data", data);
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|
||||||
formRef?.reset();
|
formRef?.reset();
|
||||||
|
|
||||||
return goto('/login');
|
return goto("/login");
|
||||||
// success = true;
|
// success = true;
|
||||||
// fields = Object.assign({}, SIGNUP_FIELDS);
|
// fields = Object.assign({}, SIGNUP_FIELDS);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user