chore: merge conflicts
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<ListView
|
||||
:columns="getCoursesColumns()"
|
||||
:rows="courses.data"
|
||||
row-key="name"
|
||||
row-key="batch_course"
|
||||
:options="{ showTooltip: false }"
|
||||
>
|
||||
<ListHeader
|
||||
@@ -49,7 +49,10 @@
|
||||
<ListSelectBanner>
|
||||
<template #actions="{ unselectAll, selections }">
|
||||
<div class="flex gap-2">
|
||||
<Button variant="ghost" @click="removeCourses(selections)">
|
||||
<Button
|
||||
variant="ghost"
|
||||
@click="removeCourses(selections, unselectAll)"
|
||||
>
|
||||
<Trash2 class="h-4 w-4 stroke-1.5" />
|
||||
</Button>
|
||||
</div>
|
||||
@@ -133,11 +136,13 @@ const removeCourse = createResource({
|
||||
},
|
||||
})
|
||||
|
||||
const removeCourses = (selections) => {
|
||||
const removeCourses = (selections, unselectAll) => {
|
||||
selections.forEach(async (course) => {
|
||||
removeCourse.submit({ course })
|
||||
await setTimeout(1000)
|
||||
})
|
||||
courses.reload()
|
||||
setTimeout(() => {
|
||||
courses.reload()
|
||||
unselectAll()
|
||||
}, 1000)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-if="batch.data" class="shadow rounded-md p-5" style="width: 300px">
|
||||
<div v-if="batch.data" class="shadow rounded-md p-5 lg:w-72">
|
||||
<Badge
|
||||
v-if="batch.data.seat_count && seats_left > 0"
|
||||
theme="green"
|
||||
|
||||
@@ -52,7 +52,10 @@
|
||||
<ListSelectBanner>
|
||||
<template #actions="{ unselectAll, selections }">
|
||||
<div class="flex gap-2">
|
||||
<Button variant="ghost" @click="removeStudents(selections)">
|
||||
<Button
|
||||
variant="ghost"
|
||||
@click="removeStudents(selections, unselectAll)"
|
||||
>
|
||||
<Trash2 class="h-4 w-4 stroke-1.5" />
|
||||
</Button>
|
||||
</div>
|
||||
@@ -142,11 +145,13 @@ const removeStudent = createResource({
|
||||
},
|
||||
})
|
||||
|
||||
const removeStudents = (selections) => {
|
||||
const removeStudents = (selections, unselectAll) => {
|
||||
selections.forEach(async (student) => {
|
||||
removeStudent.submit({ student })
|
||||
await setTimeout(1000)
|
||||
})
|
||||
students.reload()
|
||||
setTimeout(() => {
|
||||
students.reload()
|
||||
unselectAll()
|
||||
}, 500)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div
|
||||
class="course-image"
|
||||
:class="{ 'default-image': !course.image }"
|
||||
:style="{ backgroundImage: 'url(' + encodeURI(course.image) + ')' }"
|
||||
:style="{ backgroundImage: 'url(\'' + encodeURI(course.image) + '\')' }"
|
||||
>
|
||||
<div class="flex relative top-4 left-4 w-fit flex-wrap">
|
||||
<Badge
|
||||
|
||||
@@ -29,15 +29,42 @@
|
||||
<script setup>
|
||||
import { getSidebarLinks } from '../utils'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { computed, inject } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { sessionStore } from '@/stores/session'
|
||||
import { usersStore } from '@/stores/user'
|
||||
import { LogOut, LogIn, UserRound } from 'lucide-vue-next'
|
||||
|
||||
const { logout, user } = sessionStore()
|
||||
const { logout, user, username } = sessionStore()
|
||||
let { isLoggedIn } = sessionStore()
|
||||
|
||||
const router = useRouter()
|
||||
let { userResource } = usersStore()
|
||||
|
||||
const tabs = computed(() => {
|
||||
return getSidebarLinks()
|
||||
let links = getSidebarLinks()
|
||||
|
||||
if (user) {
|
||||
links.push({
|
||||
label: 'Profile',
|
||||
icon: UserRound,
|
||||
activeFor: [
|
||||
'Profile',
|
||||
'ProfileAbout',
|
||||
'ProfileCertification',
|
||||
'ProfileEvaluator',
|
||||
'ProfileRoles',
|
||||
],
|
||||
})
|
||||
links.push({
|
||||
label: 'Log out',
|
||||
icon: LogOut,
|
||||
})
|
||||
} else {
|
||||
links.push({
|
||||
label: 'Log in',
|
||||
icon: LogIn,
|
||||
})
|
||||
}
|
||||
return links
|
||||
})
|
||||
|
||||
let isActive = (tab) => {
|
||||
@@ -50,6 +77,13 @@ const handleClick = (tab) => {
|
||||
logout.submit().then(() => {
|
||||
isLoggedIn = false
|
||||
})
|
||||
else if (tab.label == 'Profile')
|
||||
router.push({
|
||||
name: 'Profile',
|
||||
params: {
|
||||
username: userResource.data?.username,
|
||||
},
|
||||
})
|
||||
else router.push({ name: tab.to })
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { Dialog, Input, TextEditor, createResource } from 'frappe-ui'
|
||||
import { reactive, defineModel } from 'vue'
|
||||
import { reactive, defineModel, computed } from 'vue'
|
||||
import { showToast } from '@/utils'
|
||||
|
||||
const topics = defineModel('reloadTopics')
|
||||
|
||||
@@ -93,6 +94,14 @@ const submitTopic = (close) => {
|
||||
topicResource.submit(
|
||||
{},
|
||||
{
|
||||
validate() {
|
||||
if (!topic.title) {
|
||||
return 'Title cannot be empty.'
|
||||
}
|
||||
if (!topic.reply) {
|
||||
return 'Reply cannot be empty.'
|
||||
}
|
||||
},
|
||||
onSuccess(data) {
|
||||
replyResource.submit(
|
||||
{
|
||||
@@ -108,6 +117,9 @@ const submitTopic = (close) => {
|
||||
}
|
||||
)
|
||||
},
|
||||
onError(err) {
|
||||
showToast('Error', err.message, 'x')
|
||||
},
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -57,13 +57,23 @@
|
||||
import LMSLogo from '@/components/Icons/LMSLogo.vue'
|
||||
import { sessionStore } from '@/stores/session'
|
||||
import { Dropdown, createResource } from 'frappe-ui'
|
||||
import { ChevronDown, LogIn, LogOut, User } from 'lucide-vue-next'
|
||||
import {
|
||||
ChevronDown,
|
||||
LogIn,
|
||||
LogOut,
|
||||
User,
|
||||
ArrowRightLeft,
|
||||
} from 'lucide-vue-next'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { convertToTitleCase } from '../utils'
|
||||
import { onMounted, inject } from 'vue'
|
||||
import { usersStore } from '@/stores/user'
|
||||
|
||||
const router = useRouter()
|
||||
const { logout } = sessionStore()
|
||||
let { userResource } = usersStore()
|
||||
let { isLoggedIn } = sessionStore()
|
||||
|
||||
const props = defineProps({
|
||||
isCollapsed: {
|
||||
type: Boolean,
|
||||
@@ -80,10 +90,6 @@ const branding = createResource({
|
||||
},
|
||||
})
|
||||
|
||||
const { logout } = sessionStore()
|
||||
let { userResource } = usersStore()
|
||||
|
||||
let { isLoggedIn } = sessionStore()
|
||||
const userDropdownOptions = [
|
||||
{
|
||||
icon: User,
|
||||
@@ -95,6 +101,19 @@ const userDropdownOptions = [
|
||||
return isLoggedIn
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: ArrowRightLeft,
|
||||
label: 'Switch to Desk',
|
||||
onClick: () => {
|
||||
window.location.href = '/app'
|
||||
},
|
||||
condition: () => {
|
||||
let cookies = new URLSearchParams(document.cookie.split('; ').join('&'))
|
||||
let system_user = cookies.get('system_user')
|
||||
if (system_user === 'yes') return true
|
||||
else return false
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: LogOut,
|
||||
label: 'Log out',
|
||||
|
||||
Reference in New Issue
Block a user