feat: course types - self paced and live class (#309)

* working on the course type

* trying to mark it persist

* almost done here

* fixed sendig emtpy options bug

* created migration file

* created migration file

* made updates based on PR review

* merge

* update course type card

* add redirect logic with classroomio.com/new

* make new course modal only open/close with url

* feat: page active state (#315)

* finished the active link state

* updated the active link state based on review

* simplify code

---------

Co-authored-by: Rotimi Best <best@classroomio.com>

* add type to course card

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
Em_Dev
2024-05-21 00:14:47 +01:00
committed by GitHub
co-authored by Rotimi Best
parent b9bb568f98
commit 49d8539be9
41 changed files with 894 additions and 393 deletions
@@ -30,6 +30,7 @@ export async function fetchCourse(courseId?: Course['id'], slug?: Course['slug']
`
id,
title,
type,
description,
overview,
logo,
@@ -61,6 +62,7 @@ export async function fetchCourse(courseId?: Course['id'], slug?: Course['slug']
const { data, error } = response;
console.log(`error`, error);
console.log(`data`, data);
if (!data || error) {
console.log(`data`, data);
console.log(`fetchCourse => error`, error);
@@ -410,7 +412,11 @@ export async function submitExercise(
}
const res = await supabase.from('question_answer').insert(questionAnswers).select();
console.log(`res`, res);
console.log(`res`, res, 'submission', submission);
return {
submission,
res
};
}
export async function deleteExercise(questions: Array<{ id: string }>, exerciseId: Exercise['id']) {
@@ -263,7 +263,11 @@
"unpublished": "Unveröffentlicht",
"delete": "Kurs löschen",
"delete_text": "Löschen Sie diesen Kurs. Diese Aktion kann nicht rückgängig gemacht werden",
"save": "Änderungen speichern"
"save": "Änderungen speichern",
"type": "Kurstyp",
"course_type_desc": "Aktualisieren Sie den Kurstyp für ein persönlicheres Erlebnis",
"live_class": "Live-Klasse",
"self_paced": "Eigenständig"
},
"landing_page": {
"start_course": "Kurs starten",
@@ -763,7 +767,11 @@
"course_name_placeholder": "Ihr Kursname",
"short_description": "kurze Beschreibung",
"short_description_placeholder": "Eine kleine Beschreibung zu diesem Kurs",
"button": "Beenden"
"button": "Beenden",
"type": "Kurstyp",
"type_selector_title": "Welche Art von Kurs suchen Sie?",
"back": "Zurück",
"next": "Nächste"
},
"course_card": {
"empty_title": "Keine Kurse erstellt",
@@ -779,7 +787,8 @@
"description": "Beschreibung",
"lessons": "Unterricht",
"students": "Studenten",
"published": "Veröffentlicht"
"published": "Veröffentlicht",
"type": "Typ"
},
"context_menu": {
"clone": "Klon",
@@ -1212,5 +1221,12 @@
"resend_in": "Bestätigung erneut senden",
"seconds": "Sekunden",
"snackbar_error": "Fehler beim Senden des Codes"
},
"generic": {
"locked": "Gesperrt",
"unlocked": "Entsperrt"
},
"specialization": {
"course_tag": "Spezialisierung"
}
}
@@ -227,7 +227,7 @@
"get_started": "Get Started",
"personal_profile": {
"title": "Upload a profile picture and update username",
"desc": "Personalize and a human touch making interactions more personal and memorable",
"desc": "Personalize and add a human touch making interactions more personal and memorable",
"button_label": "Update Profile"
},
"organization_profile": {
@@ -433,16 +433,21 @@
"description": "Description",
"lessons": "Lessons",
"students": "Students",
"published": "Published"
"published": "Published",
"type": "Type"
}
},
"new_course_modal": {
"heading": "Create a Course",
"course_name": "Course name",
"type": "Course type",
"course_name_placeholder": "Your course name",
"short_description": "Short Description",
"short_description_placeholder": "A little description about this course",
"button": "Finish"
"type_selector_title": "What type of course are you looking at?",
"button": "Finish",
"back": "Back",
"next": "Next"
}
},
@@ -653,7 +658,7 @@
"yes": "Yes, delete"
},
"edit_mode": {
"delete_modal": "Delete Modal",
"delete_modal": "Delete Exercise",
"sure": "Are you sure you want to delete this exercise?",
"no": "No, cancel",
"yes": "Yes, delete",
@@ -978,13 +983,17 @@
"available": "Make the Lesson available for Download in pdf for registered students",
"course_download": "Course Downlaod",
"course_avail": "Make the Course available for Download for registered students",
"download": "Downlaod",
"download": "Download",
"allow": "Allow New Students",
"access": "Allow new students to access this course",
"publish": "Publish Course",
"determines": "This determines if your course displays on your landing page",
"published": "Published",
"unpublished": "Unpublished",
"type": "Course type",
"course_type_desc": "Update the course type for a more personalized experience",
"live_class": "Live class",
"self_paced": "Self paced",
"delete": "Delete Course",
"delete_text": "Delete this course,this action cannot be undone",
"save": "Save Changes"
@@ -1247,8 +1256,17 @@
}
},
"specialization": {
"course_tag": "Specialization"
},
"content": {
"heading": "Internationalization in SvelteKit",
"toggle_label": "Select Preferred Language"
},
"generic": {
"locked": "Locked",
"unlocked": "Unlocked"
}
}
@@ -263,7 +263,11 @@
"unpublished": "Inédito",
"delete": "Eliminar curso",
"delete_text": "Eliminar este curso, esta acción no se puede deshacer",
"save": "Guardar cambios"
"save": "Guardar cambios",
"type": "Tipo de curso",
"course_type_desc": "Actualiza el tipo de curso para una experiencia más personalizada",
"live_class": "clase en vivo",
"self_paced": "Ritmo propio"
},
"landing_page": {
"start_course": "Iniciar curso",
@@ -763,7 +767,11 @@
"course_name_placeholder": "Nombre de tu curso",
"short_description": "Breve descripción",
"short_description_placeholder": "Una pequeña descripción sobre este curso.",
"button": "Finalizar"
"button": "Finalizar",
"type": "Tipo de curso",
"type_selector_title": "¿Qué tipo de curso estás mirando?",
"back": "Atrás",
"next": "Próximo"
},
"course_card": {
"empty_title": "No hay cursos creados",
@@ -779,7 +787,8 @@
"description": "Descripción",
"lessons": "Lecciones",
"students": "Estudiantes",
"published": "Publicado"
"published": "Publicado",
"type": "Tipo"
},
"context_menu": {
"clone": "Clon",
@@ -1212,5 +1221,12 @@
"resend_in": "Reenviar verificación en",
"seconds": "segundos",
"snackbar_error": "error al enviar código"
},
"generic": {
"locked": "bloqueado",
"unlocked": "desbloqueado"
},
"specialization": {
"course_tag": "Especialización"
}
}
@@ -263,7 +263,11 @@
"unpublished": "Inédit",
"delete": "Supprimer un cours",
"delete_text": "Supprimer ce cours, cette action est irréversible",
"save": "Sauvegarder les modifications"
"save": "Sauvegarder les modifications",
"type": "Type de cours",
"course_type_desc": "Mettez à jour le type de cours pour une expérience plus personnalisée",
"live_class": "Cours en direct",
"self_paced": "À votre rythme"
},
"landing_page": {
"start_course": "Commencer le cours",
@@ -763,7 +767,11 @@
"course_name_placeholder": "Le nom de votre cours",
"short_description": "brève description",
"short_description_placeholder": "Une petite description de ce cours",
"button": "Finition"
"button": "Finition",
"type": "Type de cours",
"type_selector_title": "Quel type de cours envisagez-vous ?",
"back": "Dos",
"next": "Suivant"
},
"course_card": {
"empty_title": "Aucun cours créé",
@@ -779,7 +787,8 @@
"description": "Description",
"lessons": "Cours",
"students": "Étudiants",
"published": "Publié"
"published": "Publié",
"type": "Taper"
},
"context_menu": {
"clone": "Cloner",
@@ -1212,5 +1221,12 @@
"resend_in": "Renvoyer la vérification dans",
"seconds": "secondes",
"snackbar_error": "erreur lors de l'envoi du code"
},
"generic": {
"locked": "Fermé à clé",
"unlocked": "Débloqué"
},
"specialization": {
"course_tag": "Spécialisation"
}
}
@@ -263,7 +263,11 @@
"unpublished": "अप्रकाशित",
"delete": "पाठ्यक्रम हटाएँ",
"delete_text": "इस कोर्स को हटा दें, इस कार्रवाई को पूर्ववत नहीं किया जा सकता",
"save": "परिवर्तनों को सुरक्षित करें"
"save": "परिवर्तनों को सुरक्षित करें",
"type": "कोर्स का प्रकार",
"course_type_desc": "अधिक वैयक्तिकृत अनुभव के लिए पाठ्यक्रम प्रकार को अपडेट करें",
"live_class": "लाइव क्लास",
"self_paced": "स्वयं गति"
},
"landing_page": {
"start_course": "कोर्स प्रारंभ करें",
@@ -763,7 +767,11 @@
"course_name_placeholder": "आपके पाठ्यक्रम का नाम",
"short_description": "संक्षिप्त वर्णन",
"short_description_placeholder": "इस कोर्स के बारे में थोड़ा विवरण",
"button": "खत्म करना"
"button": "खत्म करना",
"type": "कोर्स का प्रकार",
"type_selector_title": "आप किस प्रकार का कोर्स देख रहे हैं?",
"back": "पीछे",
"next": "अगला"
},
"course_card": {
"empty_title": "कोई पाठ्यक्रम नहीं बनाया गया",
@@ -779,7 +787,8 @@
"description": "विवरण",
"lessons": "पाठ",
"students": "छात्र",
"published": "प्रकाशित"
"published": "प्रकाशित",
"type": "प्रकार"
},
"context_menu": {
"clone": "क्लोन",
@@ -1212,5 +1221,12 @@
"resend_in": "सत्यापन पुनः भेजें",
"seconds": "सेकंड",
"snackbar_error": "कोड भेजते समय त्रुटि"
},
"generic": {
"locked": "बंद",
"unlocked": "अनलॉक किया"
},
"specialization": {
"course_tag": "विशेषज्ञता"
}
}
@@ -263,7 +263,11 @@
"unpublished": "Não publicado",
"delete": "Excluir curso",
"delete_text": "Exclua este curso, esta ação não pode ser desfeita",
"save": "Salvar alterações"
"save": "Salvar alterações",
"type": "Tipo de curso",
"course_type_desc": "Atualize o tipo de curso para uma experiência mais personalizada",
"live_class": "Aula ao vivo",
"self_paced": "Individualizado"
},
"landing_page": {
"start_course": "Iniciar curso",
@@ -763,7 +767,11 @@
"course_name_placeholder": "Nome do seu curso",
"short_description": "Pequena descrição",
"short_description_placeholder": "Uma pequena descrição sobre este curso",
"button": "Terminar"
"button": "Terminar",
"type": "Tipo de curso",
"type_selector_title": "Que tipo de curso você está procurando?",
"back": "Voltar",
"next": "Próximo"
},
"course_card": {
"empty_title": "Nenhum curso criado",
@@ -779,7 +787,8 @@
"description": "Descrição",
"lessons": "Lições",
"students": "Alunos",
"published": "Publicados"
"published": "Publicados",
"type": "Tipo"
},
"context_menu": {
"clone": "Clone",
@@ -1212,5 +1221,12 @@
"resend_in": "Reenviar verificação em",
"seconds": "segundos",
"snackbar_error": "erro ao enviar código"
},
"generic": {
"locked": "Bloqueado",
"unlocked": "Desbloqueado"
},
"specialization": {
"course_tag": "Especialização"
}
}
@@ -263,7 +263,11 @@
"unpublished": "Неопубликовано",
"delete": "Удалить курс",
"delete_text": "Удалите этот курс, это действие нельзя отменить.",
"save": "Сохранить изменения"
"save": "Сохранить изменения",
"type": "Тип курса",
"course_type_desc": "Обновите тип курса для более персонализированного опыта.",
"live_class": "Живой урок",
"self_paced": "Самостоятельный темп"
},
"landing_page": {
"start_course": "Начать курс",
@@ -763,7 +767,11 @@
"course_name_placeholder": "Название вашего курса",
"short_description": "Краткое описание",
"short_description_placeholder": "Небольшое описание этого курса",
"button": "Заканчивать"
"button": "Заканчивать",
"type": "Тип курса",
"type_selector_title": "Какой тип курса вы рассматриваете?",
"back": "Назад",
"next": "Следующий"
},
"course_card": {
"empty_title": "Курсы не созданы",
@@ -779,7 +787,8 @@
"description": "Описание",
"lessons": "Уроки",
"students": "Студенты",
"published": "Опубликовано"
"published": "Опубликовано",
"type": "Тип"
},
"context_menu": {
"clone": "Клонировать",
@@ -1212,5 +1221,12 @@
"resend_in": "Повторно отправить подтверждение в",
"seconds": "секунды",
"snackbar_error": "ошибка при отправке кода"
},
"generic": {
"locked": "Заблокировано",
"unlocked": "Разблокировано"
},
"specialization": {
"course_tag": "Специализация"
}
}
@@ -263,7 +263,11 @@
"unpublished": "Chưa được xuất bản",
"delete": "Xóa khóa học",
"delete_text": "Xóa khóa học này, hành động này không thể hoàn tác",
"save": "Lưu thay đổi"
"save": "Lưu thay đổi",
"type": "Loại khóa học",
"course_type_desc": "Cập nhật loại khóa học để có trải nghiệm cá nhân hóa hơn",
"live_class": "Lớp học trực tiếp",
"self_paced": "Tự nhịp độ"
},
"landing_page": {
"start_course": "Bắt đầu khóa học",
@@ -763,7 +767,11 @@
"course_name_placeholder": "Tên khóa học của bạn",
"short_description": "Mô tả ngắn",
"short_description_placeholder": "Một chút mô tả về khóa học này",
"button": "Hoàn thành"
"button": "Hoàn thành",
"type": "Loại khóa học",
"type_selector_title": "Bạn đang xem loại khóa học nào?",
"back": "Mặt sau",
"next": "Kế tiếp"
},
"course_card": {
"empty_title": "Không có khóa học nào được tạo",
@@ -779,7 +787,8 @@
"description": "Sự miêu tả",
"lessons": "Những bài học",
"students": "Sinh viên",
"published": "Được phát hành"
"published": "Được phát hành",
"type": "Kiểu"
},
"context_menu": {
"clone": "Dòng vô tính",
@@ -1212,5 +1221,12 @@
"resend_in": "Gửi lại xác minh trong",
"seconds": "giây",
"snackbar_error": "lỗi khi gửi mã"
},
"generic": {
"locked": "Đã khóa",
"unlocked": "Đã mở khóa"
},
"specialization": {
"course_tag": "Chuyên môn"
}
}
@@ -181,9 +181,14 @@ export interface Waitinglist {
created_at?: string;
}
export enum COURSE_TYPE {
SELF_PACED = 'SELF_PACED',
LIVE_CLASS = 'LIVE_CLASS'
}
export interface Course {
title?: any; // type unknown;
description: string; // type unknown;
type: COURSE_TYPE;
overview?: any; // type unknown;
id?: string /* primary key */;
created_at: string;