Skip to content

Commit e76ff45

Browse files
authored
Merge pull request #1942 from frappe/develop
chore: merge 'develop' into 'main'
2 parents daf2d28 + 66f19d0 commit e76ff45

67 files changed

Lines changed: 7356 additions & 19635 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@
5555
"@vitejs/plugin-vue": "5.0.3",
5656
"autoprefixer": "10.4.2",
5757
"postcss": "8.4.5",
58-
"vite": "5.0.11",
5958
"tailwindcss": "^3.4.15",
59+
"unplugin-auto-import": "^20.3.0",
60+
"vite": "5.0.11",
6061
"vite-plugin-pwa": "0.15.0"
6162
},
6263
"resolutions": {

frontend/src/components/AssessmentPlugin.vue

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,51 @@
2626
v-model="quiz"
2727
doctype="LMS Quiz"
2828
:label="__('Select a quiz')"
29+
placeholder=" "
2930
:onCreate="(value, close) => redirectToForm()"
3031
/>
31-
<Link
32-
v-else
33-
v-model="assignment"
34-
doctype="LMS Assignment"
35-
:label="__('Select an assignment')"
36-
:onCreate="(value, close) => redirectToForm()"
37-
/>
32+
<div v-else class="space-y-4">
33+
<Link
34+
v-if="filterAssignmentsByCourse"
35+
v-model="assignment"
36+
doctype="LMS Assignment"
37+
:filters="{
38+
course: route.params.courseName,
39+
}"
40+
placeholder=" "
41+
:label="__('Select an Assignment')"
42+
:onCreate="(value, close) => redirectToForm()"
43+
/>
44+
<Link
45+
v-else
46+
v-model="assignment"
47+
doctype="LMS Assignment"
48+
placeholder=" "
49+
:label="__('Select an Assignment')"
50+
:onCreate="(value, close) => redirectToForm()"
51+
/>
52+
<FormControl
53+
type="checkbox"
54+
:label="__('Filter assignments by course')"
55+
v-model="filterAssignmentsByCourse"
56+
/>
57+
</div>
3858
</div>
3959
</div>
4060
</template>
4161
</Dialog>
4262
</template>
4363
<script setup>
44-
import { Dialog } from 'frappe-ui'
45-
import { onMounted, ref, nextTick } from 'vue'
46-
import Link from '@/components/Controls/Link.vue'
64+
import { Dialog, FormControl } from 'frappe-ui'
65+
import { nextTick, onMounted, ref } from 'vue'
66+
import { useRoute } from 'vue-router'
67+
import { Link } from 'frappe-ui/frappe'
4768
4869
const show = ref(false)
4970
const quiz = ref(null)
5071
const assignment = ref(null)
72+
const filterAssignmentsByCourse = ref(false)
73+
const route = useRoute()
5174
5275
const props = defineProps({
5376
type: {

frontend/src/components/BatchFeedback.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div v-if="user.data?.is_student">
33
<div>
4-
<div class="leading-5 mb-4">
4+
<div class="leading-5 mb-4 text-ink-gray-7">
55
<div v-if="readOnly">
66
{{ __('Thank you for providing your feedback.') }}
77
<span

frontend/src/components/CertificationLinks.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ const props = defineProps({
6868
6969
const certification = createResource({
7070
url: 'lms.lms.api.get_certification_details',
71-
params: {
72-
course: props.courseName,
71+
makeParams(values) {
72+
return {
73+
course: props.courseName,
74+
}
7375
},
7476
auto: user.data ? true : false,
75-
cache: ['certificationData', user.data?.name],
7677
})
7778
7879
const downloadCertificate = () => {

frontend/src/components/CourseCardOverlay.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,12 @@ function enrollStudent() {
220220
window.location.href = `/login?redirect-to=${window.location.pathname}`
221221
}, 500)
222222
} else {
223-
call('lms.lms.doctype.lms_enrollment.lms_enrollment.create_membership', {
224-
course: props.course.data.name,
223+
call('frappe.client.insert', {
224+
doc: {
225+
doctype: 'LMS Enrollment',
226+
course: props.course.data.name,
227+
member: user.data.name,
228+
},
225229
})
226230
.then(() => {
227231
capture('enrolled_in_course', {

frontend/src/components/Modals/AssignmentForm.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
:label="__('Submission Type')"
2828
:required="true"
2929
/>
30+
<Link
31+
v-model="assignment.course"
32+
:label="__('Course')"
33+
doctype="LMS Course"
34+
placeholder=" "
35+
/>
3036
<div>
3137
<div class="text-xs text-ink-gray-5 mb-2">
3238
{{ __('Question') }}
@@ -67,6 +73,7 @@
6773
import { Button, Dialog, FormControl, TextEditor, toast } from 'frappe-ui'
6874
import { computed, reactive, watch } from 'vue'
6975
import { escapeHTML, sanitizeHTML } from '@/utils'
76+
import { Link } from 'frappe-ui/frappe'
7077
7178
const show = defineModel()
7279
const assignments = defineModel<Assignments>('assignments')
@@ -75,6 +82,7 @@ interface Assignment {
7582
title: string
7683
type: string
7784
question: string
85+
course?: string
7886
}
7987
8088
interface Assignments {
@@ -89,6 +97,7 @@ const assignment = reactive({
8997
title: '',
9098
type: '',
9199
question: '',
100+
course: '',
92101
})
93102
94103
const props = defineProps({
@@ -107,6 +116,7 @@ watch(
107116
assignment.title = row.title
108117
assignment.type = row.type
109118
assignment.question = row.question
119+
assignment.course = row.course || ''
110120
}
111121
})
112122
}

frontend/src/components/Modals/EditProfile.vue

Lines changed: 72 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,11 @@
33
:options="{
44
title: 'Edit your profile',
55
size: '3xl',
6-
actions: [
7-
{
8-
label: 'Save',
9-
variant: 'solid',
10-
onClick: (close) => saveProfile(close),
11-
},
12-
],
136
}"
147
>
158
<template #body-content>
16-
<div class="grid grid-cols-2 gap-5">
17-
<div class="space-y-4">
18-
<!-- <Uploader
19-
v-model="profile.image.file_url"
20-
label="Profile Image"
21-
description="Your profile image to help others recognize you."
22-
/> -->
9+
<div>
10+
<div class="grid grid-cols-2 gap-10">
2311
<div>
2412
<div class="text-xs text-ink-gray-5 mb-1">
2513
{{ __('Profile Image') }}
@@ -47,16 +35,16 @@
4735
<div v-else class="mb-4">
4836
<div class="flex items-center">
4937
<img
50-
:src="profile.image.file_url"
38+
:src="profile.image?.file_url"
5139
class="object-cover h-[50px] w-[50px] rounded-full border-4 border-white object-cover"
5240
/>
5341

5442
<div class="text-base flex flex-col ml-2">
5543
<span>
56-
{{ profile.image.file_name }}
44+
{{ profile.image?.file_name }}
5745
</span>
5846
<span class="text-sm text-ink-gray-4 mt-1">
59-
{{ getFileSize(profile.image.file_size) }}
47+
{{ getFileSize(profile.image?.file_size) }}
6048
</span>
6149
</div>
6250
<X
@@ -66,39 +54,79 @@
6654
</div>
6755
</div>
6856
</div>
69-
<FormControl v-model="profile.first_name" :label="__('First Name')" />
70-
<FormControl v-model="profile.last_name" :label="__('Last Name')" />
71-
<FormControl v-model="profile.headline" :label="__('Headline')" />
72-
<Link
73-
:label="__('Language')"
74-
v-model="profile.language"
75-
doctype="Language"
57+
<Switch
58+
v-model="profile.looking_for_job"
59+
:label="__('Open to Opportunities')"
60+
:description="
61+
__('Show recruiters and others that you are open to work.')
62+
"
63+
class="!px-0"
7664
/>
7765
</div>
78-
<div>
79-
<div class="mb-4">
80-
<div class="mb-1.5 text-sm text-ink-gray-5">
81-
{{ __('Bio') }}
66+
67+
<div class="grid grid-cols-2 gap-10">
68+
<div class="space-y-4">
69+
<div class="space-y-4">
70+
<FormControl
71+
v-model="profile.first_name"
72+
:label="__('First Name')"
73+
/>
74+
<FormControl
75+
v-model="profile.last_name"
76+
:label="__('Last Name')"
77+
/>
78+
<FormControl v-model="profile.headline" :label="__('Headline')" />
79+
80+
<FormControl
81+
v-model="profile.linkedin"
82+
:label="__('LinkedIn ID')"
83+
/>
84+
<FormControl v-model="profile.github" :label="__('GitHub ID')" />
85+
<FormControl
86+
v-model="profile.twitter"
87+
:label="__('Twitter ID')"
88+
/>
8289
</div>
83-
<TextEditor
84-
:fixedMenu="true"
85-
@change="(val) => (profile.bio = val)"
86-
:content="profile.bio"
87-
editorClass="prose-sm py-2 px-2 min-h-[200px] border-outline-gray-2 hover:border-outline-gray-3 rounded-b-md bg-surface-gray-3"
90+
</div>
91+
<div class="space-y-4">
92+
<Link
93+
:label="__('Language')"
94+
v-model="profile.language"
95+
doctype="Language"
8896
/>
97+
<div>
98+
<div class="mb-1.5 text-sm text-ink-gray-5">
99+
{{ __('Bio') }}
100+
</div>
101+
<TextEditor
102+
:fixedMenu="true"
103+
@change="(val) => (profile.bio = val)"
104+
:content="profile.bio"
105+
:rows="15"
106+
editorClass="prose-sm py-2 px-2 min-h-[200px] border-outline-gray-2 hover:border-outline-gray-3 rounded-b-md bg-surface-gray-3"
107+
/>
108+
</div>
89109
</div>
90110
</div>
91111
</div>
92112
</template>
113+
<template #actions="{ close }">
114+
<div class="pb-5 float-right">
115+
<Button variant="solid" @click="saveProfile(close)">
116+
{{ __('Save') }}
117+
</Button>
118+
</div>
119+
</template>
93120
</Dialog>
94121
</template>
95122
<script setup>
96123
import {
124+
Button,
125+
createResource,
97126
Dialog,
98127
FormControl,
99128
FileUploader,
100-
Button,
101-
createResource,
129+
Switch,
102130
TextEditor,
103131
toast,
104132
} from 'frappe-ui'
@@ -123,6 +151,10 @@ const profile = reactive({
123151
headline: '',
124152
bio: '',
125153
image: '',
154+
looking_for_job: false,
155+
linkedin: '',
156+
github: '',
157+
twitter: '',
126158
})
127159
128160
const imageResource = createResource({
@@ -145,7 +177,7 @@ const updateProfile = createResource({
145177
doctype: 'User',
146178
name: props.profile.data.name,
147179
fieldname: {
148-
user_image: profile.image.file_url,
180+
user_image: profile.image?.file_url || null,
149181
...profile,
150182
},
151183
}
@@ -199,6 +231,10 @@ watch(
199231
profile.headline = newVal.headline
200232
profile.language = newVal.language
201233
profile.bio = newVal.bio
234+
profile.looking_for_job = newVal.looking_for_job
235+
profile.linkedin = newVal.linkedin
236+
profile.github = newVal.github
237+
profile.twitter = newVal.twitter
202238
if (newVal.user_image) imageResource.submit({ image: newVal.user_image })
203239
}
204240
}

0 commit comments

Comments
 (0)