From be0a970ff1707d1a8d007a16bc0970c7a8636c7a Mon Sep 17 00:00:00 2001 From: Kamil Piech Date: Fri, 30 Aug 2024 07:40:19 +0200 Subject: [PATCH] #57 - crud actions to links (#137) * #57 - fix: fixed crud links * #57 - fix: imports fix --- .../js/Pages/Dashboard/ContactInfo/Index.vue | 9 ++++--- resources/js/Pages/Dashboard/Course/Index.vue | 9 ++++--- .../Dashboard/CourseSemester/Grade/Index.vue | 24 +++++++++--------- .../Pages/Dashboard/CourseSemester/Index.vue | 13 +++++----- .../Pages/Dashboard/CourseSemester/Show.vue | 25 ++++++++++--------- .../CourseSemester/Student/Index.vue | 8 +++--- resources/js/Pages/Dashboard/FAQ/Index.vue | 9 ++++--- resources/js/Pages/Dashboard/Field/Index.vue | 9 ++++--- resources/js/Pages/Dashboard/News/Index.vue | 9 ++++--- .../js/Pages/Dashboard/Semester/Index.vue | 9 ++++--- .../js/Pages/Dashboard/Student/Index.vue | 13 +++++----- resources/js/Shared/Components/StyledLink.vue | 24 ++++++++++++++++++ 12 files changed, 97 insertions(+), 64 deletions(-) create mode 100644 resources/js/Shared/Components/StyledLink.vue diff --git a/resources/js/Pages/Dashboard/ContactInfo/Index.vue b/resources/js/Pages/Dashboard/ContactInfo/Index.vue index 4cecf82..c6d1fc0 100644 --- a/resources/js/Pages/Dashboard/ContactInfo/Index.vue +++ b/resources/js/Pages/Dashboard/ContactInfo/Index.vue @@ -12,6 +12,7 @@ import { ref } from 'vue' import { PencilSquareIcon, XCircleIcon } from '@heroicons/vue/24/outline' import ManagementHeader from '@/Shared/Components/ManagementHeader.vue' import ManagementHeaderItem from '@/Shared/Components/ManagementHeaderItem.vue' +import StyledLink from '@/Shared/Components/StyledLink.vue' defineProps({ contactInfos: Object, total: Number, @@ -41,9 +42,9 @@ const contactInfoToDeleteId = ref(0)
@@ -72,9 +73,9 @@ const contactInfoToDeleteId = ref(0) {{ contact.identifier }} - + diff --git a/resources/js/Pages/Dashboard/Course/Index.vue b/resources/js/Pages/Dashboard/Course/Index.vue index d6dfb60..1a839c2 100644 --- a/resources/js/Pages/Dashboard/Course/Index.vue +++ b/resources/js/Pages/Dashboard/Course/Index.vue @@ -11,6 +11,7 @@ import { ref } from 'vue' import ManagementHeader from '@/Shared/Components/ManagementHeader.vue' import ManagementHeaderItem from '@/Shared/Components/ManagementHeaderItem.vue' import { PencilSquareIcon, XCircleIcon } from '@heroicons/vue/24/outline' +import StyledLink from '@/Shared/Components/StyledLink.vue' defineProps({ courses: Object, @@ -38,9 +39,9 @@ const courseToDeleteId = ref(0) @@ -82,9 +83,9 @@ const courseToDeleteId = ref(0) {{ course.type }} - + diff --git a/resources/js/Pages/Dashboard/CourseSemester/Grade/Index.vue b/resources/js/Pages/Dashboard/CourseSemester/Grade/Index.vue index 5197bcb..de388e7 100644 --- a/resources/js/Pages/Dashboard/CourseSemester/Grade/Index.vue +++ b/resources/js/Pages/Dashboard/CourseSemester/Grade/Index.vue @@ -46,14 +46,14 @@ const editForm = useForm({ }) function createGradeColumn() { - form.post(`/dashboard/semester-courses/${props.course.data.id}/groups/${props.group.id}/grades`, { + form.post(`/dashboard/semester-courses/${props.course.id}/groups/${props.group.id}/grades`, { preserveScroll: true, }) form.reset() } function updateGradeColumn() { - editForm.patch(`/dashboard/semester-courses/${props.course.data.id}/groups/${props.group.id}/grades/${columnToEdit.value.id}`, { + editForm.patch(`/dashboard/semester-courses/${props.course.id}/groups/${props.group.id}/grades/${columnToEdit.value.id}`, { preserveScroll: true, }) showEditForm.value = false @@ -61,7 +61,7 @@ function updateGradeColumn() { } function updateGrade(gradeColumnId, studentId, value, status) { - Inertia.patch(`/dashboard/semester-courses/${props.course.data.id}/groups/${props.group.id}/grades/${gradeColumnId}/update`, { + Inertia.patch(`/dashboard/semester-courses/${props.course.id}/groups/${props.group.id}/grades/${gradeColumnId}/update`, { status: status, value: value, student_id: studentId, @@ -71,7 +71,7 @@ function updateGrade(gradeColumnId, studentId, value, status) { } function createGrade(gradeColumnId, studentId, status, value) { - Inertia.post(`/dashboard/semester-courses/${props.course.data.id}/groups/${props.group.id}/grades/${gradeColumnId}/store`, { + Inertia.post(`/dashboard/semester-courses/${props.course.id}/groups/${props.group.id}/grades/${gradeColumnId}/store`, { status: status, student_id: studentId, value: value, @@ -89,7 +89,7 @@ function editColumn(column) { } function reorder(id, down) { - Inertia.post(`/dashboard/semester-courses/${props.course.data.id}/groups/${props.group.id}/grades/${id}/reorder/${down}`, {}, { + Inertia.post(`/dashboard/semester-courses/${props.course.id}/groups/${props.group.id}/grades/${id}/reorder/${down}`, {}, { preserveScroll: true, }) } @@ -99,7 +99,7 @@ const searchForm = useForm({ }) watch(searchForm, debounce(() => { - Inertia.get(`/dashboard/semester-courses/${props.course.data.id}/groups/${props.group.id}/grades`, { + Inertia.get(`/dashboard/semester-courses/${props.course.id}/groups/${props.group.id}/grades`, { search: searchForm.search, }, { preserveState: true, @@ -114,7 +114,7 @@ watch(searchForm, debounce(() => { @@ -84,12 +85,12 @@ const courseToDeleteId = ref(0) {{ course.groupsCount }} - - + diff --git a/resources/js/Pages/Dashboard/CourseSemester/Show.vue b/resources/js/Pages/Dashboard/CourseSemester/Show.vue index 1dc3d3f..8b617ee 100644 --- a/resources/js/Pages/Dashboard/CourseSemester/Show.vue +++ b/resources/js/Pages/Dashboard/CourseSemester/Show.vue @@ -14,6 +14,7 @@ import ManagementHeaderItem from '@/Shared/Components/ManagementHeaderItem.vue' import RemoveModal from '@/Shared/Modals/RemoveModal.vue' import { PencilSquareIcon, UsersIcon, XCircleIcon, ChartBarIcon } from '@heroicons/vue/24/outline' import { ref } from 'vue' +import StyledLink from '@/Shared/Components/StyledLink.vue' const props = defineProps({ course: Object, @@ -41,7 +42,7 @@ function editGroup(group) { } function createGroup() { - form.post(`/dashboard/semester-courses/${props.course.data.id}/groups`, { + form.post(`/dashboard/semester-courses/${props.course.id}/groups`, { onSuccess: () => { form.reset() }, @@ -49,7 +50,7 @@ function createGroup() { } function updateGroup() { - editForm.patch(`/dashboard/semester-courses/${props.course.data.id}/groups/${groupToEdit.value.id}`, { + editForm.patch(`/dashboard/semester-courses/${props.course.id}/groups/${groupToEdit.value.id}`, { onSuccess: () => { showEditForm.value = false }, @@ -77,25 +78,25 @@ function updateGroup() { Id - + Kurs - + Semestr - + Liczba grup - +
@@ -182,19 +183,19 @@ function updateGroup() {
-
{{ group.name }}[{{ group.formAbbreviation }}]
- - +
- diff --git a/resources/js/Pages/Dashboard/CourseSemester/Student/Index.vue b/resources/js/Pages/Dashboard/CourseSemester/Student/Index.vue index a3baa68..643053b 100644 --- a/resources/js/Pages/Dashboard/CourseSemester/Student/Index.vue +++ b/resources/js/Pages/Dashboard/CourseSemester/Student/Index.vue @@ -33,7 +33,7 @@ const form = useForm({ }) function addStudent(id) { - Inertia.post(`/dashboard/semester-courses/${props.course.data.id}/groups/${props.group.id}/students`, { + Inertia.post(`/dashboard/semester-courses/${props.course.id}/groups/${props.group.id}/students`, { student: id, }, { preserveState: true, @@ -41,7 +41,7 @@ function addStudent(id) { } watch(form, debounce(() => { - Inertia.get(`/dashboard/semester-courses/${props.course.data.id}/groups/${props.group.id}/students`, { + Inertia.get(`/dashboard/semester-courses/${props.course.id}/groups/${props.group.id}/students`, { search: form.search, }, { preserveState: true, @@ -56,7 +56,7 @@ watch(form, debounce(() => { diff --git a/resources/js/Pages/Dashboard/FAQ/Index.vue b/resources/js/Pages/Dashboard/FAQ/Index.vue index 2de00fe..107c9c9 100644 --- a/resources/js/Pages/Dashboard/FAQ/Index.vue +++ b/resources/js/Pages/Dashboard/FAQ/Index.vue @@ -11,6 +11,7 @@ import { ref } from 'vue' import ManagementHeader from '@/Shared/Components/ManagementHeader.vue' import ManagementHeaderItem from '@/Shared/Components/ManagementHeaderItem.vue' import { PencilSquareIcon, XCircleIcon } from '@heroicons/vue/24/outline' +import StyledLink from '@/Shared/Components/StyledLink.vue' defineProps({ faqs: Object, @@ -38,9 +39,9 @@ const faqToDeleteId = ref(0) @@ -64,9 +65,9 @@ const faqToDeleteId = ref(0) {{ faq.question }} - + diff --git a/resources/js/Pages/Dashboard/Field/Index.vue b/resources/js/Pages/Dashboard/Field/Index.vue index 035d64f..c4d44b0 100644 --- a/resources/js/Pages/Dashboard/Field/Index.vue +++ b/resources/js/Pages/Dashboard/Field/Index.vue @@ -11,6 +11,7 @@ import { ref } from 'vue' import ManagementHeader from '@/Shared/Components/ManagementHeader.vue' import ManagementHeaderItem from '@/Shared/Components/ManagementHeaderItem.vue' import { PencilSquareIcon, XCircleIcon } from '@heroicons/vue/24/outline' +import StyledLink from '@/Shared/Components/StyledLink.vue' defineProps({ fields: Object, @@ -38,9 +39,9 @@ const fieldToDeleteId = ref(0) @@ -70,9 +71,9 @@ const fieldToDeleteId = ref(0) {{ field.name }} - + diff --git a/resources/js/Pages/Dashboard/News/Index.vue b/resources/js/Pages/Dashboard/News/Index.vue index 995d456..d9a47c4 100644 --- a/resources/js/Pages/Dashboard/News/Index.vue +++ b/resources/js/Pages/Dashboard/News/Index.vue @@ -16,6 +16,7 @@ import { useForm } from '@inertiajs/inertia-vue3' import { PencilSquareIcon, XCircleIcon } from '@heroicons/vue/24/outline' import ManagementHeader from '@/Shared/Components/ManagementHeader.vue' import ManagementHeaderItem from '@/Shared/Components/ManagementHeaderItem.vue' +import StyledLink from '@/Shared/Components/StyledLink.vue' const props = defineProps({ news: Object, @@ -59,9 +60,9 @@ watch(form, debounce(() => {
@@ -96,9 +97,9 @@ watch(form, debounce(() => { {{ article.published_at }} - + diff --git a/resources/js/Pages/Dashboard/Semester/Index.vue b/resources/js/Pages/Dashboard/Semester/Index.vue index 787b0fd..e57ee89 100644 --- a/resources/js/Pages/Dashboard/Semester/Index.vue +++ b/resources/js/Pages/Dashboard/Semester/Index.vue @@ -12,6 +12,7 @@ import { Method } from '@inertiajs/inertia' import ManagementHeader from '@/Shared/Components/ManagementHeader.vue' import ManagementHeaderItem from '@/Shared/Components/ManagementHeaderItem.vue' import { PencilSquareIcon, XCircleIcon, CheckIcon } from '@heroicons/vue/24/outline' +import StyledLink from '@/Shared/Components/StyledLink.vue' defineProps({ semesters: Object, @@ -39,9 +40,9 @@ const semesterToDeleteId = ref(0) @@ -78,9 +79,9 @@ const semesterToDeleteId = ref(0) > - + diff --git a/resources/js/Pages/Dashboard/Student/Index.vue b/resources/js/Pages/Dashboard/Student/Index.vue index 005b358..60a6d35 100644 --- a/resources/js/Pages/Dashboard/Student/Index.vue +++ b/resources/js/Pages/Dashboard/Student/Index.vue @@ -16,6 +16,7 @@ import { useForm } from '@inertiajs/inertia-vue3' import { PencilSquareIcon, XCircleIcon } from '@heroicons/vue/24/outline' import ManagementHeader from '@/Shared/Components/ManagementHeader.vue' import ManagementHeaderItem from '@/Shared/Components/ManagementHeaderItem.vue' +import StyledLink from '@/Shared/Components/StyledLink.vue' const props = defineProps({ students: Object, @@ -59,12 +60,12 @@ watch(form, debounce(() => {
@@ -99,9 +100,9 @@ watch(form, debounce(() => { {{ student.surname }} - + diff --git a/resources/js/Shared/Components/StyledLink.vue b/resources/js/Shared/Components/StyledLink.vue new file mode 100644 index 0000000..31f358a --- /dev/null +++ b/resources/js/Shared/Components/StyledLink.vue @@ -0,0 +1,24 @@ + + +