Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge 'develop' into 'main' #1143

Merged
merged 42 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e25f161
feat: allow same date live class creation
iamejaaz Nov 10, 2024
92c380c
feat: search functionality in jobs
iamejaaz Nov 10, 2024
2e1aac4
feat: SCORM
pateljannat Nov 11, 2024
73754bd
chore: merged conflicts
pateljannat Nov 12, 2024
be49ba6
refactor: add translate in all error messages
iamejaaz Nov 12, 2024
acb8c6c
chore: Turkish translations
pateljannat Nov 13, 2024
61e13aa
refactor: add transalation and use camel case
iamejaaz Nov 13, 2024
9323d8e
Merge pull request #1131 from frappe/l10n_develop2
pateljannat Nov 14, 2024
cf014bc
feat: record lesson progress
pateljannat Nov 15, 2024
629c237
Merge pull request #1132 from pateljannat/SCORM-2
pateljannat Nov 15, 2024
6a70ed1
fix: misc issues
pateljannat Nov 15, 2024
dfb22c8
Merge pull request #1113 from iamejaaz/search-functionality-in-jobs
pateljannat Nov 15, 2024
96de90c
chore: update POT file
frappe-pr-bot Nov 15, 2024
a4fa2ef
feat: add keyboard shortcut to save lesson
iamejaaz Nov 16, 2024
cbc7892
chore: Persian translations
pateljannat Nov 16, 2024
b6028e7
fix: show notification count at the top in collapsed
iamejaaz Nov 17, 2024
52bd982
fix: choice questions validations
pateljannat Nov 18, 2024
3faf814
Merge pull request #1133 from pateljannat/issues-50
pateljannat Nov 18, 2024
4ce7019
Merge pull request #1134 from frappe/pot_develop_2024-11-15
pateljannat Nov 18, 2024
2ebf6be
Merge pull request #1111 from iamejaaz/same-day-live-class
pateljannat Nov 18, 2024
dcf5c72
Merge pull request #1136 from frappe/l10n_develop2
pateljannat Nov 18, 2024
1ecbc2e
fix: validate amount and currency for paid courses and batches
pateljannat Nov 18, 2024
12c2666
Merge pull request #1139 from pateljannat/issues-51
pateljannat Nov 18, 2024
420a5f3
chore: French translations
pateljannat Nov 18, 2024
12b138c
chore: Spanish translations
pateljannat Nov 18, 2024
fa384b3
chore: Arabic translations
pateljannat Nov 18, 2024
57f0954
chore: German translations
pateljannat Nov 18, 2024
15a53d3
chore: Hungarian translations
pateljannat Nov 18, 2024
6649b79
chore: Polish translations
pateljannat Nov 18, 2024
d3ac6ea
chore: Russian translations
pateljannat Nov 18, 2024
58f08bf
chore: Swedish translations
pateljannat Nov 18, 2024
c3238a9
chore: Turkish translations
pateljannat Nov 18, 2024
cfe35e4
chore: Chinese Simplified translations
pateljannat Nov 18, 2024
ff16423
chore: Persian translations
pateljannat Nov 18, 2024
c399595
chore: Bosnian translations
pateljannat Nov 18, 2024
3027a9e
chore: Esperanto translations
pateljannat Nov 18, 2024
b72774e
Merge pull request #1141 from frappe/l10n_develop2
pateljannat Nov 19, 2024
0097ede
Merge pull request #1135 from iamejaaz/add-keyboard-shortcut
pateljannat Nov 19, 2024
b1a0556
Merge pull request #1137 from iamejaaz/notification-sidebar-ui
pateljannat Nov 19, 2024
f63a627
chore: Chinese Simplified translations
pateljannat Nov 19, 2024
acbede1
Merge pull request #1142 from frappe/l10n_develop2
pateljannat Nov 20, 2024
af533a7
chore(release): Bumped to Version 2.12.0
frappe-bot Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ module.exports = defineConfig({
openMode: 0,
},
e2e: {
baseUrl: "http://test:8000",
baseUrl: "http://lms1:8000",
},
});
30 changes: 18 additions & 12 deletions frontend/src/components/AppSidebar.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<div
class="flex h-full flex-col justify-between transition-all duration-300 ease-in-out bg-gray-50"
:class="isSidebarCollapsed ? 'w-14' : 'w-56'"
:class="sidebarStore.isSidebarCollapsed ? 'w-14' : 'w-56'"
>
<div
class="flex flex-col overflow-hidden"
:class="isSidebarCollapsed ? 'items-center' : ''"
:class="sidebarStore.isSidebarCollapsed ? 'items-center' : ''"
>
<UserDropdown :isCollapsed="isSidebarCollapsed" />
<UserDropdown :isCollapsed="sidebarStore.isSidebarCollapsed" />
<div class="flex flex-col" v-if="sidebarSettings.data">
<SidebarLink
v-for="link in sidebarLinks"
:link="link"
:isCollapsed="isSidebarCollapsed"
:isCollapsed="sidebarStore.isSidebarCollapsed"
class="mx-2 my-0.5"
/>
</div>
Expand All @@ -22,11 +22,11 @@
>
<div
class="flex items-center justify-between pr-2 cursor-pointer"
:class="isSidebarCollapsed ? 'pl-3' : 'pl-4'"
:class="sidebarStore.isSidebarCollapsed ? 'pl-3' : 'pl-4'"
@click="showWebPages = !showWebPages"
>
<div
v-if="!isSidebarCollapsed"
v-if="!sidebarStore.isSidebarCollapsed"
class="flex items-center text-sm text-gray-600 my-1"
>
<span class="grid h-5 w-6 flex-shrink-0 place-items-center">
Expand All @@ -53,7 +53,7 @@
<SidebarLink
v-for="link in sidebarSettings.data.web_pages"
:link="link"
:isCollapsed="isSidebarCollapsed"
:isCollapsed="sidebarStore.isSidebarCollapsed"
class="mx-2 my-0.5"
:showControls="isModerator ? true : false"
@openModal="openPageModal"
Expand All @@ -64,17 +64,19 @@
</div>
<SidebarLink
:link="{
label: isSidebarCollapsed ? 'Expand' : 'Collapse',
label: sidebarStore.isSidebarCollapsed ? 'Expand' : 'Collapse',
}"
:isCollapsed="isSidebarCollapsed"
@click="isSidebarCollapsed = !isSidebarCollapsed"
:isCollapsed="sidebarStore.isSidebarCollapsed"
@click="toggleSidebar()"
class="m-2"
>
<template #icon>
<span class="grid h-5 w-6 flex-shrink-0 place-items-center">
<CollapseSidebar
class="h-4.5 w-4.5 text-gray-700 duration-300 ease-in-out"
:class="{ '[transform:rotateY(180deg)]': isSidebarCollapsed }"
:class="{
'[transform:rotateY(180deg)]': sidebarStore.isSidebarCollapsed,
}"
/>
</span>
</template>
Expand All @@ -96,12 +98,14 @@ import { ref, onMounted, inject, watch } from 'vue'
import { getSidebarLinks } from '../utils'
import { usersStore } from '@/stores/user'
import { sessionStore } from '@/stores/session'
import { useSidebar } from '@/stores/sidebar'
import { ChevronRight, Plus } from 'lucide-vue-next'
import { createResource, Button } from 'frappe-ui'
import PageModal from '@/components/Modals/PageModal.vue'

const { user, sidebarSettings } = sessionStore()
const { userResource } = usersStore()
let sidebarStore = useSidebar()
const socket = inject('$socket')
const unreadCount = ref(0)
const sidebarLinks = ref(getSidebarLinks())
Expand Down Expand Up @@ -214,5 +218,7 @@ watch(userResource, () => {
}
})

let isSidebarCollapsed = ref(getSidebarFromStorage())
const toggleSidebar = () => {
sidebarStore.isSidebarCollapsed = !sidebarStore.isSidebarCollapsed
}
</script>
2 changes: 1 addition & 1 deletion frontend/src/components/CourseCardOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function enrollStudent() {
showToast(
__('Please Login'),
__('You need to login first to enroll for this course'),
'circle-warn'
'alert-circle'
)
setTimeout(() => {
window.location.href = `/login?redirect-to=${window.location.pathname}`
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/CourseInstructors.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<span v-if="instructors.length == 1">
<span v-if="instructors?.length == 1">
<router-link
:to="{
name: 'Profile',
Expand All @@ -9,7 +9,7 @@
{{ instructors[0].full_name }}
</router-link>
</span>
<span v-if="instructors.length == 2">
<span v-if="instructors?.length == 2">
<router-link
:to="{
name: 'Profile',
Expand All @@ -28,7 +28,7 @@
{{ instructors[1].first_name }}
</router-link>
</span>
<span v-if="instructors.length > 2">
<span v-if="instructors?.length > 2">
<router-link
:to="{
name: 'Profile',
Expand All @@ -37,7 +37,7 @@
>
{{ instructors[0].first_name }}
</router-link>
and {{ instructors.length - 1 }} others
and {{ instructors?.length - 1 }} others
</span>
</template>
<script setup>
Expand Down
112 changes: 95 additions & 17 deletions frontend/src/components/CourseOutline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</div>
<div
:class="{
'shadow rounded-md pt-2 px-2': showOutline && outline.data?.length,
'shadow rounded-md py-2 px-2': showOutline && outline.data?.length,
}"
>
<Disclosure
Expand All @@ -25,21 +25,42 @@
:key="chapter.name"
:defaultOpen="openChapterDetail(chapter.idx)"
>
<DisclosureButton ref="" class="flex w-full p-2">
<DisclosureButton ref="" class="flex items-center w-full p-2 group">
<ChevronRight
:class="{
'rotate-90 transform duration-200': open,
'duration-200': !open,
hidden: chapter.is_scorm_package,
open: index == 1,
}"
class="h-4 w-4 text-gray-900 stroke-1 mr-2"
class="h-4 w-4 text-gray-900 stroke-1"
/>
<div class="text-base text-left font-medium leading-5">
<div
class="text-base text-left font-medium leading-5 ml-2"
@click="redirectToChapter(chapter)"
>
{{ chapter.title }}
</div>
<div class="flex ml-auto space-x-4">
<Tooltip :text="__('Edit Chapter')" placement="bottom">
<FilePenLine
v-if="allowEdit"
@click.prevent="openChapterModal(chapter)"
class="h-4 w-4 text-gray-900 invisible group-hover:visible"
/>
</Tooltip>
<Tooltip :text="__('Delete Chapter')" placement="bottom">
<Trash2
v-if="allowEdit"
@click.prevent="trashChapter(chapter.name)"
class="h-4 w-4 text-red-500 invisible group-hover:visible"
/>
</Tooltip>
</div>
</DisclosureButton>
<DisclosurePanel>
<DisclosurePanel v-if="!chapter.is_scorm_package">
<Draggable
v-if="!chapter.is_scorm_package"
:list="chapter.lessons"
:disabled="!allowEdit"
item-key="name"
Expand Down Expand Up @@ -89,6 +110,7 @@
</Draggable>
<div v-if="allowEdit" class="flex mt-2 mb-4 pl-8">
<router-link
v-if="!chapter.is_scorm_package"
:to="{
name: 'LessonForm',
params: {
Expand All @@ -102,9 +124,6 @@
{{ __('Add Lesson') }}
</Button>
</router-link>
<Button class="ml-2" @click="openChapterModal(chapter)">
{{ __('Edit Chapter') }}
</Button>
</div>
</DisclosurePanel>
</Disclosure>
Expand All @@ -118,24 +137,26 @@
/>
</template>
<script setup>
import { Button, createResource } from 'frappe-ui'
import { ref, getCurrentInstance } from 'vue'
import { Button, createResource, Tooltip } from 'frappe-ui'
import { getCurrentInstance, inject, ref } from 'vue'
import Draggable from 'vuedraggable'
import { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'
import {
Check,
ChevronRight,
MonitorPlay,
HelpCircle,
FileText,
Check,
FilePenLine,
HelpCircle,
MonitorPlay,
Trash2,
} from 'lucide-vue-next'
import { useRoute } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import ChapterModal from '@/components/Modals/ChapterModal.vue'
import { showToast } from '@/utils'

const route = useRoute()
const expandAll = ref(true)
const router = useRouter()
const user = inject('$user')
const showChapterModal = ref(false)
const currentChapter = ref(null)
const app = getCurrentInstance()
Expand Down Expand Up @@ -205,8 +226,10 @@ const updateLessonIndex = createResource({

const trashLesson = (lessonName, chapterName) => {
$dialog({
title: __('Delete Lesson'),
message: __('Are you sure you want to delete this lesson?'),
title: __('Delete this lesson?'),
message: __(
'Deleting this lesson will permanently remove it from the course. This action cannot be undone. Are you sure you want to continue?'
),
actions: [
{
label: __('Delete'),
Expand Down Expand Up @@ -245,6 +268,61 @@ const updateOutline = (e) => {
idx: e.newIndex,
})
}

const deleteChapter = createResource({
url: 'lms.lms.api.delete_chapter',
makeParams(values) {
return {
chapter: values.chapter,
}
},
onSuccess() {
outline.reload()
showToast('Success', 'Chapter deleted successfully', 'check')
},
})

const trashChapter = (chapterName) => {
$dialog({
title: __('Delete this chapter?'),
message: __(
'Deleting this chapter will also delete all its lessons and permanently remove it from the course. This action cannot be undone. Are you sure you want to continue?'
),
actions: [
{
label: __('Delete'),
theme: 'red',
variant: 'solid',
onClick(close) {
deleteChapter.submit({ chapter: chapterName })
close()
},
},
],
})
}

const redirectToChapter = (chapter) => {
event.preventDefault()
if (props.allowEdit) return
if (!chapter.is_scorm_package) return
if (!user.data) {
showToast(
__('You are not enrolled'),
__('Please enroll for this course to view this lesson'),
'alert-circle'
)
return
}

router.push({
name: 'SCORMChapter',
params: {
courseName: props.courseName,
chapterName: chapter.name,
},
})
}
</script>
<style>
.outline-lesson:has(.router-link-active) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/LessonContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
allowfullscreen
></iframe>
</div>
<div v-for="block in content.split('\n\n')">
<div v-for="block in content?.split('\n\n')">
<div v-if="block.includes('{{ YouTubeVideo')">
<iframe
class="youtube-video"
Expand Down
Loading
Loading