Skip to content

Commit 3ebff21

Browse files
authored
Merge pull request #1903 from frappe/develop
chore: merge 'develop' into 'main'
2 parents 95f37f7 + 80deed2 commit 3ebff21

106 files changed

Lines changed: 6543 additions & 5450 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
jobs:
88
tests:
99
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
1012
services:
1113
redis-cache:
1214
image: redis:alpine
@@ -77,4 +79,27 @@ jobs:
7779
run: bench --site frappe.local build
7880
- name: run tests
7981
working-directory: /home/runner/frappe-bench
80-
run: bench --site frappe.local run-tests --app lms
82+
run: bench --site frappe.local run-tests --app lms --coverage
83+
- name: Upload coverage data
84+
uses: actions/upload-artifact@v4
85+
with:
86+
path: /home/runner/frappe-bench/sites/coverage.xml
87+
88+
coverage:
89+
name: Coverage Wrap Up
90+
needs: tests
91+
runs-on: ubuntu-latest
92+
steps:
93+
- name: Clone
94+
uses: actions/checkout@v3
95+
96+
- name: Download artifacts
97+
uses: actions/download-artifact@v4
98+
99+
- name: Upload coverage data
100+
uses: codecov/codecov-action@v5
101+
with:
102+
name: Server
103+
token: ${{ secrets.CODECOV_TOKEN }}
104+
fail_ci_if_error: true
105+
verbose: true

cypress/e2e/course_creation.cy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ describe("Course Creation", () => {
5656
.parent()
5757
.within(() => {
5858
cy.get("input").click().type("frappe");
59+
cy.wait(500);
5960
cy.get("input")
6061
.invoke("attr", "aria-controls")
6162
.as("instructor_list_id");

frontend/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"scripts": {
77
"dev": "vite",
88
"serve": "vite preview",
9-
"build": "vite build --base=/assets/lms/frontend/ && yarn copy-html-entry",
10-
"copy-html-entry": "cp ../lms/public/frontend/index.html ../lms/www/lms.html"
9+
"build": "vite build --base=/assets/lms/frontend/ && yarn copy-html-entry && yarn copy-colors-json",
10+
"copy-html-entry": "cp ../lms/public/frontend/index.html ../lms/www/lms.html",
11+
"copy-colors-json": "cp node_modules/frappe-ui/src/tailwind/colors.json src/utils/frappe-ui-colors.json"
1112
},
1213
"dependencies": {
1314
"@codemirror/lang-html": "6.4.9",
@@ -40,7 +41,6 @@
4041
"pinia": "2.0.33",
4142
"plyr": "3.7.8",
4243
"socket.io-client": "4.7.2",
43-
"tailwindcss": "3.4.15",
4444
"thememirror": "2.0.1",
4545
"typescript": "5.7.2",
4646
"vue": "^3.5.0",
@@ -56,6 +56,7 @@
5656
"autoprefixer": "10.4.2",
5757
"postcss": "8.4.5",
5858
"vite": "5.0.11",
59+
"tailwindcss": "^3.4.15",
5960
"vite-plugin-pwa": "0.15.0"
6061
},
6162
"resolutions": {

frontend/src/App.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Layout class="isolate text-base">
44
<router-view />
55
</Layout>
6-
<InstallPrompt v-if="isMobile" />
6+
<InstallPrompt v-if="isMobile && !settings.data?.disable_pwa" />
77
<Dialogs />
88
</FrappeUIProvider>
99
</template>
@@ -13,6 +13,7 @@ import { Dialogs } from '@/utils/dialogs'
1313
import { computed, onUnmounted, ref, watch } from 'vue'
1414
import { useScreenSize } from './utils/composables'
1515
import { usersStore } from '@/stores/user'
16+
import { useSettings } from '@/stores/settings'
1617
import { useRouter } from 'vue-router'
1718
import { posthogSettings } from '@/telemetry'
1819
import DesktopLayout from './components/DesktopLayout.vue'
@@ -24,6 +25,7 @@ const { isMobile } = useScreenSize()
2425
const router = useRouter()
2526
const noSidebar = ref(false)
2627
const { userResource } = usersStore()
28+
const { settings } = useSettings()
2729
2830
router.beforeEach((to, from, next) => {
2931
if (to.query.fromLesson || to.path === '/persona') {

frontend/src/components/AssessmentPlugin.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const addAssessment = () => {
7171
}
7272
7373
const redirectToForm = () => {
74-
if (props.type == 'quiz') window.open('/lms/quizzes/new', '_blank')
75-
else window.open('/lms/assignments/new', '_blank')
74+
if (props.type == 'quiz') window.open('/lms/quizzes?new=true', '_blank')
75+
else window.open('/lms/assignments?new=true', '_blank')
7676
}
7777
</script>

frontend/src/components/ContactUsEmail.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const settingsStore = useSettings()
4848
4949
const sendMail = (close: Function) => {
5050
call('frappe.core.doctype.communication.email.make', {
51-
recipients: settingsStore.contactUsEmail?.data,
51+
recipients: settingsStore.settings?.data?.contact_us_email,
5252
subject: subject.value,
5353
content: message.value,
5454
send_email: true,

frontend/src/components/Controls/ColorSwatches.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
:style="
2222
modelValue
2323
? {
24-
backgroundColor:
25-
theme.backgroundColor[modelValue.toLowerCase()][400],
24+
backgroundColor: getColor(
25+
modelValue.toLowerCase(),
26+
400
27+
),
2628
}
2729
: {}
2830
"
@@ -55,8 +57,7 @@
5557
:key="color"
5658
class="size-5 rounded-full cursor-pointer"
5759
:style="{
58-
backgroundColor:
59-
theme.backgroundColor[color.toLowerCase()][400],
60+
backgroundColor: getColor(color.toLowerCase(), 400),
6061
}"
6162
@click="
6263
(e) => {
@@ -79,7 +80,7 @@
7980
import { Button, FormControl, Popover } from 'frappe-ui'
8081
import { computed } from 'vue'
8182
import { Palette, X } from 'lucide-vue-next'
82-
import { theme } from '@/utils/theme'
83+
import { getColor } from '@/utils'
8384
8485
const emit = defineEmits(['update:modelValue', 'change'])
8586

frontend/src/components/CourseCard.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@
136136
import { Award, BookOpen, GraduationCap, Star, Users } from 'lucide-vue-next'
137137
import { sessionStore } from '@/stores/session'
138138
import { Tooltip } from 'frappe-ui'
139-
import { theme } from '@/utils/theme'
140139
import { formatAmount } from '@/utils'
141140
import CourseInstructors from '@/components/CourseInstructors.vue'
142141
import UserAvatar from '@/components/UserAvatar.vue'
143142
import ProgressBar from '@/components/ProgressBar.vue'
143+
import colors from '@/utils/frappe-ui-colors.json'
144144
145145
const { user } = sessionStore()
146146
@@ -152,8 +152,10 @@ const props = defineProps({
152152
})
153153
154154
const getGradientColor = () => {
155+
let theme =
156+
localStorage.getItem('theme') == 'light' ? 'lightMode' : 'darkMode'
155157
let color = props.course.card_gradient?.toLowerCase() || 'blue'
156-
let colorMap = theme.backgroundColor[color]
158+
let colorMap = colors[theme][color]
157159
return `linear-gradient(to top right, black, ${colorMap[400]})`
158160
/* return `bg-gradient-to-br from-${color}-100 via-${color}-200 to-${color}-400` */
159161
/* return `linear-gradient(to bottom right, ${colorMap[100]}, ${colorMap[400]})` */

frontend/src/components/Modals/AssignmentForm.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<script setup lang="ts">
6767
import { Button, Dialog, FormControl, TextEditor, toast } from 'frappe-ui'
6868
import { computed, reactive, watch } from 'vue'
69-
import { escapeHTML } from '@/utils'
69+
import { escapeHTML, sanitizeHTML } from '@/utils'
7070
7171
const show = defineModel()
7272
const assignments = defineModel<Assignments>('assignments')
@@ -122,12 +122,13 @@ watch(show, (newVal) => {
122122
}
123123
})
124124
125-
const validateTitle = () => {
125+
const validateFields = () => {
126126
assignment.title = escapeHTML(assignment.title.trim())
127+
assignment.question = sanitizeHTML(assignment.question)
127128
}
128129
129130
const saveAssignment = () => {
130-
validateTitle()
131+
validateFields()
131132
if (props.assignmentID == 'new') {
132133
createAssignment()
133134
} else {

frontend/src/components/Modals/CourseProgressSummary.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@
114114
categoryColumn: 'category',
115115
valueColumn: 'count',
116116
colors: [
117-
theme.colors.red['400'],
118-
theme.colors.amber['400'],
119-
theme.colors.pink['400'],
120-
theme.colors.blue['400'],
121-
theme.colors.green['400'],
117+
getColor('red', 400),
118+
getColor('amber', 400),
119+
getColor('pink', 400),
120+
getColor('blue', 400),
121+
getColor('green', 400),
122122
],
123123
}"
124124
/>
@@ -146,7 +146,7 @@ import {
146146
NumberChart,
147147
} from 'frappe-ui'
148148
import { computed, ref, watch } from 'vue'
149-
import { theme } from '@/utils/theme'
149+
import { getColor } from '@/utils'
150150
151151
const show = defineModel<boolean>({ default: false })
152152
const searchFilter = ref<string | null>(null)

0 commit comments

Comments
 (0)