From dcda8c62551055752a3d6ba69178235d6ec7109f Mon Sep 17 00:00:00 2001 From: Adrian Hopek Date: Tue, 22 Mar 2022 15:03:42 +0100 Subject: [PATCH] - vue composition api (#91) * wip * fix Co-authored-by: EwelinaLasowy --- .eslintrc.js | 2 + resources/js/Composables/vacationTypeInfo.js | 2 +- resources/js/Composables/yearPeriodInfo.js | 4 +- resources/js/Pages/Calendar.vue | 84 +--- resources/js/Pages/Dashboard.vue | 362 ++---------------- resources/js/Pages/Holidays/Create.vue | 33 +- resources/js/Pages/Holidays/Edit.vue | 36 +- resources/js/Pages/Holidays/Index.vue | 45 +-- resources/js/Pages/Login.vue | 31 +- resources/js/Pages/Users/Create.vue | 69 ++-- resources/js/Pages/Users/Edit.vue | 96 ++--- resources/js/Pages/Users/Index.vue | 123 +----- resources/js/Pages/VacationLimits.vue | 75 ++-- resources/js/Pages/VacationRequest/Create.vue | 184 ++++----- resources/js/Pages/VacationRequest/Index.vue | 148 ++----- .../VacationRequest/IndexForApprovers.vue | 196 +++------- resources/js/Pages/VacationRequest/Show.vue | 32 +- resources/js/Shared/Activity.vue | 32 +- resources/js/Shared/Layout/AppLayout.vue | 51 +-- resources/js/Shared/Layout/GuestLayout.vue | 6 - resources/js/Shared/MainMenu.vue | 166 ++++---- resources/js/Shared/Pagination.vue | 61 +++ resources/js/Shared/Status.vue | 33 +- resources/js/Shared/VacationChart.vue | 123 +++--- resources/js/Shared/VacationType.vue | 31 +- .../js/Shared/VacationTypeCalendarIcon.vue | 34 +- resources/js/Shared/Widgets/AbsenceList.vue | 42 ++ .../Widgets/PendingVacationRequests.vue | 76 ++++ .../js/Shared/Widgets/UpcomingHolidays.vue | 46 +++ .../Shared/Widgets/UserVacationRequests.vue | 62 +++ resources/js/Shared/Widgets/VacationStats.vue | 74 ++++ resources/js/Shared/Widgets/Welcome.vue | 35 ++ resources/js/app.js | 10 +- 33 files changed, 938 insertions(+), 1466 deletions(-) create mode 100644 resources/js/Shared/Pagination.vue create mode 100644 resources/js/Shared/Widgets/AbsenceList.vue create mode 100644 resources/js/Shared/Widgets/PendingVacationRequests.vue create mode 100644 resources/js/Shared/Widgets/UpcomingHolidays.vue create mode 100644 resources/js/Shared/Widgets/UserVacationRequests.vue create mode 100644 resources/js/Shared/Widgets/VacationStats.vue create mode 100644 resources/js/Shared/Widgets/Welcome.vue diff --git a/.eslintrc.js b/.eslintrc.js index d4ea4bf..e8d2e95 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,5 +13,7 @@ module.exports = { indent: ['error', 2], 'vue/html-indent': ['error', 2], 'comma-dangle': ['error', 'always-multiline'], + 'object-curly-spacing': ['error', 'always'], + 'vue/require-default-prop': 0, }, } diff --git a/resources/js/Composables/vacationTypeInfo.js b/resources/js/Composables/vacationTypeInfo.js index f2cdc6e..6594ab7 100644 --- a/resources/js/Composables/vacationTypeInfo.js +++ b/resources/js/Composables/vacationTypeInfo.js @@ -65,7 +65,7 @@ const types = [ }, ] -export function useVacationTypeInfo() { +export default function useVacationTypeInfo() { const getTypes = () => types const findType = value => types.find(type => type.value === value) diff --git a/resources/js/Composables/yearPeriodInfo.js b/resources/js/Composables/yearPeriodInfo.js index 8425e0a..ec799da 100644 --- a/resources/js/Composables/yearPeriodInfo.js +++ b/resources/js/Composables/yearPeriodInfo.js @@ -1,5 +1,5 @@ -import {computed} from 'vue' -import {usePage} from '@inertiajs/inertia-vue3' +import { computed } from 'vue' +import { usePage } from '@inertiajs/inertia-vue3' export default function useCurrentYearPeriodInfo() { const minDate = computed(() => new Date(usePage().props.value.years.current, 0, 1)) diff --git a/resources/js/Pages/Calendar.vue b/resources/js/Pages/Calendar.vue index 7e70980..812055f 100644 --- a/resources/js/Pages/Calendar.vue +++ b/resources/js/Pages/Calendar.vue @@ -83,9 +83,7 @@ v-for="user in users.data" :key="user.id" > - +
-
+
{{ user.name }}
@@ -122,66 +118,28 @@
- diff --git a/resources/js/Pages/Dashboard.vue b/resources/js/Pages/Dashboard.vue index 2f2793f..ba6e5d1 100644 --- a/resources/js/Pages/Dashboard.vue +++ b/resources/js/Pages/Dashboard.vue @@ -2,346 +2,38 @@
-
-
-
-
-
-
- -
-
-

- Cześć, -

-

- {{ user.name }} -

-

- {{ user.role }} -

-
-
-
-
-
-
-
-
-
- -
-
-
-
-
- {{ stats.remaining }} -
-
- Pozostało -
-
- Dni do wykorzystania teraz. -
-
-
-
- {{ stats.used }} -
-
- Dni wykorzystane -
-
- Dni, które zostały już wykorzystane na urlop wypoczynkowy. -
-
-
-
- {{ stats.pending }} -
-
- Rozpatrywane -
-
- Dni czekające na akceptację przełożonych. -
-
-
-
- {{ stats.limit }} -
-
- Limit urlopu -
-
- Twój roczny limit urlopu wypoczynkowego. -
-
-
-
- {{ stats.other }} -
-
- Inne urlopy -
-
- Urlopy bezpłatne, okolicznościowe, zwolnienia lekarskie, itd., które zostały już zatwierdzone. -
-
-
-
-
-
+ +
-
-
-
-

- Wnioski oczekujące na akcje -

-
-
-
-
    -
  • -
    -

    - - - Wniosek o {{ findType(request.type).text.toLowerCase() }} - [{{ request.name }}] - -

    -

    - {{ request.from }} - {{ request.to }} -

    -
    -
    - -
    -

    - {{ request.user.name }} -

    -

    - {{ request.user.email }} -

    -
    -
    -
    -
    -
  • -
  • -

    - Brak danych -

    -
  • -
-
-
- - Zobacz wszystkie - -
-
-
-
-
-
-
-

- Twoje wnioski -

-
-
-
-
    -
  • -
    -

    - - - Wniosek o {{ findType(request.type).text.toLowerCase() }} - [{{ request.name }}] - -

    -

    - {{ request.from }} - {{ request.to }} -

    -

    - -

    -
    -
  • -
  • -

    - Brak danych -

    -
  • -
-
-
- - Zobacz wszystkie - -
-
-
-
-
-
-
-

- Dzisiejsze nieobecności -

-
-
-
    -
  • - -
    -

    - {{ absence.user.name }} -

    -

    - {{ absence.user.email }} -

    -
    -
  • -
  • -

    - Brak danych -

    -
  • -
-
-
-
-
-
-
-
-

- Najbliższe dni wolne -

-
-
-
    -
  • -
    -

    - {{ holiday.name }} -

    -

    - {{ holiday.displayDate }} -

    -
    -
  • -
  • -

    - Brak danych -

    -
  • -
-
- - Zobacz wszystkie - -
-
-
-
-
+ + + +
- diff --git a/resources/js/Pages/Holidays/Create.vue b/resources/js/Pages/Holidays/Create.vue index 48a7850..0705e9a 100644 --- a/resources/js/Pages/Holidays/Create.vue +++ b/resources/js/Pages/Holidays/Create.vue @@ -81,34 +81,19 @@
- diff --git a/resources/js/Pages/Holidays/Edit.vue b/resources/js/Pages/Holidays/Edit.vue index ac6a590..77d2940 100644 --- a/resources/js/Pages/Holidays/Edit.vue +++ b/resources/js/Pages/Holidays/Edit.vue @@ -80,34 +80,20 @@ - diff --git a/resources/js/Pages/Holidays/Index.vue b/resources/js/Pages/Holidays/Index.vue index be5d0bb..f41a416 100644 --- a/resources/js/Pages/Holidays/Index.vue +++ b/resources/js/Pages/Holidays/Index.vue @@ -94,10 +94,7 @@ :href="`/holidays/${holiday.id}/edit`" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'font-medium block px-4 py-2 text-sm']" > -