- small changes (#98)
* - added some test * - cr fix * wip * wip * Update resources/js/Shared/MainMenu.vue Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com> * fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com>
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<InertiaLink
|
||||
v-if="previousMonth"
|
||||
as="button"
|
||||
:href="`/vacation-calendar/${previousMonth.value}`"
|
||||
:href="`/vacation/calendar/${previousMonth.value}`"
|
||||
class="flex items-center justify-center rounded-l-md border border-r-0 border-gray-300 bg-white py-2 pl-3 pr-4 text-gray-400 hover:text-gray-500 focus:relative md:w-9 md:px-2 md:hover:bg-gray-50"
|
||||
>
|
||||
<ChevronLeftIcon class="h-5 w-5" />
|
||||
@@ -23,7 +23,7 @@
|
||||
</span>
|
||||
<InertiaLink
|
||||
as="button"
|
||||
:href="`/vacation-calendar/${currentMonth.value}`"
|
||||
:href="`/vacation/calendar/${currentMonth.value}`"
|
||||
class="hidden border-t border-b border-gray-300 bg-white px-3.5 text-sm font-medium flex items-center text-gray-700 hover:bg-gray-50 hover:text-gray-900 focus:relative md:block"
|
||||
>
|
||||
Dzisiaj
|
||||
@@ -31,7 +31,7 @@
|
||||
<InertiaLink
|
||||
v-if="nextMonth"
|
||||
as="button"
|
||||
:href="`/vacation-calendar/${nextMonth.value}`"
|
||||
:href="`/vacation/calendar/${nextMonth.value}`"
|
||||
class="flex items-center justify-center rounded-r-md border border-l-0 border-gray-300 bg-white py-2 pl-4 pr-3 text-gray-400 hover:text-gray-500 focus:relative md:w-9 md:px-2 md:hover:bg-gray-50"
|
||||
>
|
||||
<ChevronRightIcon class="h-5 w-5" />
|
||||
@@ -46,7 +46,7 @@
|
||||
</div>
|
||||
<div v-if="can.generateTimesheet">
|
||||
<a
|
||||
:href="`/timesheet/${selectedMonth.value}`"
|
||||
:href="`/vacation/timesheet/${selectedMonth.value}`"
|
||||
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
||||
>
|
||||
Pobierz plik Excel
|
||||
@@ -59,13 +59,13 @@
|
||||
<tr>
|
||||
<th class="w-64 py-2 border text-lg font-semibold text-gray-800 border-gray-300">
|
||||
<div class="flex justify-center items-center">
|
||||
{{ selectedMonth.name }} {{ years.current }}
|
||||
{{ selectedMonth.name }} {{ years.selected.year }}
|
||||
</div>
|
||||
</th>
|
||||
<th
|
||||
v-for="day in calendar"
|
||||
:key="day.dayOfMonth"
|
||||
class="border border-gray-300 text-lg font-semibold text-gray-900 py-4 px-2"
|
||||
class="border border-gray-300 text-lg font-semibold text-gray-900 py-2 px-2"
|
||||
style="min-width: 46px;"
|
||||
:class="{ 'bg-red-100 text-red-800': day.isWeekend || day.isHoliday, 'text-blumilk-600 bg-blumilk-25': day.isToday }"
|
||||
>
|
||||
@@ -83,16 +83,13 @@
|
||||
v-for="user in users.data"
|
||||
:key="user.id"
|
||||
>
|
||||
<th class="border border-gray-300 py-2 px-4">
|
||||
<th class="border border-gray-300 py-2 px-2">
|
||||
<div class="flex justify-start items-center">
|
||||
<span class="inline-flex items-center justify-center h-10 w-10 rounded-full">
|
||||
<img
|
||||
class="h-10 w-10 rounded-full"
|
||||
:src="user.avatar"
|
||||
>
|
||||
<span class="inline-flex items-center justify-center h-8 w-8 rounded-full">
|
||||
<img :src="user.avatar">
|
||||
</span>
|
||||
<div class="ml-3">
|
||||
<div class="text-sm font-medium text-gray-900 whitespace-nowrap">
|
||||
<div class="text-sm font-medium text-gray-900 truncate">
|
||||
{{ user.name }}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -81,6 +81,7 @@ import { useMonthInfo } from '@/Composables/monthInfo'
|
||||
import VacationBar from '@/Shared/VacationBar'
|
||||
|
||||
const props = defineProps({
|
||||
years: Object,
|
||||
monthlyUsage: Object,
|
||||
currentMonth: String,
|
||||
})
|
||||
@@ -89,6 +90,6 @@ const { getMonths } = useMonthInfo()
|
||||
const months = getMonths()
|
||||
|
||||
function isCurrentMonth(month) {
|
||||
return props.currentMonth === month.value
|
||||
return (props.years.selected.year === props.years.current.year && props.currentMonth === month.value)
|
||||
}
|
||||
</script>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<div class="border-t border-gray-200">
|
||||
<div class="overflow-x-auto xl:overflow-x-visible overflow-y-auto xl:overflow-y-visible">
|
||||
<form @submit.prevent="submitVacationDays">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<table class="min-w-full divide-y divide-gray-200 border-b">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
@@ -155,7 +155,7 @@ function submitVacationDays() {
|
||||
days: item.hasVacation ? item.days : null,
|
||||
})),
|
||||
}))
|
||||
.put('/vacation-limits', {
|
||||
.put('/vacation/limits', {
|
||||
preserveState: (page) => Object.keys(page.props.errors).length,
|
||||
preserveScroll: true,
|
||||
})
|
||||
|
@@ -287,7 +287,7 @@
|
||||
<div class="flex justify-end py-3">
|
||||
<div class="space-x-3">
|
||||
<InertiaLink
|
||||
href="/vacation-requests"
|
||||
href="/vacation/requests"
|
||||
class="bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
||||
>
|
||||
Anuluj
|
||||
@@ -388,7 +388,7 @@ function createForm() {
|
||||
type: data.type.value,
|
||||
user: data.user.id,
|
||||
}))
|
||||
.post('/vacation-requests')
|
||||
.post('/vacation/requests')
|
||||
}
|
||||
|
||||
function onFromChange(selectedDates, dateStr) {
|
||||
@@ -418,14 +418,14 @@ function resetForm() {
|
||||
|
||||
async function refreshEstimatedDays(from, to) {
|
||||
if (from && to) {
|
||||
const res = await axios.post('/api/calculate-vacation-days', { from, to })
|
||||
const res = await axios.post('/api/calculate-vacation/days', { from, to })
|
||||
|
||||
estimatedDays.value = res.data
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshVacationStats(user) {
|
||||
const res = await axios.post('/api/calculate-vacation-stats', { user: user.id })
|
||||
const res = await axios.post('/api/calculate-vacation/stats', { user: user.id })
|
||||
|
||||
stats.value = res.data
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<InertiaLink
|
||||
href="/vacation-requests/create"
|
||||
href="/vacation/requests/create"
|
||||
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
||||
>
|
||||
Dodaj wniosek
|
||||
@@ -84,7 +84,7 @@
|
||||
>
|
||||
<td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}`"
|
||||
:href="`/vacation/requests/${request.id}`"
|
||||
class="font-semibold text-blumilk-600 hover:text-blumilk-500 hover:underline"
|
||||
>
|
||||
{{ request.name }}
|
||||
@@ -107,13 +107,13 @@
|
||||
</td>
|
||||
<td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}`"
|
||||
:href="`/vacation/requests/${request.id}`"
|
||||
class="flex justify-around"
|
||||
>
|
||||
<ChevronRightIcon class="block w-6 h-6 fill-blumilk-500" />
|
||||
</InertiaLink>
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}`"
|
||||
:href="`/vacation/requests/${request.id}`"
|
||||
class="absolute inset-0"
|
||||
/>
|
||||
</td>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<InertiaLink
|
||||
href="/vacation-requests/create"
|
||||
href="/vacation/requests/create"
|
||||
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
||||
>
|
||||
Dodaj wniosek
|
||||
@@ -224,7 +224,7 @@
|
||||
>
|
||||
<td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}`"
|
||||
:href="`/vacation/requests/${request.id}`"
|
||||
class="font-semibold text-blumilk-600 hover:text-blumilk-500 hover:underline"
|
||||
>
|
||||
{{ request.name }}
|
||||
@@ -263,13 +263,13 @@
|
||||
</td>
|
||||
<td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500">
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}`"
|
||||
:href="`/vacation/requests/${request.id}`"
|
||||
class="flex justify-around"
|
||||
>
|
||||
<ChevronRightIcon class="block w-6 h-6 fill-blumilk-500" />
|
||||
</InertiaLink>
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}`"
|
||||
:href="`/vacation/requests/${request.id}`"
|
||||
class="absolute inset-0"
|
||||
/>
|
||||
</td>
|
||||
@@ -334,7 +334,7 @@ const form = reactive({
|
||||
})
|
||||
|
||||
watch(form, debounce(() => {
|
||||
Inertia.get('/vacation-requests', { user: form.user?.id, status: form.status.value }, {
|
||||
Inertia.get('/vacation/requests', { user: form.user?.id, status: form.status.value }, {
|
||||
preserveState: true,
|
||||
replace: true,
|
||||
})
|
||||
|
@@ -60,13 +60,14 @@
|
||||
Data
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
<template v-if="request.days.length > 1">
|
||||
{{ request.from }} - {{ request.to }}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ request.from }}
|
||||
</template>
|
||||
<span class="font-semibold">
|
||||
<template v-if="request.days.length > 1">
|
||||
{{ request.from }} - {{ request.to }} [Liczba dni: {{ request.days.length }}]
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ request.from }} [Liczba dni: {{ request.days.length }}]
|
||||
</template>
|
||||
[Liczba dni: {{ request.days.length }}]
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
@@ -100,7 +101,7 @@
|
||||
</div>
|
||||
<div class="ml-4 flex-shrink-0">
|
||||
<a
|
||||
:href="`/vacation-requests/${request.id}/download`"
|
||||
:href="`/vacation/requests/${request.id}/download`"
|
||||
target="_blank"
|
||||
class="font-medium text-blumilk-600 hover:text-blumilk-500"
|
||||
>
|
||||
@@ -130,7 +131,7 @@
|
||||
</div>
|
||||
<div class="mt-5">
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}/accept-as-technical`"
|
||||
:href="`/vacation/requests/${request.id}/accept-as-technical`"
|
||||
method="post"
|
||||
as="button"
|
||||
preserve-scroll
|
||||
@@ -156,7 +157,7 @@
|
||||
</div>
|
||||
<div class="mt-5">
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}/accept-as-administrative`"
|
||||
:href="`/vacation/requests/${request.id}/accept-as-administrative`"
|
||||
method="post"
|
||||
as="button"
|
||||
preserve-scroll
|
||||
@@ -182,7 +183,7 @@
|
||||
</div>
|
||||
<div class="mt-5">
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}/reject`"
|
||||
:href="`/vacation/requests/${request.id}/reject`"
|
||||
method="post"
|
||||
as="button"
|
||||
preserve-scroll
|
||||
@@ -208,7 +209,7 @@
|
||||
</div>
|
||||
<div class="mt-5">
|
||||
<InertiaLink
|
||||
:href="`/vacation-requests/${request.id}/cancel`"
|
||||
:href="`/vacation/requests/${request.id}/cancel`"
|
||||
method="post"
|
||||
as="button"
|
||||
preserve-scroll
|
||||
|
Reference in New Issue
Block a user