From 1b69c6106f099053cabc9a36146a300068e9d0f3 Mon Sep 17 00:00:00 2001
From: Nana K <73991180+topboyasante@users.noreply.github.com>
Date: Sun, 3 Dec 2023 19:18:28 +0000
Subject: [PATCH 1/2] fix: change "Stuffs" to "Stuff" on the landing page (#73)
* fix: Corrected "Stuffs" to "Stuff" on the landing page
* fix: Corrected "Stuffs" to "Stuff" on the landing page
---
apps/classroomio-com/README.md | 2 +-
apps/classroomio-com/src/app.html | 4 ++--
apps/classroomio-com/src/lib/Hero/Hero.svelte | 2 +-
apps/dashboard/README.md | 2 +-
apps/dashboard/src/app.html | 6 +++---
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/apps/classroomio-com/README.md b/apps/classroomio-com/README.md
index f0d41054..64e5fe59 100644
--- a/apps/classroomio-com/README.md
+++ b/apps/classroomio-com/README.md
@@ -1,5 +1,5 @@
-
+
ClassroomIO
diff --git a/apps/classroomio-com/src/app.html b/apps/classroomio-com/src/app.html
index 83520670..918fd616 100644
--- a/apps/classroomio-com/src/app.html
+++ b/apps/classroomio-com/src/app.html
@@ -18,7 +18,7 @@
+ content="Spend less time doing the boring stuff, instead focus on impacting the lives of your students." />
@@ -33,7 +33,7 @@
+ content="Spend less time doing the boring stuff, instead focus on impacting the lives of your students.">
diff --git a/apps/classroomio-com/src/lib/Hero/Hero.svelte b/apps/classroomio-com/src/lib/Hero/Hero.svelte
index ce70a5e5..fab77c05 100644
--- a/apps/classroomio-com/src/lib/Hero/Hero.svelte
+++ b/apps/classroomio-com/src/lib/Hero/Hero.svelte
@@ -45,7 +45,7 @@
- Spend less time doing the boring stuffs, instead focus on impacting the
+ Spend less time doing the boring stuff, instead focus on impacting the
lives of your students.
-
+
ClassroomIO
The Open Source Teaching Platform for Bootcamps
diff --git a/apps/dashboard/src/app.html b/apps/dashboard/src/app.html
index 13bfc2cc..3b99e73a 100644
--- a/apps/dashboard/src/app.html
+++ b/apps/dashboard/src/app.html
@@ -14,7 +14,7 @@
ClassroomIO – The Open Source Platform for Tech Bootcamps
@@ -24,7 +24,7 @@
/>
@@ -42,7 +42,7 @@
/>
From f4141b08b3b7671d84cc6e1d11c2a80018173c01 Mon Sep 17 00:00:00 2001
From: Rotimi Best
Date: Mon, 4 Dec 2023 19:39:39 +0300
Subject: [PATCH 2/2] =?UTF-8?q?chore:=20debugging=20improvements=20?=
=?UTF-8?q?=F0=9F=9A=80=20=20(#77)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* improve layout.server
* fix date behavior
* change direction of padlock icon on lesson
* feat: implement delete confirmation on lesson
* fix: course landing page improvements
---
.../src/lib/components/ClEditor/index.svelte | 46 -------------
.../Lesson/DeleteLessonConfirmation.svelte | 43 +++++++++++++
.../Course/components/Lesson/store/lessons.ts | 21 +++---
.../components/Editor/InstructorForm.svelte | 31 +++++----
.../components/Editor/RequirementForm.svelte | 2 +-
.../components/Editor/index.svelte | 10 +--
.../components/CourseLandingPage/index.svelte | 4 +-
.../src/lib/components/Form/Date.svelte | 6 +-
.../lib/components/TextEditor/index.svelte | 6 +-
.../lib/components/UploadImage/index.svelte | 15 +++--
apps/dashboard/src/routes/+layout.server.ts | 17 ++---
apps/dashboard/src/routes/+layout.svelte | 13 ++--
.../courses/[id]/landingpage/+page.svelte | 11 +++-
.../routes/courses/[id]/lessons/+page.svelte | 48 +++++++++-----
supabase/data.sql | 64 +++++++++----------
.../20231115082347_remote_schema.sql | 2 +-
16 files changed, 179 insertions(+), 160 deletions(-)
delete mode 100644 apps/dashboard/src/lib/components/ClEditor/index.svelte
create mode 100644 apps/dashboard/src/lib/components/Course/components/Lesson/DeleteLessonConfirmation.svelte
diff --git a/apps/dashboard/src/lib/components/ClEditor/index.svelte b/apps/dashboard/src/lib/components/ClEditor/index.svelte
deleted file mode 100644
index 135380cf..00000000
--- a/apps/dashboard/src/lib/components/ClEditor/index.svelte
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
- (html = evt.detail)} />
diff --git a/apps/dashboard/src/lib/components/Course/components/Lesson/DeleteLessonConfirmation.svelte b/apps/dashboard/src/lib/components/Course/components/Lesson/DeleteLessonConfirmation.svelte
new file mode 100644
index 00000000..239a4757
--- /dev/null
+++ b/apps/dashboard/src/lib/components/Course/components/Lesson/DeleteLessonConfirmation.svelte
@@ -0,0 +1,43 @@
+
+
+ (openDeleteModal = false)}
+ bind:open={openDeleteModal}
+ width="w-96"
+ modalHeading="Delete"
+>
+
+
+ Are you sure you want to delete: {lessonTitle} ?
+
+
+
+
(openDeleteModal = false)}
+ />
+
+
+
+
diff --git a/apps/dashboard/src/lib/components/Course/components/Lesson/store/lessons.ts b/apps/dashboard/src/lib/components/Course/components/Lesson/store/lessons.ts
index c78e3006..da4de605 100644
--- a/apps/dashboard/src/lib/components/Course/components/Lesson/store/lessons.ts
+++ b/apps/dashboard/src/lib/components/Course/components/Lesson/store/lessons.ts
@@ -2,6 +2,7 @@ import { writable } from 'svelte/store';
import type { Writable, Updater } from 'svelte/store';
import { createLesson, updateLesson, deleteLesson } from '$lib/utils/services/courses';
import type { Lesson, Course, LessonPage, LessonComment } from '$lib/utils/types';
+import { snackbar } from '$lib/components/Snackbar/store';
export const uploadCourseVideoStore = writable({
isModalOpen: false
@@ -43,20 +44,20 @@ export function handleAddLesson() {
}) as Updater);
}
-export function handleDelete(lessonId: Lesson['id']) {
- return async () => {
- // Need to implement soft delete
- if (lessonId) {
- const { error } = await deleteLesson(lessonId);
+export async function handleDelete(lessonId: Lesson['id'] | undefined) {
+ // Need to implement soft delete
+ if (lessonId) {
+ const { error } = await deleteLesson(lessonId);
- if (error) {
- return alert('Please delete all exercises first');
- }
+ if (error) {
+ snackbar.error(error.message);
+ return console.error('Error deleting course', error);
}
lessons.update((_lessons) => _lessons.filter((lesson) => lesson.id !== lessonId));
- console.log(`lessonId`, lessonId);
- };
+ }
+
+ console.log(`lessonId`, lessonId);
}
export async function handleSaveLesson(lesson: Lesson, course_id: Course['id']) {
diff --git a/apps/dashboard/src/lib/components/CourseLandingPage/components/Editor/InstructorForm.svelte b/apps/dashboard/src/lib/components/CourseLandingPage/components/Editor/InstructorForm.svelte
index bfd965a4..3f5408fd 100644
--- a/apps/dashboard/src/lib/components/CourseLandingPage/components/Editor/InstructorForm.svelte
+++ b/apps/dashboard/src/lib/components/CourseLandingPage/components/Editor/InstructorForm.svelte
@@ -1,4 +1,4 @@
-
diff --git a/apps/dashboard/src/lib/components/CourseLandingPage/components/Editor/index.svelte b/apps/dashboard/src/lib/components/CourseLandingPage/components/Editor/index.svelte
index f80dfbbc..31ed953a 100644
--- a/apps/dashboard/src/lib/components/CourseLandingPage/components/Editor/index.svelte
+++ b/apps/dashboard/src/lib/components/CourseLandingPage/components/Editor/index.svelte
@@ -27,6 +27,7 @@
export let course: Course;
export let courseId: string;
+ export let syncCourseStore: (course: Course) => void;
let borderBottomGrey = 'border-r-0 border-b border-l-0 border-gray-300';
let loading = false;
@@ -123,9 +124,9 @@
polls: undefined,
slug: course.slug
});
- loading = false;
- return `${window.location.origin}/course/${course.slug}`;
+ loading = false;
+ syncCourseStore(course);
}
/**
* 1. Use all you have for editing now
@@ -149,10 +150,11 @@
size={$isMobile ? 'large' : 'small'}
color="text-black"
toolTipProps={$isMobile
- ? {}
+ ? undefined
: {
title: 'Toggle editor',
- direction: 'right'
+ direction: 'right',
+ hotkeys: []
}}
>
{#if show}
diff --git a/apps/dashboard/src/lib/components/CourseLandingPage/index.svelte b/apps/dashboard/src/lib/components/CourseLandingPage/index.svelte
index 681e4bad..0041e6d0 100644
--- a/apps/dashboard/src/lib/components/CourseLandingPage/index.svelte
+++ b/apps/dashboard/src/lib/components/CourseLandingPage/index.svelte
@@ -86,7 +86,7 @@
$: video = get(courseData, 'metadata.videoUrl');
$: bannerImage = get(courseData, 'logo');
$: lessons = get(courseData, 'lessons', []);
- $: instructor = courseData?.metadata?.instructor || {};
+ $: instructor = get(courseData, 'metadata.instructor') || {};
$: initPlyr(player, video);
$: {
reviews = get(courseData, 'metadata.reviews') || [];
@@ -276,7 +276,7 @@
{/if}
{#if lesson.note}
1 note note
{/if}
diff --git a/apps/dashboard/src/lib/components/Form/Date.svelte b/apps/dashboard/src/lib/components/Form/Date.svelte
index fd949775..2fe5d84f 100644
--- a/apps/dashboard/src/lib/components/Form/Date.svelte
+++ b/apps/dashboard/src/lib/components/Form/Date.svelte
@@ -1,7 +1,7 @@
diff --git a/apps/dashboard/src/lib/components/TextEditor/index.svelte b/apps/dashboard/src/lib/components/TextEditor/index.svelte
index 16b6c8d9..c70b236f 100644
--- a/apps/dashboard/src/lib/components/TextEditor/index.svelte
+++ b/apps/dashboard/src/lib/components/TextEditor/index.svelte
@@ -4,7 +4,7 @@
import { appStore } from '$lib/utils/store/app';
export let id = '';
- export let value: string;
+ export let value: string | undefined = '';
export let onChange = (html: string) => {};
export let height = 300;
export let placeholder = '';
@@ -14,7 +14,7 @@
const apiKey = PUBLIC_TINYMCE_API_KEY;
let tinmycEditor: any;
- let unmount = false
+ let unmount = false;
// editor configuration
let conf = {
@@ -73,6 +73,6 @@
{#if !unmount}
-
+
{/if}
diff --git a/apps/dashboard/src/lib/components/UploadImage/index.svelte b/apps/dashboard/src/lib/components/UploadImage/index.svelte
index 204c2ffb..aa279387 100644
--- a/apps/dashboard/src/lib/components/UploadImage/index.svelte
+++ b/apps/dashboard/src/lib/components/UploadImage/index.svelte
@@ -1,21 +1,22 @@
-
diff --git a/apps/dashboard/src/routes/+layout.server.ts b/apps/dashboard/src/routes/+layout.server.ts
index 59dda199..6884e4f6 100644
--- a/apps/dashboard/src/routes/+layout.server.ts
+++ b/apps/dashboard/src/routes/+layout.server.ts
@@ -12,29 +12,22 @@ interface LoadOutput {
orgSiteName: string;
isOrgSite: boolean;
skipAuth: boolean;
- org: CurrentOrg;
+ org: CurrentOrg | null;
}
export const load = async ({ url, cookies }): Promise => {
- // if (url.hostname === 'classroomio.com') {
- // throw redirect(301, 'https://about.classroomio.com');
- // }
-
- let response: LoadOutput = {
+ const response: LoadOutput = {
orgSiteName: '',
isOrgSite: false,
skipAuth: false,
- org: {
- theme: ''
- }
+ org: null
};
const _orgSiteName = cookies.get('_orgSiteName');
const debugPlay = cookies.get('debugPlay');
const debugMode = _orgSiteName && _orgSiteName !== 'false';
- console.log('_orgSiteName', _orgSiteName);
- const matches = url.host.match(/([a-z 0-9 \-]+).*classroomio[.]com/);
+ const matches = url.host.match(/([a-z 0-9 -]+).*classroomio[.]com/);
const subdomain = matches?.[1] ?? '';
if (!blockedSubdomain.includes(subdomain)) {
@@ -42,7 +35,7 @@ export const load = async ({ url, cookies }): Promise => {
response.isOrgSite = debugMode || answer;
response.orgSiteName = debugMode ? _orgSiteName : subdomain;
- response.org = await getCurrentOrg(response.orgSiteName, true);
+ response.org = (await getCurrentOrg(response.orgSiteName, true)) || null;
} else if (subdomain === 'play' || debugPlay === 'true') {
response.skipAuth = true;
}
diff --git a/apps/dashboard/src/routes/+layout.svelte b/apps/dashboard/src/routes/+layout.svelte
index 22731491..7ee0f1fe 100644
--- a/apps/dashboard/src/routes/+layout.svelte
+++ b/apps/dashboard/src/routes/+layout.svelte
@@ -90,7 +90,6 @@
error,
status
} = await supabase.from('profile').select(`*`).eq('id', authUser?.id).single();
- console.log('Get user', authUser);
console.log('Get profile', profileData);
if (error && !profileData && status === 406 && authUser) {
@@ -219,10 +218,7 @@
handleResize();
- if (
- !isSupabaseTokenInLocalStorage() &&
- !isPublicRoute($page.url.pathname)
- ) {
+ if (!isSupabaseTokenInLocalStorage() && !isPublicRoute($page.url.pathname)) {
console.log('No auth token and is not a public route, redirect to login', path);
return goto('/login?redirect=/' + path);
}
@@ -408,9 +404,12 @@
}
:global(.plyr__controls) {
- background: url(/logo-192.png) 99% 70% no-repeat,
+ background:
+ url(/logo-192.png) 99% 70% no-repeat,
linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5)) !important;
- background-size: 50px auto, auto !important;
+ background-size:
+ 50px auto,
+ auto !important;
}
:global(.cards-container) {
diff --git a/apps/dashboard/src/routes/courses/[id]/landingpage/+page.svelte b/apps/dashboard/src/routes/courses/[id]/landingpage/+page.svelte
index f7a3feb9..f13fe014 100644
--- a/apps/dashboard/src/routes/courses/[id]/landingpage/+page.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/landingpage/+page.svelte
@@ -1,4 +1,5 @@
-
+
diff --git a/apps/dashboard/src/routes/courses/[id]/lessons/+page.svelte b/apps/dashboard/src/routes/courses/[id]/lessons/+page.svelte
index b59f3c02..ffbea3bf 100644
--- a/apps/dashboard/src/routes/courses/[id]/lessons/+page.svelte
+++ b/apps/dashboard/src/routes/courses/[id]/lessons/+page.svelte
@@ -1,5 +1,4 @@
-