fix: open dialog directly to create assignment
This commit is contained in:
@@ -85,7 +85,7 @@ import {
|
|||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { computed, inject, onMounted, ref, watch } from 'vue'
|
import { computed, inject, onMounted, ref, watch } from 'vue'
|
||||||
import { Plus } from 'lucide-vue-next'
|
import { Plus } from 'lucide-vue-next'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import { sessionStore } from '../stores/session'
|
import { sessionStore } from '../stores/session'
|
||||||
import AssignmentForm from '@/components/Modals/AssignmentForm.vue'
|
import AssignmentForm from '@/components/Modals/AssignmentForm.vue'
|
||||||
import EmptyState from '@/components/EmptyState.vue'
|
import EmptyState from '@/components/EmptyState.vue'
|
||||||
@@ -99,12 +99,17 @@ const assignmentID = ref('new')
|
|||||||
const assignmentCount = ref(0)
|
const assignmentCount = ref(0)
|
||||||
const { brand } = sessionStore()
|
const { brand } = sessionStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const route = useRoute();
|
||||||
const readOnlyMode = window.read_only_mode
|
const readOnlyMode = window.read_only_mode
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!user.data?.is_moderator && !user.data?.is_instructor) {
|
if (!user.data?.is_moderator && !user.data?.is_instructor) {
|
||||||
router.push({ name: 'Courses' })
|
router.push({ name: 'Courses' })
|
||||||
}
|
}
|
||||||
|
if (route.query.new === 'true') {
|
||||||
|
assignmentID.value = 'new'
|
||||||
|
showAssignmentForm.value = true
|
||||||
|
}
|
||||||
getAssignmentCount()
|
getAssignmentCount()
|
||||||
titleFilter.value = router.currentRoute.value.query.title
|
titleFilter.value = router.currentRoute.value.query.title
|
||||||
typeFilter.value = router.currentRoute.value.query.type
|
typeFilter.value = router.currentRoute.value.query.type
|
||||||
|
|||||||
Reference in New Issue
Block a user