diff --git a/app/Infrastructure/Http/Controllers/HolidayController.php b/app/Infrastructure/Http/Controllers/HolidayController.php index e69a8ff..fe256dd 100644 --- a/app/Infrastructure/Http/Controllers/HolidayController.php +++ b/app/Infrastructure/Http/Controllers/HolidayController.php @@ -35,7 +35,7 @@ class HolidayController extends Controller return redirect() ->route("holidays.index") - ->with("success", __("Holiday has been created")); + ->with("success", __("Holiday has been created.")); } public function edit(Holiday $holiday): Response @@ -51,7 +51,7 @@ class HolidayController extends Controller return redirect() ->route("holidays.index") - ->with("success", __("Holiday has been updated")); + ->with("success", __("Holiday has been updated.")); } public function destroy(Holiday $holiday): RedirectResponse @@ -60,6 +60,6 @@ class HolidayController extends Controller return redirect() ->route("holidays.index") - ->with("success", __("Holiday has been deleted")); + ->with("success", __("Holiday has been deleted.")); } } diff --git a/app/Infrastructure/Http/Controllers/SelectYearPeriodController.php b/app/Infrastructure/Http/Controllers/SelectYearPeriodController.php index 14b95e7..75b3cd3 100644 --- a/app/Infrastructure/Http/Controllers/SelectYearPeriodController.php +++ b/app/Infrastructure/Http/Controllers/SelectYearPeriodController.php @@ -17,6 +17,6 @@ class SelectYearPeriodController extends Controller return redirect() ->back() - ->with("success", __("Selected year period has been changed")); + ->with("success", __("Selected year period has been changed.")); } } diff --git a/app/Infrastructure/Http/Controllers/UserController.php b/app/Infrastructure/Http/Controllers/UserController.php index 113657a..a49e9ee 100644 --- a/app/Infrastructure/Http/Controllers/UserController.php +++ b/app/Infrastructure/Http/Controllers/UserController.php @@ -46,7 +46,7 @@ class UserController extends Controller return redirect() ->route("users.index") - ->with("success", __("User has been created")); + ->with("success", __("User has been created.")); } public function edit(User $user): Response @@ -64,7 +64,7 @@ class UserController extends Controller return redirect() ->route("users.index") - ->with("success", __("User has been updated")); + ->with("success", __("User has been updated.")); } public function destroy(User $user): RedirectResponse @@ -73,7 +73,7 @@ class UserController extends Controller return redirect() ->route("users.index") - ->with("success", __("User has been deleted")); + ->with("success", __("User has been deleted.")); } public function restore(User $user): RedirectResponse @@ -82,6 +82,6 @@ class UserController extends Controller return redirect() ->route("users.index") - ->with("success", __("User has been restored")); + ->with("success", __("User has been restored.")); } } diff --git a/app/Infrastructure/Http/Controllers/VacationLimitController.php b/app/Infrastructure/Http/Controllers/VacationLimitController.php index 7d207d6..2762b7d 100644 --- a/app/Infrastructure/Http/Controllers/VacationLimitController.php +++ b/app/Infrastructure/Http/Controllers/VacationLimitController.php @@ -35,6 +35,6 @@ class VacationLimitController extends Controller return redirect() ->back() - ->with("success", __("Vacation limits have been updated")); + ->with("success", __("Vacation limits have been updated.")); } } diff --git a/app/Infrastructure/Http/Controllers/VacationRequestController.php b/app/Infrastructure/Http/Controllers/VacationRequestController.php index 814b35d..060afd6 100644 --- a/app/Infrastructure/Http/Controllers/VacationRequestController.php +++ b/app/Infrastructure/Http/Controllers/VacationRequestController.php @@ -95,7 +95,8 @@ class VacationRequestController extends Controller $stateManager->markAsCreated($vacationRequest); return redirect() - ->route("vacation.requests.index"); + ->route("vacation.requests.show", $vacationRequest) + ->with("success", __("Vacation request has been created.")); } public function reject( @@ -104,7 +105,8 @@ class VacationRequestController extends Controller ): RedirectResponse { $stateManager->reject($vacationRequest); - return redirect()->back(); + return redirect()->back() + ->with("success", __("Vacation request has been rejected.")); } public function cancel( @@ -113,7 +115,8 @@ class VacationRequestController extends Controller ): RedirectResponse { $stateManager->cancel($vacationRequest); - return redirect()->back(); + return redirect()->back() + ->with("success", __("Vacation request has been canceled.")); } public function acceptAsTechnical( @@ -122,7 +125,8 @@ class VacationRequestController extends Controller ): RedirectResponse { $stateManager->acceptAsTechnical($vacationRequest); - return redirect()->back(); + return redirect()->back() + ->with("success", __("Vacation request has been accepted.")); } public function acceptAsAdministrative( @@ -131,6 +135,7 @@ class VacationRequestController extends Controller ): RedirectResponse { $stateManager->acceptAsAdministrative($vacationRequest); - return redirect()->back(); + return redirect()->back() + ->with("success", __("Vacation request has been accepted.")); } } diff --git a/package-lock.json b/package-lock.json index 7795438..958999c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,8 @@ "vue": "^3.2.26", "vue-echarts": "^6.0.2", "vue-flatpickr-component": "^9.0.5", - "vue-loader": "^17.0.0" + "vue-loader": "^17.0.0", + "vue-toastification": "^2.0.0-rc.5" }, "devDependencies": { "eslint": "^8.6.0", @@ -8943,6 +8944,14 @@ "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=" }, + "node_modules/vue-toastification": { + "version": "2.0.0-rc.5", + "resolved": "https://registry.npmjs.org/vue-toastification/-/vue-toastification-2.0.0-rc.5.tgz", + "integrity": "sha512-q73e5jy6gucEO/U+P48hqX+/qyXDozAGmaGgLFm5tXX4wJBcVsnGp4e/iJqlm9xzHETYOilUuwOUje2Qg1JdwA==", + "peerDependencies": { + "vue": "^3.0.2" + } + }, "node_modules/watchpack": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", @@ -16100,6 +16109,12 @@ } } }, + "vue-toastification": { + "version": "2.0.0-rc.5", + "resolved": "https://registry.npmjs.org/vue-toastification/-/vue-toastification-2.0.0-rc.5.tgz", + "integrity": "sha512-q73e5jy6gucEO/U+P48hqX+/qyXDozAGmaGgLFm5tXX4wJBcVsnGp4e/iJqlm9xzHETYOilUuwOUje2Qg1JdwA==", + "requires": {} + }, "watchpack": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", diff --git a/package.json b/package.json index c69812f..9588eff 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "vue": "^3.2.26", "vue-echarts": "^6.0.2", "vue-flatpickr-component": "^9.0.5", - "vue-loader": "^17.0.0" + "vue-loader": "^17.0.0", + "vue-toastification": "^2.0.0-rc.5" }, "devDependencies": { "eslint": "^8.6.0", diff --git a/resources/css/app.css b/resources/css/app.css index 350af46..3c5c746 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,4 +1,5 @@ @import 'flatpickr/dist/themes/light.css'; +@import 'vue-toastification/dist/index.css'; @tailwind base; @tailwind components; diff --git a/resources/js/Pages/Login.vue b/resources/js/Pages/Login.vue index 324fd4e..e73c659 100644 --- a/resources/js/Pages/Login.vue +++ b/resources/js/Pages/Login.vue @@ -15,7 +15,7 @@
{{ errors.oauth }}
diff --git a/resources/js/Pages/VacationRequest/Show.vue b/resources/js/Pages/VacationRequest/Show.vue index 1c4f519..1e46a04 100644 --- a/resources/js/Pages/VacationRequest/Show.vue +++ b/resources/js/Pages/VacationRequest/Show.vue @@ -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 diff --git a/resources/js/Shared/Layout/AppLayout.vue b/resources/js/Shared/Layout/AppLayout.vue index 7ad4df4..3d68e57 100644 --- a/resources/js/Shared/Layout/AppLayout.vue +++ b/resources/js/Shared/Layout/AppLayout.vue @@ -11,9 +11,36 @@ diff --git a/resources/js/Shared/Layout/GuestLayout.vue b/resources/js/Shared/Layout/GuestLayout.vue index 5c2589c..50ad393 100644 --- a/resources/js/Shared/Layout/GuestLayout.vue +++ b/resources/js/Shared/Layout/GuestLayout.vue @@ -1,4 +1,3 @@ -Proszę o {{ mb_strtolower($vacationRequest->type->label()) }} w okresie od dnia {{ $vacationRequest->from->format("d.m.Y") }} - do dnia {{ $vacationRequest->to->format("d.m.Y") }} włącznie tj. {{ $vacationRequest->estimated_days }} dni roboczych za rok {{ $vacationRequest->yearPeriod->year }}. + do dnia {{ $vacationRequest->to->format("d.m.Y") }} włącznie tj. {{ $vacationRequest->vacations()->count() }} dni roboczych za rok {{ $vacationRequest->yearPeriod->year }}.