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' #1036

Merged
merged 22 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cef4b70
feat: payment through payments app
pateljannat Sep 19, 2024
d8ab88b
Merge branch 'develop' of https://github.com/frappe/lms into payments
pateljannat Sep 24, 2024
e0f569c
feat: payment flow with payments app
pateljannat Sep 24, 2024
35a7cce
feat: payment gateway settings
pateljannat Sep 25, 2024
e18f0c9
feat: brand settings
pateljannat Sep 26, 2024
11a9bff
fix: dirty form for branding section
pateljannat Sep 26, 2024
bb9b179
Merge pull request #1031 from pateljannat/brand-settings
pateljannat Sep 26, 2024
ad07f88
fix: misc UI fixes
pateljannat Sep 27, 2024
01120fb
chore: resolved conflicts
pateljannat Sep 27, 2024
576258e
fix: pass options to setting fields
pateljannat Sep 27, 2024
60a3da2
refactor: billing page ui
pateljannat Sep 27, 2024
7c055af
fix: telemetry capture issue
pateljannat Sep 27, 2024
4fdca46
chore: update POT file
frappe-pr-bot Sep 27, 2024
d295898
Merge pull request #1033 from pateljannat/issues-35
pateljannat Sep 27, 2024
b6bf9c0
Merge branch 'develop' of https://github.com/frappe/lms into payments
pateljannat Sep 30, 2024
008cc66
chore: refactor payment settings
pateljannat Sep 30, 2024
1c9f636
Merge pull request #1032 from frappe/pot_develop_2024-09-27
pateljannat Oct 1, 2024
8a17dca
fix: minor ui changes
pateljannat Oct 1, 2024
be870e8
fix: payment gateway fields
pateljannat Oct 1, 2024
a067695
fix: removed help article from course lesson
pateljannat Oct 1, 2024
59d8848
Merge pull request #1035 from pateljannat/payments
pateljannat Oct 2, 2024
fc81f1a
chore(release): Bumped to Version 2.7.0
frappe-bot Oct 2, 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
3 changes: 3 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import DesktopLayout from './components/DesktopLayout.vue'
import MobileLayout from './components/MobileLayout.vue'
import { stopSession } from '@/telemetry'
import { init as initTelemetry } from '@/telemetry'
import { usersStore } from '@/stores/user'
const screenSize = useScreenSize()
let { userResource } = usersStore()
const Layout = computed(() => {
if (screenSize.width < 640) {
Expand All @@ -26,6 +28,7 @@ const Layout = computed(() => {
})
onMounted(async () => {
if (!userResource.data) return
await initTelemetry()
})
Expand Down
83 changes: 83 additions & 0 deletions frontend/src/components/BrandSettings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<template>
<div class="flex flex-col justify-between h-full">
<div>
<div class="flex items-center justify-between">
<div class="font-semibold mb-1">
{{ __(label) }}
</div>
<Badge
v-if="isDirty"
:label="__('Not Saved')"
variant="subtle"
theme="orange"
/>
</div>
<div class="text-xs text-gray-600">
{{ __(description) }}
</div>
</div>
<SettingFields :fields="fields" :data="data.data" />
<div class="flex flex-row-reverse mt-auto">
<Button variant="solid" :loading="saveSettings.loading" @click="update">
{{ __('Update') }}
</Button>
</div>
</div>
</template>
<script setup>
import { createResource, Button, Badge } from 'frappe-ui'
import SettingFields from '@/components/SettingFields.vue'
import { watch, ref } from 'vue'
const isDirty = ref(false)
const props = defineProps({
fields: {
type: Array,
required: true,
},
data: {
type: Object,
required: true,
},
label: {
type: String,
required: true,
},
description: {
type: String,
},
})
const saveSettings = createResource({
url: 'frappe.client.set_value',
makeParams(values) {
return {
doctype: 'Website Settings',
name: 'Website Settings',
fieldname: values.fields,
}
},
})
const update = () => {
let fieldsToSave = {}
let imageFields = ['favicon', 'banner_image', 'footer_logo']
props.fields.forEach((f) => {
if (imageFields.includes(f.name)) {
fieldsToSave[f.name] = f.value ? f.value.file_url : null
} else {
fieldsToSave[f.name] = f.value
}
})
saveSettings.submit({
fields: fieldsToSave,
})
}
watch(props.data, (newData) => {
if (newData && !isDirty.value) {
isDirty.value = true
}
})
</script>
38 changes: 17 additions & 21 deletions frontend/src/components/LiveClass.vue
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
<template>
<Button
v-if="user.data.is_moderator"
variant="solid"
class="float-right mb-5"
@click="openLiveClassModal"
>
<template #prefix>
<Plus class="h-4 w-4" />
</template>
<span>
{{ __('Add Live Class') }}
</span>
</Button>
<div class="text-lg font-semibold mb-5">
{{ __('Live Class') }}
<div class="flex items-center justify-between mb-5">
<div class="text-lg font-semibold">
{{ __('Live Class') }}
</div>
<Button v-if="user.data.is_moderator" @click="openLiveClassModal">
<template #prefix>
<Plus class="h-4 w-4" />
</template>
<span>
{{ __('Add') }}
</span>
</Button>
</div>
<div v-if="liveClasses.data?.length" class="grid grid-cols-2 gap-5">
<div
v-for="cls in liveClasses.data"
class="flex flex-col border rounded-md h-full p-3"
class="flex flex-col border rounded-md h-full text-sm text-gray-700 p-3"
>
<div class="font-semibold text-lg mb-4">
<div class="font-semibold text-gray-900 text-lg mb-4">
{{ cls.title }}
</div>
<div class="mb-4">
<div class="leading-5 text-gray-700 text-sm mb-4">
{{ cls.description }}
</div>
<div class="flex items-center mb-2">
<Calendar class="w-4 h-4 stroke-1.5" />
<Calendar class="w-4 h-4 stroke-1.5 text-gray-700" />
<span class="ml-2">
{{ dayjs(cls.date).format('DD MMMM YYYY') }}
</span>
Expand All @@ -38,7 +35,7 @@
{{ formatTime(cls.time) }}
</span>
</div>
<div class="flex items-center space-x-2 mt-auto">
<div class="flex items-center space-x-2 text-gray-900 mt-auto">
<a
:href="cls.start_url"
target="_blank"
Expand Down Expand Up @@ -90,7 +87,6 @@ const liveClasses = createListResource({
doctype: 'LMS Live Class',
filters: {
batch_name: props.batch,
date: ['>=', new Date()],
},
fields: [
'title',
Expand Down
108 changes: 84 additions & 24 deletions frontend/src/components/Modals/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@
:label="activeTab.label"
:description="activeTab.description"
/>
<PaymentSettings
v-else-if="activeTab.label === 'Payment Gateway'"
:label="activeTab.label"
:description="activeTab.description"
:data="data"
:fields="activeTab.fields"
/>
<BrandSettings
v-else-if="activeTab.label === 'Branding'"
:label="activeTab.label"
:description="activeTab.description"
:fields="activeTab.fields"
:data="branding"
/>
<SettingDetails
v-else
:fields="activeTab.fields"
Expand All @@ -58,13 +72,15 @@
</Dialog>
</template>
<script setup>
import { Dialog, createDocumentResource } from 'frappe-ui'
import { Dialog, createDocumentResource, createResource } from 'frappe-ui'
import { ref, computed, watch } from 'vue'
import { useSettings } from '@/stores/settings'
import SettingDetails from '../SettingDetails.vue'
import SidebarLink from '@/components/SidebarLink.vue'
import Members from '@/components/Members.vue'
import Categories from '@/components/Categories.vue'
import BrandSettings from '@/components/BrandSettings.vue'
import PaymentSettings from '@/components/PaymentSettings.vue'
const show = defineModel()
const doctype = ref('LMS Settings')
Expand All @@ -79,6 +95,12 @@ const data = createDocumentResource({
auto: true,
})
const branding = createResource({
url: 'lms.lms.api.get_branding',
auto: true,
cache: 'brand',
})
const tabsStructure = computed(() => {
return [
{
Expand All @@ -92,17 +114,6 @@ const tabsStructure = computed(() => {
},
],
},
{
label: 'Settings',
hideLabel: true,
items: [
{
label: 'Categories',
description: 'Manage the members of your learning system',
icon: 'Network',
},
],
},
{
label: 'Settings',
hideLabel: true,
Expand All @@ -114,24 +125,17 @@ const tabsStructure = computed(() => {
'Configure the payment gateway and other payment related settings',
fields: [
{
label: 'Razorpay Key',
name: 'razorpay_key',
type: 'text',
},
{
label: 'Razorpay Secret',
name: 'razorpay_secret',
type: 'password',
label: 'Payment Gateway',
name: 'payment_gateway',
type: 'Link',
doctype: 'Payment Gateway',
},
{
label: 'Default Currency',
name: 'default_currency',
type: 'Link',
doctype: 'Currency',
},
{
type: 'Column Break',
},
{
label: 'Apply GST for India',
name: 'apply_gst',
Expand All @@ -151,10 +155,67 @@ const tabsStructure = computed(() => {
},
],
},
{
label: 'Settings',
hideLabel: true,
items: [
{
label: 'Categories',
description: 'Manage the members of your learning system',
icon: 'Network',
},
],
},
{
label: 'Customise',
hideLabel: false,
items: [
{
label: 'Branding',
icon: 'Blocks',
fields: [
{
label: 'Brand Name',
name: 'app_name',
type: 'text',
},
{
label: 'Copyright',
name: 'copyright',
type: 'text',
},
{
label: 'Address',
name: 'address',
type: 'textarea',
rows: 4,
},
{
label: 'Footer "Powered By"',
name: 'footer_powered',
type: 'textarea',
rows: 4,
},
{
type: 'Column Break',
},
{
label: 'Logo',
name: 'banner_image',
type: 'Upload',
},
{
label: 'Favicon',
name: 'favicon',
type: 'Upload',
},
{
label: 'Footer Logo',
name: 'footer_logo',
type: 'Upload',
},
],
},
{
label: 'Sidebar',
icon: 'PanelLeftIcon',
Expand Down Expand Up @@ -198,7 +259,6 @@ const tabsStructure = computed(() => {
{
label: 'Email Templates',
icon: 'MailPlus',
description: 'Create email templates with the content you want',
fields: [
{
label: 'Batch Confirmation Template',
Expand Down
Loading
Loading