Skip to content

Add Cancel and back buttons needed#2328

Merged
frankiejol merged 3 commits into
UPC:mainfrom
Yago004:fix/2327_add-cancel-button
May 19, 2026
Merged

Add Cancel and back buttons needed#2328
frankiejol merged 3 commits into
UPC:mainfrom
Yago004:fix/2327_add-cancel-button

Conversation

@Yago004
Copy link
Copy Markdown
Collaborator

@Yago004 Yago004 commented May 15, 2026

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

@frankiejol frankiejol requested a review from Copilot May 15, 2026 09:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread templates/main/route_options.html.ep Outdated
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 thread templates/main/network_options.html.ep Outdated
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 thread public/js/admin.js
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;
}
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread templates/main/route_options.html.ep Outdated
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 thread templates/main/network_options.html.ep Outdated
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 thread public/js/admin.js
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;
Copy link
Copy Markdown
Member

@frankiejol frankiejol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent !

@frankiejol frankiejol merged commit bed782d into UPC:main May 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Cancel button

3 participants