Merge branch 'main' into #41-email-notifications
# Conflicts: # app/Domain/CalendarGenerator.php # app/Domain/Enums/VacationRequestState.php # app/Domain/VacationRequestStateManager.php # resources/js/Composables/statusInfo.js # resources/js/Pages/Calendar.vue # resources/js/Shared/MainMenu.vue # resources/lang/pl.json # tests/Feature/VacationRequestTest.php # tests/Unit/VacationRequestStatesTest.php
This commit is contained in:
60
resources/js/Composables/monthInfo.js
Normal file
60
resources/js/Composables/monthInfo.js
Normal file
@@ -0,0 +1,60 @@
|
||||
const months = [
|
||||
{
|
||||
'name': 'Styczeń',
|
||||
'value': 'january',
|
||||
},
|
||||
{
|
||||
'name': 'Luty',
|
||||
'value': 'february',
|
||||
},
|
||||
{
|
||||
'name': 'Marzec',
|
||||
'value': 'march',
|
||||
},
|
||||
{
|
||||
'name': 'Kwiecień',
|
||||
'value': 'april',
|
||||
},
|
||||
{
|
||||
'name': 'Maj',
|
||||
'value': 'may',
|
||||
},
|
||||
{
|
||||
'name': 'Czerwiec',
|
||||
'value': 'june',
|
||||
},
|
||||
{
|
||||
'name': 'Lipiec',
|
||||
'value': 'july',
|
||||
},
|
||||
{
|
||||
'name': 'Sierpień',
|
||||
'value': 'august',
|
||||
},
|
||||
{
|
||||
'name': 'Wrzesień',
|
||||
'value': 'september',
|
||||
},
|
||||
{
|
||||
'name': 'Październik',
|
||||
'value': 'october',
|
||||
},
|
||||
{
|
||||
'name': 'Listopad',
|
||||
'value': 'november',
|
||||
},
|
||||
{
|
||||
'name': 'Grudzień',
|
||||
'value': 'december',
|
||||
},
|
||||
]
|
||||
|
||||
export function useMonthInfo() {
|
||||
const getMonths = () => months
|
||||
const findMonth = value => months.find(month => month.value === value)
|
||||
|
||||
return {
|
||||
getMonths,
|
||||
findMonth,
|
||||
}
|
||||
}
|
@@ -31,7 +31,7 @@ const statuses = [
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'Czeka na akceptację od technicznego',
|
||||
text: 'Czeka na akceptację od przełożonego technicznego',
|
||||
value: 'waiting_for_technical',
|
||||
outline: {
|
||||
icon: OutlineClockIcon,
|
||||
@@ -44,7 +44,7 @@ const statuses = [
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'Czeka na akceptację od administracyjnego',
|
||||
text: 'Czeka na akceptację od przełożonego administracyjnego',
|
||||
value: 'waiting_for_administrative',
|
||||
outline: {
|
||||
icon: OutlineClockIcon,
|
||||
@@ -70,7 +70,7 @@ const statuses = [
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'Zaakceptowany przez technicznego',
|
||||
text: 'Zaakceptowany przez przełożonego technicznego',
|
||||
value: 'accepted_by_technical',
|
||||
outline: {
|
||||
icon: OutlineThumbUpIcon,
|
||||
@@ -83,7 +83,7 @@ const statuses = [
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'Zaakceptowany przez administracyjnego',
|
||||
text: 'Zaakceptowany przez przełożonego administracyjnego',
|
||||
value: 'accepted_by_administrative',
|
||||
outline: {
|
||||
icon: OutlineThumbUpIcon,
|
||||
|
@@ -126,6 +126,7 @@
|
||||
import {Menu, MenuButton, MenuItem, MenuItems} from '@headlessui/vue'
|
||||
import {CheckIcon, ChevronDownIcon} from '@heroicons/vue/solid'
|
||||
import {computed} from 'vue'
|
||||
import {useMonthInfo} from '@/Composables/monthInfo'
|
||||
|
||||
export default {
|
||||
name: 'VacationCalendar',
|
||||
@@ -152,58 +153,10 @@ export default {
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const months = [
|
||||
{
|
||||
'name': 'Styczeń',
|
||||
'value': 'january',
|
||||
},
|
||||
{
|
||||
'name': 'Luty',
|
||||
'value': 'february',
|
||||
},
|
||||
{
|
||||
'name': 'Marzec',
|
||||
'value': 'march',
|
||||
},
|
||||
{
|
||||
'name': 'Kwiecień',
|
||||
'value': 'april',
|
||||
},
|
||||
{
|
||||
'name': 'Maj',
|
||||
'value': 'may',
|
||||
},
|
||||
{
|
||||
'name': 'Czerwiec',
|
||||
'value': 'june',
|
||||
},
|
||||
{
|
||||
'name': 'Lipiec',
|
||||
'value': 'july',
|
||||
},
|
||||
{
|
||||
'name': 'Sierpień',
|
||||
'value': 'august',
|
||||
},
|
||||
{
|
||||
'name': 'Wrzesień',
|
||||
'value': 'september',
|
||||
},
|
||||
{
|
||||
'name': 'Październik',
|
||||
'value': 'october',
|
||||
},
|
||||
{
|
||||
'name': 'Listopad',
|
||||
'value': 'november',
|
||||
},
|
||||
{
|
||||
'name': 'Grudzień',
|
||||
'value': 'december',
|
||||
},
|
||||
]
|
||||
const {getMonths, findMonth} = useMonthInfo()
|
||||
const months = getMonths()
|
||||
|
||||
const selectedMonth = computed(() => months.find(month => month.value === props.currentMonth))
|
||||
const selectedMonth = computed(() => findMonth(props.currentMonth))
|
||||
|
||||
return {
|
||||
months,
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<div class="p-4">
|
||||
<div class="flex items-center">
|
||||
<div class="w-0 flex-1 flex justify-between">
|
||||
<ExclamationIcon class="h-5 w-5 text-white" />
|
||||
<ExclamationIcon class="h-5 w-5 mr-1 text-white" />
|
||||
<p class="w-0 flex-1 text-sm font-medium text-white">
|
||||
{{ errors.oauth }}
|
||||
</p>
|
||||
|
@@ -126,6 +126,7 @@
|
||||
:href="`/vacation-requests/${request.id}/accept-as-technical`"
|
||||
method="post"
|
||||
as="button"
|
||||
preserve-scroll
|
||||
class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
||||
>
|
||||
Zaakceptuj wniosek
|
||||
@@ -148,6 +149,7 @@
|
||||
:href="`/vacation-requests/${request.id}/accept-as-administrative`"
|
||||
method="post"
|
||||
as="button"
|
||||
preserve-scroll
|
||||
class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
||||
>
|
||||
Zaakceptuj wniosek
|
||||
@@ -170,6 +172,7 @@
|
||||
:href="`/vacation-requests/${request.id}/reject`"
|
||||
method="post"
|
||||
as="button"
|
||||
preserve-scroll
|
||||
class="inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm"
|
||||
>
|
||||
Odrzuć wniosek
|
||||
@@ -192,6 +195,7 @@
|
||||
:href="`/vacation-requests/${request.id}/cancel`"
|
||||
method="post"
|
||||
as="button"
|
||||
preserve-scroll
|
||||
class="inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm"
|
||||
>
|
||||
Anuluj wniosek
|
||||
|
@@ -11,9 +11,36 @@
|
||||
|
||||
<script>
|
||||
import MainMenu from '@/Shared/MainMenu'
|
||||
import {useToast} from 'vue-toastification'
|
||||
import {watch} from 'vue'
|
||||
|
||||
export default {
|
||||
name: 'AppLayout',
|
||||
components: {MainMenu},
|
||||
components: {
|
||||
MainMenu,
|
||||
},
|
||||
props: {
|
||||
flash: {
|
||||
type: Object,
|
||||
default: () => null,
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const toast = useToast()
|
||||
|
||||
watch(() => props.flash, flash => {
|
||||
if (flash.success) {
|
||||
toast.success(flash.success)
|
||||
}
|
||||
|
||||
if (flash.error) {
|
||||
toast.error(flash.error)
|
||||
}
|
||||
}, {immediate:true})
|
||||
|
||||
return {
|
||||
toast,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
<template>
|
||||
<div class="min-h-screen flex flex-col justify-center py-12 sm:px-6 lg:px-8 bg-blumilk-25">
|
||||
<slot />
|
||||
|
@@ -363,11 +363,11 @@ export default {
|
||||
|
||||
const navigation = [
|
||||
{name: 'Strona główna', href: '/', icon: HomeIcon, current: true},
|
||||
{name: 'Użytkownicy', href: '/users', icon: UserGroupIcon, current: false},
|
||||
{name: 'Dostępne urlopy', href: '/vacation-limits', icon: SunIcon, current: false},
|
||||
{name: 'Twoje wnioski', href: '/vacation-requests', icon: CollectionIcon, current: false},
|
||||
{name: 'Dni wolne', href: '/holidays', icon: StarIcon, current: false},
|
||||
{name: 'Wnioski urlopowe', href: '/vacation-requests', icon: CollectionIcon, current: false},
|
||||
{name: 'Kalendarz urlopów', href: '/vacation-calendar', icon: CalendarIcon, current: false},
|
||||
{name: 'Dni wolne', href: '/holidays', icon: StarIcon, current: false},
|
||||
{name: 'Limity urlopów', href: '/vacation-limits', icon: SunIcon, current: false},
|
||||
{name: 'Użytkownicy', href: '/users', icon: UserGroupIcon, current: false},
|
||||
]
|
||||
const userNavigation = [
|
||||
{name: 'Your Profile', href: '#'},
|
||||
@@ -390,4 +390,4 @@ export default {
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
@@ -4,6 +4,7 @@ import {InertiaProgress} from '@inertiajs/progress'
|
||||
import AppLayout from '@/Shared/Layout/AppLayout'
|
||||
import Flatpickr from 'flatpickr'
|
||||
import { Polish } from 'flatpickr/dist/l10n/pl.js'
|
||||
import Toast from 'vue-toastification'
|
||||
|
||||
createInertiaApp({
|
||||
resolve: name => {
|
||||
@@ -16,6 +17,11 @@ createInertiaApp({
|
||||
setup({el, App, props, plugin}) {
|
||||
createApp({render: () => h(App, props)})
|
||||
.use(plugin)
|
||||
.use(Toast, {
|
||||
position: 'bottom-right',
|
||||
maxToast: 5,
|
||||
|
||||
})
|
||||
.component('InertiaLink', Link)
|
||||
.component('InertiaHead', Head)
|
||||
.mount(el)
|
||||
|
Reference in New Issue
Block a user