Conversation
|
Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details? |
📝 WalkthroughWalkthroughThis PR updates dispatch call creation and editing interfaces to replace hidden coordinate form fields with visible, editable latitude/longitude inputs and a "Set Pin on Map" button. It also updates map navigation behavior to enforce zoom level 16 and adds marker tooltips displaying stop information in the routes editor. Changes
Sequence DiagramsequenceDiagram
participant User
participant UI as Set Pin Button
participant Handler as JavaScript Handler
participant Validator as Validation Logic
participant Map as Leaflet Map
participant Marker as Marker
User->>UI: Click "Set Pin on Map"
UI->>Handler: Trigger click event
Handler->>Handler: Read `#Latitude` & `#Longitude` values
Handler->>Validator: Validate numeric input
alt Invalid Input
Validator-->>Handler: Return NaN
Handler->>User: Show alert (invalid coordinates)
else Valid Input
Validator-->>Handler: Return parsed coordinates
Handler->>Map: setView(coordinates, zoom: 16)
Map->>Map: Pan and zoom to location
Handler->>Marker: Update marker position
Marker->>Map: Display at new location
Handler->>User: Update complete
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
Web/Resgrid.Web/Areas/User/Views/Dispatch/AddArchivedCall.cshtml (1)
182-195: Hardcoded strings should be localized.The new coordinate input UI uses hardcoded English strings ("Lat", "Lng", "Set Pin on Map") while the rest of the view uses
@localizer[]for internationalization. For consistency, these strings should be added to the localization resources.♻️ Suggested localization
<div class="row" style="margin-top: 8px;"> <div class="col-md-11"> <div class="input-group input-group-sm"> - <span class="input-group-addon">Lat</span> + <span class="input-group-addon">@localizer["LatitudeLabel"]</span> <input type="text" class="form-control" asp-for="Latitude" placeholder="Latitude"> - <span class="input-group-addon">Lng</span> + <span class="input-group-addon">@localizer["LongitudeLabel"]</span> <input type="text" class="form-control" asp-for="Longitude" placeholder="Longitude"> <span class="input-group-btn"> - <a id="setPinButton" href="#" class="btn btn-warning">Set Pin on Map</a> + <a id="setPinButton" href="#" class="btn btn-warning">@localizer["SetPinOnMap"]</a> </span> </div> </div> </div>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Web/Resgrid.Web/Areas/User/Views/Dispatch/AddArchivedCall.cshtml` around lines 182 - 195, Replace the hardcoded UI strings in the coordinate input block with localized resource lookups: change the span text nodes "Lat" and "Lng" and the anchor text "Set Pin on Map" (anchor id="setPinButton", inputs using asp-for="Latitude"/"Longitude") to use the view localizer (e.g. `@localizer`["Lat"], `@localizer`["Lng"], `@localizer`["SetPinOnMap"]) and add corresponding keys ("Lat", "Lng", "SetPinOnMap") to the .resx resource files for the view so translations are available.Web/Resgrid.Web/Areas/User/Views/Dispatch/UpdateCall.cshtml (1)
176-189: Same localization issue as AddArchivedCall.cshtml.The hardcoded strings "Lat", "Lng", and "Set Pin on Map" should be localized for consistency with the rest of the view. See the suggestion in
AddArchivedCall.cshtmlfor the recommended pattern.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Web/Resgrid.Web/Areas/User/Views/Dispatch/UpdateCall.cshtml` around lines 176 - 189, Replace the hardcoded UI strings in the Dispatch view with localized resource lookups: change the input-group addon texts "Lat" and "Lng" to use the localization helper (e.g., `@Localizer`["Lat"] and `@Localizer`["Lng"]) and change the button label "Set Pin on Map" to a localized key (e.g., `@Localizer`["SetPinOnMap"]) on the element with id="setPinButton"; ensure the resource keys ("Lat", "Lng", "SetPinOnMap") are added to the appropriate resource file so translations are available.Web/Resgrid.Web/Areas/User/Views/Dispatch/NewCall.cshtml (1)
175-188: Same localization issue as other dispatch views.The hardcoded strings "Lat", "Lng", and "Set Pin on Map" should be localized. Since this pattern is repeated across
NewCall.cshtml,UpdateCall.cshtml, andAddArchivedCall.cshtml, consider adding the localization keys once and applying them consistently to all three views.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Web/Resgrid.Web/Areas/User/Views/Dispatch/NewCall.cshtml` around lines 175 - 188, Replace the hardcoded UI strings in the NewCall view with localized resources: change the "Lat" and "Lng" input-group addons and the "Set Pin on Map" anchor text to use the shared localization keys (apply the same keys across NewCall.cshtml, UpdateCall.cshtml, and AddArchivedCall.cshtml). Locate the elements by the asp-for attributes for Latitude and Longitude and the anchor with id="setPinButton" and replace their literal strings with calls to the app's localization helper (use the existing resource keys you add, e.g. Dispatch.Lat, Dispatch.Lng, Dispatch.SetPin) so all three views consume the same keys.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@Web/Resgrid.Web/Areas/User/Views/Dispatch/AddArchivedCall.cshtml`:
- Around line 182-195: Replace the hardcoded UI strings in the coordinate input
block with localized resource lookups: change the span text nodes "Lat" and
"Lng" and the anchor text "Set Pin on Map" (anchor id="setPinButton", inputs
using asp-for="Latitude"/"Longitude") to use the view localizer (e.g.
`@localizer`["Lat"], `@localizer`["Lng"], `@localizer`["SetPinOnMap"]) and add
corresponding keys ("Lat", "Lng", "SetPinOnMap") to the .resx resource files for
the view so translations are available.
In `@Web/Resgrid.Web/Areas/User/Views/Dispatch/NewCall.cshtml`:
- Around line 175-188: Replace the hardcoded UI strings in the NewCall view with
localized resources: change the "Lat" and "Lng" input-group addons and the "Set
Pin on Map" anchor text to use the shared localization keys (apply the same keys
across NewCall.cshtml, UpdateCall.cshtml, and AddArchivedCall.cshtml). Locate
the elements by the asp-for attributes for Latitude and Longitude and the anchor
with id="setPinButton" and replace their literal strings with calls to the app's
localization helper (use the existing resource keys you add, e.g. Dispatch.Lat,
Dispatch.Lng, Dispatch.SetPin) so all three views consume the same keys.
In `@Web/Resgrid.Web/Areas/User/Views/Dispatch/UpdateCall.cshtml`:
- Around line 176-189: Replace the hardcoded UI strings in the Dispatch view
with localized resource lookups: change the input-group addon texts "Lat" and
"Lng" to use the localization helper (e.g., `@Localizer`["Lat"] and
`@Localizer`["Lng"]) and change the button label "Set Pin on Map" to a localized
key (e.g., `@Localizer`["SetPinOnMap"]) on the element with id="setPinButton";
ensure the resource keys ("Lat", "Lng", "SetPinOnMap") are added to the
appropriate resource file so translations are available.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 79a2244d-6ed9-4b20-b189-b5e41c5b91e3
📒 Files selected for processing (7)
Web/Resgrid.Web/Areas/User/Views/Dispatch/AddArchivedCall.cshtmlWeb/Resgrid.Web/Areas/User/Views/Dispatch/NewCall.cshtmlWeb/Resgrid.Web/Areas/User/Views/Dispatch/UpdateCall.cshtmlWeb/Resgrid.Web/wwwroot/js/app/internal/dispatch/resgrid.dispatch.addArchivedCall.jsWeb/Resgrid.Web/wwwroot/js/app/internal/dispatch/resgrid.dispatch.editcall.jsWeb/Resgrid.Web/wwwroot/js/app/internal/dispatch/resgrid.dispatch.newcall.jsWeb/Resgrid.Web/wwwroot/js/app/internal/routes/resgrid.routes.edit.js
|
Approve |
Summary by CodeRabbit