Overview
Location management is divided into three main areas:- Countries - Country-level geographic data
- Cities - City/municipality information
- Parkings - Parking facility locations (future)
Countries Management
Accessing Countries
Navigate to Administration > Locations > Countries to manage country data.Permissions Required
| Action | Permission |
|---|---|
| View countries | ver_paises |
| Create countries | crear_paises |
| Edit countries | editar_paises |
| Delete countries | eliminar_paises or editar_paises |
Admin users have access to all location management features by default.
Creating a Country
Enter Country Name
Editing a Country
To modify an existing country:- Click the three-dot menu on the country row
- Select Edit
- Update the country name
- Click Save
Deleting a Country
To delete a country:- Click the three-dot menu on the country row
- Select Delete (if available in your configuration)
- Confirm the deletion
Delete functionality is currently commented out in the UI but can be enabled by uncommenting the delete menu item in
/pages/Administration/Locations/Countries.jsx:382-389.Searching Countries
Use the search bar to filter countries by name:- Real-time filtering as you type
- Case-insensitive matching
- Click the X icon to clear search
Cities Management
Accessing Cities
Navigate to Administration > Locations > Cities to manage city data.Permissions Required
| Action | Permission |
|---|---|
| View cities | ver_ciudades |
| Create cities | crear_ciudades |
| Edit cities | editar_ciudades |
| Delete cities | eliminar_ciudades or editar_ciudades |
Creating a City
Cities must be associated with a country.Editing a City
To modify an existing city:- Click the three-dot menu on the city row
- Select Edit
- Update the city name or country
- Click Save
Changing a city’s country association may affect users and vehicles assigned to that city. Verify impact before saving.
Deleting a City
To delete a city:- Click the three-dot menu on the city row
- Select Delete
- Confirm the action
Searching Cities
The city search filters by:- City name
- Country name (if provided by backend as
paisorpais_nombre)
Cities Display
Cities are displayed in a table with:| Column | Description |
|---|---|
| Name | City name |
| Country | Country name in a soft chip |
| Actions | Edit/Delete menu |
Data Loading
Countries Loading
Countries are loaded using:Cities Loading
Cities and countries are loaded in parallel for efficiency:- Fast page load times
- Country dropdown is immediately available
- Reduced waiting time for users
UI States and Error Handling
Loading State
While data is loading:- Circular progress indicator displayed
- Table is hidden
- User cannot perform actions
Error State
If data loading fails:- Error card displayed with descriptive message
- Retry button to reload data
- Network errors are detected with regex:
/failed to fetch|network/i
Empty State
When no locations exist:- Icon with “No data” message
- Encouragement to create first entry
- New button remains available
No Search Results
When search yields no matches:- “No matches found” message in table
- Suggestion to clear or modify search
- All data preserved, only display filtered
Location Services API
Countries API
Cities API
Integration with User Management
Locations integrate with user management:User City Assignment
When creating or editing users:- Cities are loaded as autocomplete options
- User selects city from dropdown
- City ID is stored in
id_ciudadfield - City name is displayed in user table
City Resolution
User city names are resolved using:Best Practices
Location Data Management
- Standardize Names: Use official country and city names
- Avoid Duplicates: Check for existing entries before creating new ones
- Maintain Hierarchy: Always assign cities to correct countries
- Plan Before Deleting: Verify no users or assets depend on location
- Regular Audits: Review location data quarterly for accuracy
Troubleshooting
Countries Not Loading
- Verify
ver_paisespermission - Check network connection
- Look for errors in browser console
- Ensure LocationServices endpoints are configured
- Click Retry button if error state is shown
Cities Not Loading
- Verify
ver_ciudadespermission - Check if countries loaded successfully (cities depend on countries)
- Review network tab for failed API calls
- Verify backend returns proper format:
{ id, nombre, id_pais, pais_nombre }
Country Dropdown Empty in City Form
- Ensure countries were loaded before opening form
- Check
countriesListstate in component - Verify parallel loading didn’t fail for countries
- Reload page to trigger fresh data fetch
Save Operations Failing
- Check form validation errors (red text below fields)
- Verify required fields are filled
- Ensure country is selected for cities
- Check backend logs for validation errors
- Verify you have create/edit permissions
Search Not Working
- Ensure data has loaded (not in loading state)
- Try clearing search and re-entering
- Check if special characters are causing issues
- Verify search term matches actual data
Performance Considerations
Lazy Loading
Location components implement efficient loading patterns:- Data loaded only when page is accessed
- Parallel requests for cities and countries
- Minimal re-renders with React hooks
Filtering Performance
Search filtering usesuseMemo for optimal performance:
cities or search changes.
Parkings Management
AutoLog includes a complete parking facility management system for tracking vehicle parking locations.Overview
The Parkings feature (/parkings) allows you to:
- Create and manage parking location records
- Associate parking spots with cities
- Track available parking facilities
- Filter and search parking locations
- Assign vehicles to specific parking spots
Data Structure
Each parking record includes:Creating a Parking Location
Fill Details
Enter the parking information:
- Location Name (nombre_ubicacion): Descriptive name (min 2 characters, required)
- City (id_ciudad): Select from configured cities (required)
Permissions
| Action | Permission | Description |
|---|---|---|
| View parkings | ver_estacionamientos | View parking list |
| Create parking | crear_estacionamiento | Add new parking locations |
| Edit parking | editar_estacionamiento | Modify existing parkings |
| Delete parking | eliminar_estacionamiento | Remove parking locations |
Search and Filter
The parkings list supports real-time search:- Search by parking name
- Search by city name
- Case-insensitive matching
API Services
FromParkingServices.jsx:
getParkings()
- Returns: Array of parking objects
- Endpoint:
endpoints.getParkings
- Parameters:
{ nombre_ubicacion, id_ciudad } - Returns: Created parking object
- Parameters: Parking ID and updated data
- Returns: Updated parking object
- Parameters: Parking ID
- Returns: Success confirmation
Validation Rules
From the Yup schema:Integration with Vehicles
Parkings can be assigned to vehicles through theid_ubicacion_actual field, enabling:
- Current vehicle location tracking
- Parking utilization reports
- Location-based vehicle searches
Related Pages
- User Management - Assign users to locations
- Permissions - Configure location permissions
- Settings - System configuration