Project

General

Profile

Bug #5259

firewall_aliases_edit.php: Switch to a URL Table type when you already have multiple rows

Added by Phillip Davis over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
10/06/2015
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.3
Affected Architecture:

Description

Start editing a new alias, click "Add Host" a few times to get multiple rows.
Switch the alias type to "URL Table (IPs)" or "URL Table (Ports)".

Now there are multiple rows still displayed but the "Delete" buttons at the end of each row are gone.

What to do here?

If the user is adding a new alias, then when switching to a "URL Table" type the code could automatically remove any rows after the first. I think that case is easy to see a reasonable thing to do.

If the user is editing an existing alias (e.g. a Network type alias with multiple rows), then what to do? A "URL Table" alias type is quite a different thing. Should we automatically remove all but the first row for the user, and then the user can type over the top of the first network they had and put a URL? But that might be quite annoying if a user "kind of accidentally" selects a "URL Table" type and wants to switch back. They would have to "cancel out" (= use the back button to get back to the firewall_aliases page) and start the alias edit again.

Perhaps the "Delete" button at the end of each row can always be shown as long as there is more than 1 row existing. Obviously that would mean that the code that generates row 1 would have to look ahead to know if row 2 exists in order to decide if a "Delete" button is needed on the end of row 1. But actually if it is done that way then a good side-effect is that when there is only 1 row, then there will be no Delete button displayed, and so no need for the popup message "You may not delete the last row".

Note: In 2.2.* the delete buttons were always shown regardless of the alias type, so users could do more what they liked and it was left to the validation on submit to check if they submitted rubbish.

Associated revisions

History

#1 Updated by Jim Thompson over 3 years ago

  • Assignee set to Steve Beaver

#2 Updated by Steve Beaver over 3 years ago

  • Subject changed from Firewall Alias Edit switch to a URL Table type when you already have multiple rows to firewall_aliases_edit.php: Switch to a URL Table type when you already have multiple rows
  • Status changed from New to Feedback
  • Assignee changed from Steve Beaver to Phillip Davis

Added Javascript to hide and disable rows > 0 on selecting table types. Disabling them is required to ensure they are not included in the POST.

#3 Updated by Steve Beaver over 3 years ago

  • % Done changed from 0 to 100

#4 Updated by Phillip Davis over 3 years ago

2.3-ALPHA (amd64)
built on Mon Oct 26 19:32:58 CDT 2015
FreeBSD 10.2-STABLE

I played with various ways to try and trick it, switching alias types back and forth while editing. I could not break it. Fixed for me.

#5 Updated by Steve Beaver over 3 years ago

jquery/pfSenseHelpers.js has been further amended to hide the "Delete" button when less than two rows exist.

The new function is called on page load, delete row and add row.

#6 Updated by Phillip Davis over 3 years ago

Hide the "Delete" button when less than two rows exist - that is working nicely, thanks.

I think everything here is working and this issue is resolved.

#7 Updated by Renato Botelho over 3 years ago

  • Project changed from Bootstrap to pfSense

#8 Updated by Phillip Davis over 3 years ago

Ping - this can be marked resolved.

#9 Updated by Chris Buechler over 3 years ago

  • Status changed from Feedback to Resolved

Thanks Phil

Also available in: Atom PDF