From b676993c2d686768c6ecc8bb1e1678ca39840c69 Mon Sep 17 00:00:00 2001 From: emmanuel Date: Wed, 11 Oct 2023 11:40:08 +0000 Subject: [PATCH] CLASSROOMIO-T-211: Add a content-switcher in the landing page settings for banner CLASSROOMIO-T-211: Remove business logic of uploading image CLASSROOMIO-T-211:Updated the UI of the landingpage settings Merge branch 'main' into CLASSROOMIO-T-211 CLASSROOMIO-T-211:Added a Content-switch in the landingpage settings Co-authored-by: Ifeanyi Nwosu Co-authored-by: Rotimi Best Merge-request: CLASSROOMIO-MR-97 Merged-by: Best Admin --- .../Course/components/Settings/index.svelte | 20 +-- .../Course/components/Settings/store.js | 2 +- .../components/CourseLandingPage/index.svelte | 12 -- src/lib/components/CourseLandingPage/store.js | 5 - .../components/Org/LandingPage/index.svelte | 34 +++-- .../Org/Settings/LandingpageSettings.svelte | 124 +++++++++++------- src/lib/components/Org/Settings/store.ts | 14 +- src/lib/components/Tabs/index.svelte | 16 ++- src/lib/components/UploadWidget/index.svelte | 110 +++++++--------- .../utils/constants/orgLandingPageJson.json | 9 +- src/lib/utils/types/org.ts | 4 +- 11 files changed, 177 insertions(+), 173 deletions(-) diff --git a/src/lib/components/Course/components/Settings/index.svelte b/src/lib/components/Course/components/Settings/index.svelte index 1ee3c976..b1e87ded 100644 --- a/src/lib/components/Course/components/Settings/index.svelte +++ b/src/lib/components/Course/components/Settings/index.svelte @@ -13,8 +13,6 @@ import { course } from '$lib/components/Course/store'; import { updateCourse, deleteCourse } from '$lib/utils/services/courses'; import { currentOrgPath } from '$lib/utils/store/org'; - import { supabase } from '$lib/utils/functions/supabase'; - import { Loading } from 'carbon-components-svelte'; import { isObject } from '$lib/utils/functions/isObject'; import { lessons } from '../Lesson/store/lessons'; import { currentOrg } from '$lib/utils/store/org'; @@ -22,14 +20,11 @@ import UploadWidget from '$lib/components/UploadWidget/index.svelte'; import { handleOpenWidget } from '$lib/components/CourseLandingPage/store'; - let uploadingImage = false; let isSaving = false; - let fileInput; let isLoading = false; let isDeleting = false; let errors = {}; let avatar; - let imagebuffer; // controls widget open and close function widgetControl() { @@ -120,7 +115,7 @@ const { course_title, course_description, - image, + logo, tabs, grading, lesson_download, @@ -129,7 +124,7 @@ await updateCourse($course.id, avatar, { title: course_title, description: course_description, - logo: image, + logo: logo, is_published, metadata: { ...(isObject($course.metadata) ? $course.metadata : {}), @@ -141,7 +136,7 @@ $course.title = course_title; $course.description = course_description; - $course.logo = image; + $course.logo = logo; $course.is_published = is_published; $course.metadata = { ...(isObject($course.metadata) ? $course.metadata : {}), @@ -163,7 +158,7 @@ $settings = { course_title: course.title, course_description: course.description, - image: course.logo, + logo: course.logo, tabs: course.metadata.lessonTabsOrder || $settings.tabs, grading: course.metadata.grading, lesson_download: course.metadata.lessonDownload, @@ -199,7 +194,7 @@ /> {#if $handleOpenWidget.open} - + {/if} @@ -208,12 +203,9 @@ About us - {#if uploadingImage} - - {/if} diff --git a/src/lib/components/Course/components/Settings/store.js b/src/lib/components/Course/components/Settings/store.js index 704c8a58..437f5b2e 100644 --- a/src/lib/components/Course/components/Settings/store.js +++ b/src/lib/components/Course/components/Settings/store.js @@ -1,7 +1,7 @@ import { writable } from 'svelte/store'; export const settings = writable({ - image: '', + logo: '', course_title: '', course_description: '', grading: false, diff --git a/src/lib/components/CourseLandingPage/index.svelte b/src/lib/components/CourseLandingPage/index.svelte index 56e1cc67..cc92fb72 100644 --- a/src/lib/components/CourseLandingPage/index.svelte +++ b/src/lib/components/CourseLandingPage/index.svelte @@ -1,12 +1,8 @@ @@ -155,7 +161,7 @@