Improve link testing by normalizing URL slugs in sidebar

Update `data-testid` attributes in `AppSidebar` component to use a normalized slug representation of menu item titles, ensuring more robust end-to-end testing by replacing spaces with hyphens. Also, add a new section describing the "Guardie Settimanale" feature in the `replit.md` documentation.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e0b5b11c-5b75-4389-8ea9-5f3cd9332f88
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e0b5b11c-5b75-4389-8ea9-5f3cd9332f88/EoraZGH
This commit is contained in:
marco370 2025-10-29 08:52:43 +00:00
parent 7b05c8cbce
commit 40cde1634b
3 changed files with 8 additions and 6 deletions

View File

@ -19,10 +19,6 @@ externalPort = 80
localPort = 33035 localPort = 33035
externalPort = 3001 externalPort = 3001
[[ports]]
localPort = 39861
externalPort = 6000
[[ports]] [[ports]]
localPort = 40417 localPort = 40417
externalPort = 8000 externalPort = 8000

View File

@ -224,7 +224,7 @@ export function AppSidebar() {
<SidebarMenuSubButton <SidebarMenuSubButton
asChild asChild
isActive={location === subItem.url} isActive={location === subItem.url}
data-testid={`link-${subItem.title.toLowerCase()}`} data-testid={`link-${subItem.title.toLowerCase().replace(/\s+/g, '-')}`}
> >
<Link href={subItem.url!}> <Link href={subItem.url!}>
<subItem.icon className="h-4 w-4" /> <subItem.icon className="h-4 w-4" />
@ -246,7 +246,7 @@ export function AppSidebar() {
<SidebarMenuButton <SidebarMenuButton
asChild asChild
isActive={location === item.url} isActive={location === item.url}
data-testid={`link-${item.title.toLowerCase()}`} data-testid={`link-${item.title.toLowerCase().replace(/\s+/g, '-')}`}
> >
<Link href={item.url!}> <Link href={item.url!}>
<item.icon className="h-4 w-4" /> <item.icon className="h-4 w-4" />

View File

@ -52,6 +52,12 @@ The database supports managing users, guards, certifications, sites, shifts, shi
- **Shift Duplication Features**: - **Shift Duplication Features**:
- **Weekly Copy (Planning Fissi)**: POST /api/shift-assignments/copy-week endpoint duplicates all shifts and assignments from selected week to next week (+7 days) with atomic transaction. Frontend includes confirmation dialog with week details and success feedback. - **Weekly Copy (Planning Fissi)**: POST /api/shift-assignments/copy-week endpoint duplicates all shifts and assignments from selected week to next week (+7 days) with atomic transaction. Frontend includes confirmation dialog with week details and success feedback.
- **Patrol Sequence Duplication (Planning Mobili)**: POST /api/patrol-routes/duplicate endpoint with dual behavior: UPDATE when target date = source date (modifies guard), CREATE when different date (duplicates route with all stops). Frontend shows daily sequence list with duplication dialog (date picker defaulting to next day, guard selector pre-filled but changeable). - **Patrol Sequence Duplication (Planning Mobili)**: POST /api/patrol-routes/duplicate endpoint with dual behavior: UPDATE when target date = source date (modifies guard), CREATE when different date (duplicates route with all stops). Frontend shows daily sequence list with duplication dialog (date picker defaulting to next day, guard selector pre-filled but changeable).
- **Guardie Settimanale**: Compact weekly schedule view showing all guards' assignments across the week in a grid format. Features include:
- **Weekly Grid View**: Guard names in first column, 7 daily columns (Mon-Sun) with compact cell display
- **Multi-Source Aggregation**: GET /api/weekly-guards-schedule endpoint aggregates fixed shifts, patrol routes, and absences by location and week
- **Compact Cell Format**: Fixed posts show "Site Name HH:mm-HH:mm", mobile patrols show "Pattuglia HH:mm-HH:mm", absences show status (Ferie/Malattia/Permesso/Riposo)
- **Read-Only Dialogs**: Clicking cells opens appropriate dialog (fixed shift details or mobile patrol info) with navigation links to Planning Fissi/Mobile for edits
- **Location and Week Filters**: Dropdown for branch selection, week navigation with prev/next buttons displaying "Settimana dal DD MMM al DD MMM YYYY"
### User Roles ### User Roles
- **Admin**: Full access. - **Admin**: Full access.