Add Cancel and back buttons needed#2328
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses missing navigation controls in the admin UI by adding Cancel buttons for “New Route” and “New Network” flows (returning to their respective list pages) and adding a Back button to the group details view.
Changes:
- Added a Cancel button for new (unsaved) routes that returns to
/admin/routes. - Added a Cancel button for new (unsaved) networks that returns to
/admin/networks. - Added a Back button to the admin group header and updated the IP validation directive behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| templates/main/route_options.html.ep | Adds a Cancel button for the new-route flow to return to the routes list. |
| templates/main/network_options.html.ep | Adds a Cancel button for the new-network flow to return to the networks list. |
| templates/main/admin_group.html.ep | Adds a Back button in the group header to return to the groups list. |
| public/js/admin.js | Refactors ipaddress validation into a named function and applies it to both parsers and formatters. |
Comments suppressed due to low confidence (1)
public/js/admin.js:46
- Because validateIP is registered as both a parser and a formatter, it will run when the model is initially populated/updated programmatically (including when inputText is null/undefined). With the current logic, that marks the control invalid and may clear the view value; consider guarding empty values appropriately and/or using separate parser vs formatter functions.
ctrl.$parsers.unshift(validateIP);
ctrl.$formatters.unshift(validateIP);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+68
to
+71
| <button ng-show="route.id" class="btn btn-outline-secondary" | ||
| ng-disabled="formNetwork.$pristine" | ||
| ng-click="load_network(route.id)"><%=l 'Cancel' %></button> | ||
| <button ng-show="!route.id" class="btn btn-outline-secondary" |
Comment on lines
+131
to
+133
| <button ng-show="network.id" class="btn btn-outline-secondary" | ||
| ng-click="load_network(network.id)"><%=l 'Cancel' %></button> | ||
| <button ng-show="!network.id" class="btn btn-outline-secondary" |
Comment on lines
36
to
42
| else | ||
| { | ||
| //alert("You have entered an invalid IP address!"); | ||
| //document.form1.text1.focus(); | ||
| ctrl.$setValidity('ipformat', false); | ||
| return undefined; | ||
| } |
Comment on lines
+68
to
+71
| <button ng-show="route.id" class="btn btn-outline-secondary" | ||
| ng-disabled="formNetwork.$pristine" | ||
| ng-click="load_network(route.id)"><%=l 'Cancel' %></button> | ||
| <button ng-show="!route.id" class="btn btn-outline-secondary" |
Comment on lines
+131
to
+133
| <button ng-show="network.id" class="btn btn-outline-secondary" | ||
| ng-click="load_network(network.id)"><%=l 'Cancel' %></button> | ||
| <button ng-show="!network.id" class="btn btn-outline-secondary" |
Comment on lines
29
to
+41
| @@ -38,10 +38,17 @@ ravadaApp.directive("solShowMachine", swMach) | |||
| //alert("You have entered an invalid IP address!"); | |||
| //document.form1.text1.focus(); | |||
| ctrl.$setValidity('ipformat', false); | |||
| return undefined; | |||
| return isParser ? undefined : inputText; | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added cancel button for new route and new network.
Added back button for viewing a group.
Fixed cancel button at network options behavior.
closes #2327