CLASSROOMIO-T-99: Download Lesson PDF
Merge branch 'CLASSROOMIO-T-99' of https://gitlab.com/thenextgreat/classroomio into CLASSROOMIO-T-99 CLASSROOMIO-T-99: Badge Value Fix CLASSROOMIO-T-99: Minor UI improvements. CLASSROOMIO-T-99: Frontend Fixes Co-authored-by: Rotimi Best <[email protected]> Co-authored-by: Tunji Adeyemi <[email protected]> Merge-request: CLASSROOMIO-MR-47 Merged-by: Best Admin <[email protected]>
This commit is contained in:
committed by
Space Cloud
co-authored by
Rotimi Best
parent
580abf320f
commit
df1b5f6cae
@@ -17,6 +17,7 @@
|
||||
import Box from '$lib/components/Box/index.svelte';
|
||||
import EditContent from '$lib/components/EditContent/index.svelte';
|
||||
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
|
||||
import { VARIANTS } from '$lib/components/PrimaryButton/constants';
|
||||
import TextField from '$lib/components/Form/TextField.svelte';
|
||||
import {
|
||||
lesson,
|
||||
@@ -75,15 +76,18 @@
|
||||
const { slide_url, videos, note } = materials;
|
||||
|
||||
tabs = tabs.map((tab) => {
|
||||
let badgeValue;
|
||||
|
||||
if (tab.value === 1) {
|
||||
badgeValue = !!slide_url ? 1 : 0;
|
||||
} else if (tab.value === 2) {
|
||||
badgeValue = !!note ? 1 : 0;
|
||||
} else {
|
||||
badgeValue = Array.isArray(videos) ? videos.length : 0;
|
||||
}
|
||||
const badgeValue =
|
||||
tab.value === 1
|
||||
? !!note
|
||||
? 1
|
||||
: 0
|
||||
: tab.value === 2
|
||||
? !!slide_url
|
||||
? 1
|
||||
: 0
|
||||
: Array.isArray(videos)
|
||||
? videos.length
|
||||
: 0;
|
||||
|
||||
tab.badgeValue = badgeValue;
|
||||
return tab;
|
||||
@@ -173,6 +177,7 @@
|
||||
}}
|
||||
isLoading={$isLoading}
|
||||
isDisabled={$isLoading}
|
||||
variant={VARIANTS.OUTLINED}
|
||||
>
|
||||
<MachineLearningModel size={20} class="carbon-icon mr-3" />
|
||||
AI Assistant
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
import { snackbarStore } from '$lib/components/Snackbar/store';
|
||||
import { SNACKBAR_SEVERITY } from '$lib/components/Snackbar/constants';
|
||||
import TextField from '$lib/components/Form/TextField.svelte';
|
||||
import {
|
||||
copyCourseModalInitialState,
|
||||
copyCourseModal,
|
||||
} from '$lib/components/Courses/store';
|
||||
import { copyCourseModalInitialState, copyCourseModal } from '$lib/components/Courses/store';
|
||||
import { cloneCourse } from '$lib/utils/services/courses/clone';
|
||||
|
||||
// clone, show spinner and redirect to new course
|
||||
@@ -17,10 +14,7 @@
|
||||
$copyCourseModal.isSaving = true;
|
||||
|
||||
try {
|
||||
const newCourse = await cloneCourse(
|
||||
$copyCourseModal.id,
|
||||
$copyCourseModal.title
|
||||
);
|
||||
const newCourse = await cloneCourse($copyCourseModal.id, $copyCourseModal.title);
|
||||
|
||||
goto(`/courses/${newCourse.id}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user