From cc4c07717ed2c62c3ab1cd61dcd2df9e2a3d0733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Pocrnji=C4=8D?= Date: Sun, 18 Jan 2026 18:21:41 +0100 Subject: [PATCH] Changes --- app/Http/Controllers/FieldJobController.php | 6 +- config/jetstream.php | 2 +- resources/js/Components/ConfirmsPassword.vue | 176 ++++----- resources/js/Components/Layouts/NavMain.vue | 70 ---- .../PersonInfo/AddressCreateForm.vue | 124 +++--- .../PersonInfo/AddressUpdateForm.vue | 62 ++- .../PersonInfo/PersonInfoAddressesTab.vue | 11 +- .../PersonInfo/PersonInfoEmailsTab.vue | 8 +- .../PersonInfo/PersonInfoPhonesTab.vue | 11 +- .../Components/PersonInfo/PhoneCreateForm.vue | 78 ++-- .../Components/PersonInfo/PhoneUpdateForm.vue | 51 ++- resources/js/Components/ui/field/Field.vue | 20 + .../js/Components/ui/field/FieldContent.vue | 21 ++ .../Components/ui/field/FieldDescription.vue | 23 ++ .../js/Components/ui/field/FieldError.vue | 43 +++ .../js/Components/ui/field/FieldGroup.vue | 21 ++ .../js/Components/ui/field/FieldLabel.vue | 24 ++ .../js/Components/ui/field/FieldLegend.vue | 25 ++ .../js/Components/ui/field/FieldSeparator.vue | 30 ++ resources/js/Components/ui/field/FieldSet.vue | 22 ++ .../js/Components/ui/field/FieldTitle.vue | 21 ++ resources/js/Components/ui/field/index.js | 36 ++ .../js/Components/ui/select/SelectContent.vue | 1 + .../js/Layouts/Partials/GlobalSearch.vue | 356 ++++++++---------- .../Cases/Partials/ContractMetaEditDialog.vue | 229 +++++++++++ .../js/Pages/Cases/Partials/ContractTable.vue | 138 +++++-- resources/js/Pages/Cases/Show.vue | 8 - resources/js/Pages/Client/Contracts.vue | 96 ++++- .../Client/Partials/FormChangeSegment.vue | 155 ++++++++ resources/js/Pages/FieldJob/Index.vue | 43 ++- .../LogoutOtherBrowserSessionsForm.vue | 12 +- resources/js/Pages/Segments/Show.vue | 82 ++-- routes/web.php | 14 +- 33 files changed, 1440 insertions(+), 579 deletions(-) delete mode 100644 resources/js/Components/Layouts/NavMain.vue create mode 100644 resources/js/Components/ui/field/Field.vue create mode 100644 resources/js/Components/ui/field/FieldContent.vue create mode 100644 resources/js/Components/ui/field/FieldDescription.vue create mode 100644 resources/js/Components/ui/field/FieldError.vue create mode 100644 resources/js/Components/ui/field/FieldGroup.vue create mode 100644 resources/js/Components/ui/field/FieldLabel.vue create mode 100644 resources/js/Components/ui/field/FieldLegend.vue create mode 100644 resources/js/Components/ui/field/FieldSeparator.vue create mode 100644 resources/js/Components/ui/field/FieldSet.vue create mode 100644 resources/js/Components/ui/field/FieldTitle.vue create mode 100644 resources/js/Components/ui/field/index.js create mode 100644 resources/js/Pages/Cases/Partials/ContractMetaEditDialog.vue create mode 100644 resources/js/Pages/Client/Partials/FormChangeSegment.vue diff --git a/app/Http/Controllers/FieldJobController.php b/app/Http/Controllers/FieldJobController.php index 92b79e5..51aa08c 100644 --- a/app/Http/Controllers/FieldJobController.php +++ b/app/Http/Controllers/FieldJobController.php @@ -62,7 +62,8 @@ public function index(Request $request) $unassignedClients = $unassignedContracts->get() ->pluck('clientCase.client') ->filter() - ->unique('id'); + ->unique('id') + ->values(); $assignedContracts = Contract::query() @@ -98,7 +99,8 @@ public function index(Request $request) $assignedClients = $assignedContracts->get() ->pluck('clientCase.client') ->filter() - ->unique('id'); + ->unique('id') + ->values(); $users = User::query()->orderBy('name')->get(['id', 'name']); diff --git a/config/jetstream.php b/config/jetstream.php index bff61fa..1fd04df 100644 --- a/config/jetstream.php +++ b/config/jetstream.php @@ -60,7 +60,7 @@ 'features' => [ // Features::termsAndPrivacyPolicy(), // Features::profilePhotos(), - Features::api(), + // Features::api(), // Features::teams(['invitations' => true]), Features::accountDeletion(), ], diff --git a/resources/js/Components/ConfirmsPassword.vue b/resources/js/Components/ConfirmsPassword.vue index 7b24493..e861e51 100644 --- a/resources/js/Components/ConfirmsPassword.vue +++ b/resources/js/Components/ConfirmsPassword.vue @@ -1,118 +1,118 @@ diff --git a/resources/js/Components/Layouts/NavMain.vue b/resources/js/Components/Layouts/NavMain.vue deleted file mode 100644 index e5261e3..0000000 --- a/resources/js/Components/Layouts/NavMain.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - diff --git a/resources/js/Components/PersonInfo/AddressCreateForm.vue b/resources/js/Components/PersonInfo/AddressCreateForm.vue index eb69b26..604e428 100644 --- a/resources/js/Components/PersonInfo/AddressCreateForm.vue +++ b/resources/js/Components/PersonInfo/AddressCreateForm.vue @@ -7,12 +7,7 @@ import { router } from "@inertiajs/vue3"; import CreateDialog from "../Dialogs/CreateDialog.vue"; import UpdateDialog from "../Dialogs/UpdateDialog.vue"; import SectionTitle from "../SectionTitle.vue"; -import { - FormControl, - FormItem, - FormLabel, - FormMessage, -} from "@/Components/ui/form"; +import { FormControl, FormItem, FormLabel, FormMessage } from "@/Components/ui/form"; import { Input } from "@/Components/ui/input"; import { Select, @@ -97,7 +92,7 @@ watch( country: a.country || "", post_code: a.post_code || a.postal_code || "", city: a.city || "", - type_id: a.type_id ?? (props.types?.[0]?.id ?? null), + type_id: a.type_id ?? props.types?.[0]?.id ?? null, description: a.description || "", }); return; @@ -108,52 +103,51 @@ watch( { immediate: true } ); -watch(() => props.show, (val) => { - if (val && props.edit && props.id) { - const a = props.person.addresses?.find((x) => x.id === props.id); - if (a) { - form.setValues({ - address: a.address || "", - country: a.country || "", - post_code: a.post_code || a.postal_code || "", - city: a.city || "", - type_id: a.type_id ?? (props.types?.[0]?.id ?? null), - description: a.description || "", - }); +watch( + () => props.show, + (val) => { + if (val && props.edit && props.id) { + const a = props.person.addresses?.find((x) => x.id === props.id); + if (a) { + form.setValues({ + address: a.address || "", + country: a.country || "", + post_code: a.post_code || a.postal_code || "", + city: a.city || "", + type_id: a.type_id ?? props.types?.[0]?.id ?? null, + description: a.description || "", + }); + } + } else if (val && !props.edit) { + resetForm(); } - } else if (val && !props.edit) { - resetForm(); } -}); +); const create = async () => { processing.value = true; const { values } = form; - router.post( - route("person.address.create", props.person), - values, - { - preserveScroll: true, - onSuccess: () => { - processing.value = false; - close(); - resetForm(); - }, - onError: (errors) => { - Object.keys(errors).forEach((field) => { - const errorMessages = Array.isArray(errors[field]) - ? errors[field] - : [errors[field]]; - form.setFieldError(field, errorMessages[0]); - }); - processing.value = false; - }, - onFinish: () => { - processing.value = false; - }, - } - ); + router.post(route("person.address.create", props.person), values, { + preserveScroll: true, + onSuccess: () => { + processing.value = false; + close(); + resetForm(); + }, + onError: (errors) => { + Object.keys(errors).forEach((field) => { + const errorMessages = Array.isArray(errors[field]) + ? errors[field] + : [errors[field]]; + form.setFieldError(field, errorMessages[0]); + }); + processing.value = false; + }, + onFinish: () => { + processing.value = false; + }, + }); }; const update = async () => { @@ -223,7 +217,12 @@ const onConfirm = () => { Naslov - + @@ -233,7 +232,12 @@ const onConfirm = () => { Država - + @@ -243,7 +247,12 @@ const onConfirm = () => { Poštna številka - + @@ -253,7 +262,22 @@ const onConfirm = () => { Mesto - + + + + + + + + + Opis + + diff --git a/resources/js/Components/PersonInfo/AddressUpdateForm.vue b/resources/js/Components/PersonInfo/AddressUpdateForm.vue index f63683d..71166b8 100644 --- a/resources/js/Components/PersonInfo/AddressUpdateForm.vue +++ b/resources/js/Components/PersonInfo/AddressUpdateForm.vue @@ -6,12 +6,7 @@ import * as z from "zod"; import { router } from "@inertiajs/vue3"; import UpdateDialog from "../Dialogs/UpdateDialog.vue"; import SectionTitle from "../SectionTitle.vue"; -import { - FormControl, - FormItem, - FormLabel, - FormMessage, -} from "@/Components/ui/form"; +import { FormControl, FormItem, FormLabel, FormMessage } from "@/Components/ui/form"; import { Input } from "@/Components/ui/input"; import { Select, @@ -85,7 +80,7 @@ const hydrate = () => { country: a.country || "", post_code: a.post_code || a.postal_code || "", city: a.city || "", - type_id: a.type_id ?? (props.types?.[0]?.id ?? null), + type_id: a.type_id ?? props.types?.[0]?.id ?? null, description: a.description || "", }); return; @@ -94,10 +89,17 @@ const hydrate = () => { resetForm(); }; -watch(() => props.id, () => hydrate(), { immediate: true }); -watch(() => props.show, (v) => { - if (v) hydrate(); -}); +watch( + () => props.id, + () => hydrate(), + { immediate: true } +); +watch( + () => props.show, + (v) => { + if (v) hydrate(); + } +); const update = async () => { processing.value = true; @@ -157,7 +159,12 @@ const onConfirm = () => { Naslov - + @@ -167,7 +174,12 @@ const onConfirm = () => { Država - + @@ -177,7 +189,12 @@ const onConfirm = () => { Poštna številka - + @@ -187,7 +204,22 @@ const onConfirm = () => { Mesto - + + + + + + + + + Opis + + diff --git a/resources/js/Components/PersonInfo/PersonInfoAddressesTab.vue b/resources/js/Components/PersonInfo/PersonInfoAddressesTab.vue index 20bada4..1d64af3 100644 --- a/resources/js/Components/PersonInfo/PersonInfoAddressesTab.vue +++ b/resources/js/Components/PersonInfo/PersonInfoAddressesTab.vue @@ -24,9 +24,9 @@ const handleDelete = (id, label) => emit("delete", id, label);