CLASSROOMIO-T-42: Limit subdomain names available to organizations
Co-authored-by: Rotimi Best <rotimiibitoyeemma@gmail.com> Merge-request: CLASSROOMIO-MR-9 Merged-by: Digdippa Team <digdippa@gmail.com>
This commit is contained in:
committed by
Space Cloud
co-authored by
Rotimi Best
parent
1388a41097
commit
0aa35e3dde
@@ -1,5 +1,7 @@
|
||||
<script>
|
||||
import { set, get, cloneDeep } from 'lodash';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import set from 'lodash/set';
|
||||
import get from 'lodash/get';
|
||||
import TextEditor from '../../../TextEditor/index.svelte';
|
||||
|
||||
export let course;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<script>
|
||||
import { set, get, cloneDeep } from 'lodash';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import set from 'lodash/set';
|
||||
import get from 'lodash/get';
|
||||
import TextEditor from '../../../TextEditor/index.svelte';
|
||||
|
||||
export let course;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<script>
|
||||
import { set, cloneDeep, isEmpty, get } from 'lodash';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import set from 'lodash/set';
|
||||
import get from 'lodash/get';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import TextArea from '../../../Form/TextArea.svelte';
|
||||
import TextField from '../../../Form/TextField.svelte';
|
||||
import UploadImage from '../../../UploadImage/index.svelte';
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<script>
|
||||
import { set, isEmpty, get, cloneDeep } from 'lodash';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import set from 'lodash/set';
|
||||
import get from 'lodash/get';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { Toggle } from 'carbon-components-svelte';
|
||||
import TextEditor from '../../../TextEditor/index.svelte';
|
||||
import TextField from '../../../Form/TextField.svelte';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<script>
|
||||
import { set, get, cloneDeep } from 'lodash';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import set from 'lodash/set';
|
||||
import get from 'lodash/get';
|
||||
import TextEditor from '../../../TextEditor/index.svelte';
|
||||
|
||||
export let course;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { VARIANTS } from '../../PrimaryButton/constants';
|
||||
import type { Course } from '../../../utils/types';
|
||||
import getCurrencyFormatter from '../../../utils/functions/getCurrencyFormatter';
|
||||
import { get } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
|
||||
export let className = '';
|
||||
export let courseData: Course = {
|
||||
@@ -46,9 +46,7 @@
|
||||
{formatter?.format(calculatedCost) || calculatedCost}
|
||||
</p>
|
||||
{#if courseData?.metadata?.showDiscount}
|
||||
<p
|
||||
class="dark:text-white font-light text-sm text-gray-500 dark:text-gray-200"
|
||||
>
|
||||
<p class="dark:text-white font-light text-sm text-gray-500">
|
||||
{discount}% Discount.
|
||||
<span class="line-through"
|
||||
>{formatter?.format(courseData?.cost || 0) || courseData.cost}</span
|
||||
@@ -70,9 +68,7 @@
|
||||
variant={VARIANTS.OUTLINED}
|
||||
onClick={addToCart}
|
||||
/>
|
||||
<p
|
||||
class="dark:text-white font-light text-sm text-gray-500 dark:text-gray-200"
|
||||
>
|
||||
<p class="dark:text-white font-light text-sm text-gray-500">
|
||||
Early bird offer. Buy ASAP
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="root w-72 border bg-white dark:bg-gray-800 mr-4 mb-4 rounded-md transition ease-in-out relative"
|
||||
class="root w-72 border bg-gray-100 dark:bg-gray-700 mr-4 mb-4 rounded-md transition ease-in-out relative"
|
||||
>
|
||||
<SkeletonPlaceholder style="width: 100%; height: 10rem;" />
|
||||
<div class="p-3 pb-0">
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
<a rel="prefetch" href="/courses/{id}" class=" text-black">
|
||||
<div
|
||||
class="root w-72 border bg-white dark:bg-gray-800 mr-4 mb-4 rounded-md transition ease-in-out relative"
|
||||
class="root w-72 border bg-gray-100 dark:bg-gray-700 mr-4 mb-4 rounded-md transition ease-in-out relative"
|
||||
>
|
||||
<Dropdown
|
||||
options={getOptions()}
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
export let message;
|
||||
</script>
|
||||
|
||||
<p class="dark:text-white text-sm text-red-500">{message}</p>
|
||||
<p class="text-sm text-red-500">{message}</p>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
{/if}
|
||||
<input
|
||||
use:typeAction
|
||||
class="form-input p-3 mt-1 block w-full border-none bg-gray-200 {inputClassName} {errorMessage
|
||||
class="form-input dark:text-black p-3 mt-1 block w-full border-none bg-gray-200 {inputClassName} {errorMessage
|
||||
? 'border-red-500'
|
||||
: ''}"
|
||||
on:keydown={onKeyDown}
|
||||
@@ -86,7 +86,7 @@
|
||||
</span>
|
||||
{/if}
|
||||
{#if errorMessage}
|
||||
<p class="dark:text-white text-sm text-red-500">{errorMessage}</p>
|
||||
<p class="text-sm text-red-500">{errorMessage}</p>
|
||||
{:else if helperMessage}
|
||||
<p class="dark:text-white text-sm">
|
||||
{helperMessage}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script>
|
||||
import { stores } from '@sapper/app';
|
||||
import NotificationIcon from 'carbon-icons-svelte/lib/Notification20';
|
||||
import Moon from 'carbon-icons-svelte/lib/Moon16';
|
||||
import Sun from 'carbon-icons-svelte/lib/Sun16';
|
||||
@@ -8,6 +9,7 @@
|
||||
import { toggleBodyByTheme } from '../../utils/functions/app';
|
||||
|
||||
export let navClass = '';
|
||||
const { page } = stores();
|
||||
|
||||
function toggleTheme() {
|
||||
$appStore.isDark = !$appStore.isDark;
|
||||
@@ -21,7 +23,7 @@
|
||||
<ul class="flex w-full items-center">
|
||||
<div class="">
|
||||
<a
|
||||
href={window.location.pathname}
|
||||
href={$page.path}
|
||||
title="Go to ClassroomIO Home"
|
||||
id="logo"
|
||||
class="text-lg"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import { VARIANTS } from '../../PrimaryButton/constants';
|
||||
import { currentOrg } from '../../../utils/store/org';
|
||||
import { supabase } from '../../../utils/functions/supabase';
|
||||
import { blockedSubdomain } from '../../../utils/constants/app';
|
||||
import { snackbarStore } from '../../Snackbar/store';
|
||||
import { SNACKBAR_SEVERITY } from '../../Snackbar/constants';
|
||||
import SectionTitle from '../SectionTitle.svelte';
|
||||
@@ -16,6 +17,10 @@
|
||||
let isLoading = false;
|
||||
|
||||
async function handleChangeDomain() {
|
||||
if (blockedSubdomain.includes(siteName || '')) {
|
||||
errors = 'Sitename already exists.';
|
||||
return;
|
||||
}
|
||||
isLoading = true;
|
||||
|
||||
const { data: org, error } = await supabase
|
||||
@@ -50,12 +55,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
function resetErrors(_siteName) {
|
||||
if (errors) {
|
||||
errors = '';
|
||||
}
|
||||
}
|
||||
|
||||
$: resetErrors(siteName);
|
||||
$: setSiteName($currentOrg.siteName);
|
||||
</script>
|
||||
|
||||
<Grid class="border rounded border-gray-200 w-full mt-5">
|
||||
<Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<Column sm={2} md={2} lg={4} class="text-lg"><strong>Add</strong></Column>
|
||||
<Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4} class="text-lg"
|
||||
><SectionTitle>Add</SectionTitle></Column
|
||||
>
|
||||
<Column sm={2} md={6} lg={8}>
|
||||
<p class="text-md text-gray-500 dark:text-gray-200 mb-5">
|
||||
Add your team mates or collaborators to your organization. Start working
|
||||
@@ -85,7 +99,7 @@
|
||||
</Column>
|
||||
</Row>
|
||||
|
||||
<Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4} class="text-lg"
|
||||
><SectionTitle>Custom domain</SectionTitle></Column
|
||||
>
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Grid class="border rounded border-gray-200 w-full mt-5">
|
||||
<Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<Grid class="border-c rounded border-gray-200 w-full mt-5">
|
||||
<Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4}
|
||||
><SectionTitle>Organization Profile</SectionTitle></Column
|
||||
>
|
||||
@@ -104,13 +104,13 @@
|
||||
/>
|
||||
</Column>
|
||||
</Row>
|
||||
<!-- <Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<!-- <Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4}><SectionTitle>Theme</SectionTitle></Column>
|
||||
<Column sm={2} md={6} lg={8}>
|
||||
<h4 class="dark:text-white">Set your brand</h4>
|
||||
</Column>
|
||||
</Row> -->
|
||||
<Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4}
|
||||
><SectionTitle>Custom Domain</SectionTitle></Column
|
||||
>
|
||||
@@ -127,7 +127,7 @@
|
||||
/>
|
||||
</Column>
|
||||
</Row>
|
||||
<Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4}><SectionTitle>Team</SectionTitle></Column>
|
||||
<Column sm={2} md={6} lg={8}>
|
||||
<h4 class="dark:text-white">Set up your website</h4>
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Grid class="border rounded border-gray-200 w-full mt-5">
|
||||
<Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<Grid class="border-c rounded border-gray-200 w-full mt-5">
|
||||
<Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4}>
|
||||
<SectionTitle>Profile Picture</SectionTitle>
|
||||
</Column>
|
||||
@@ -94,7 +94,7 @@
|
||||
/>
|
||||
</Column>
|
||||
</Row>
|
||||
<Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4}>
|
||||
<SectionTitle>Personal Information</SectionTitle>
|
||||
</Column>
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
</script>
|
||||
|
||||
<Grid class="border rounded border-gray-200 w-full mt-5">
|
||||
<Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4} class="text-lg"
|
||||
><SectionTitle>Add</SectionTitle></Column
|
||||
>
|
||||
@@ -162,7 +162,7 @@
|
||||
</Column>
|
||||
</Row>
|
||||
|
||||
<Row class="py-7 border border-t-0 border-l-0 border-r-0 border-gray-300">
|
||||
<Row class="py-7 border-bottom-c">
|
||||
<Column sm={2} md={2} lg={4} class="text-lg"
|
||||
><SectionTitle>Members</SectionTitle></Column
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user