Compare commits

..

4 Commits

Author SHA1 Message Date
Marco Lanzara
162deaa3b7 🚀 Release v1.0.38
- Tipo: patch
- Database backup: database-backups/vigilanzaturni_v1.0.38_20251023_095257.sql.gz
- Data: 2025-10-23 09:53:14
2025-10-23 09:53:14 +00:00
marco370
b762edb113 Fix errors in site management and mobile planning features
Resolve 404 errors in mobile planning and empty pages in site management due to incorrect API routing and data fetching logic.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e5565357-90e1-419f-b9a8-6ee8394636df
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e5565357-90e1-419f-b9a8-6ee8394636df/IcLh7if
2025-10-23 09:45:16 +00:00
marco370
e143aa3f60 Update site management for better shift type selection
Modify sites.tsx to set a default location and ensure proper value binding for the shift type select component.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e5565357-90e1-419f-b9a8-6ee8394636df
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e5565357-90e1-419f-b9a8-6ee8394636df/IcLh7if
2025-10-23 09:44:45 +00:00
marco370
37cbbfa768 Improve site management interface to correctly assign customers
Update the `sites.tsx` page to correctly handle `customerId` when creating or editing sites, ensuring the customer selection works as expected.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e5565357-90e1-419f-b9a8-6ee8394636df
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e5565357-90e1-419f-b9a8-6ee8394636df/IcLh7if
2025-10-23 09:35:46 +00:00
5 changed files with 21 additions and 16 deletions

View File

@ -35,10 +35,6 @@ externalPort = 4200
localPort = 42175 localPort = 42175
externalPort = 3002 externalPort = 3002
[[ports]]
localPort = 42423
externalPort = 5173
[[ports]] [[ports]]
localPort = 43169 localPort = 43169
externalPort = 5000 externalPort = 5000

View File

@ -49,6 +49,8 @@ export default function Sites() {
defaultValues: { defaultValues: {
name: "", name: "",
address: "", address: "",
customerId: undefined,
location: "roccapiemonte",
shiftType: "fixed_post", shiftType: "fixed_post",
minGuards: 1, minGuards: 1,
requiresArmed: false, requiresArmed: false,
@ -67,6 +69,8 @@ export default function Sites() {
defaultValues: { defaultValues: {
name: "", name: "",
address: "", address: "",
customerId: undefined,
location: "roccapiemonte",
shiftType: "fixed_post", shiftType: "fixed_post",
minGuards: 1, minGuards: 1,
requiresArmed: false, requiresArmed: false,
@ -139,6 +143,7 @@ export default function Sites() {
editForm.reset({ editForm.reset({
name: site.name, name: site.name,
address: site.address, address: site.address,
customerId: site.customerId ?? undefined,
location: site.location, location: site.location,
shiftType: site.shiftType, shiftType: site.shiftType,
minGuards: site.minGuards, minGuards: site.minGuards,
@ -237,15 +242,14 @@ export default function Sites() {
name="customerId" name="customerId"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>Cliente</FormLabel> <FormLabel>Cliente (opzionale)</FormLabel>
<Select onValueChange={field.onChange} value={field.value || undefined}> <Select onValueChange={(value) => field.onChange(value || undefined)} value={field.value ?? undefined}>
<FormControl> <FormControl>
<SelectTrigger data-testid="select-customer"> <SelectTrigger data-testid="select-customer">
<SelectValue placeholder="Seleziona cliente (opzionale)" /> <SelectValue placeholder="Nessun cliente" />
</SelectTrigger> </SelectTrigger>
</FormControl> </FormControl>
<SelectContent> <SelectContent>
<SelectItem value="">Nessun cliente</SelectItem>
{customers?.map((customer) => ( {customers?.map((customer) => (
<SelectItem key={customer.id} value={customer.id}> <SelectItem key={customer.id} value={customer.id}>
{customer.name} {customer.name}
@ -345,7 +349,7 @@ export default function Sites() {
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>Tipologia Servizio</FormLabel> <FormLabel>Tipologia Servizio</FormLabel>
<Select onValueChange={field.onChange} defaultValue={field.value}> <Select onValueChange={field.onChange} value={field.value ?? undefined}>
<FormControl> <FormControl>
<SelectTrigger data-testid="select-shift-type"> <SelectTrigger data-testid="select-shift-type">
<SelectValue placeholder="Seleziona tipo servizio" /> <SelectValue placeholder="Seleziona tipo servizio" />
@ -524,15 +528,14 @@ export default function Sites() {
name="customerId" name="customerId"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>Cliente</FormLabel> <FormLabel>Cliente (opzionale)</FormLabel>
<Select onValueChange={field.onChange} value={field.value || undefined}> <Select onValueChange={(value) => field.onChange(value || undefined)} value={field.value ?? undefined}>
<FormControl> <FormControl>
<SelectTrigger data-testid="select-edit-customer"> <SelectTrigger data-testid="select-edit-customer">
<SelectValue placeholder="Seleziona cliente (opzionale)" /> <SelectValue placeholder="Nessun cliente" />
</SelectTrigger> </SelectTrigger>
</FormControl> </FormControl>
<SelectContent> <SelectContent>
<SelectItem value="">Nessun cliente</SelectItem>
{customers?.map((customer) => ( {customers?.map((customer) => (
<SelectItem key={customer.id} value={customer.id}> <SelectItem key={customer.id} value={customer.id}>
{customer.name} {customer.name}
@ -632,7 +635,7 @@ export default function Sites() {
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>Tipologia Servizio</FormLabel> <FormLabel>Tipologia Servizio</FormLabel>
<Select onValueChange={field.onChange} defaultValue={field.value}> <Select onValueChange={field.onChange} value={field.value ?? undefined}>
<FormControl> <FormControl>
<SelectTrigger data-testid="select-edit-shift-type"> <SelectTrigger data-testid="select-edit-shift-type">
<SelectValue placeholder="Seleziona tipo servizio" /> <SelectValue placeholder="Seleziona tipo servizio" />

View File

@ -1,7 +1,13 @@
{ {
"version": "1.0.37", "version": "1.0.38",
"lastUpdate": "2025-10-23T09:23:28.990Z", "lastUpdate": "2025-10-23T09:53:14.636Z",
"changelog": [ "changelog": [
{
"version": "1.0.38",
"date": "2025-10-23",
"type": "patch",
"description": "Deployment automatico v1.0.38"
},
{ {
"version": "1.0.37", "version": "1.0.37",
"date": "2025-10-23", "date": "2025-10-23",