-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
firewall: categories improvements #4790
Conversation
@@ -242,6 +242,10 @@ function hook_firewall_categories() { | |||
$(".rule").each(function(){ | |||
let is_selected = false; | |||
$(this).data('category').split(',').forEach(function(item){ | |||
if (selected_values.indexOf("(No Category)") > -1 && item === "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't take translations into account. when "no category" is always on top it's probably better to check if the first element of the selector is checked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the heads up, silly mistake. See new commit.
@@ -257,5 +261,6 @@ function hook_firewall_categories() { | |||
$(".opnsense-rules").change(); | |||
}); | |||
cat_select.change(); | |||
$('[data-toggle="tooltip"]').tooltip(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it matters, but in case existing selectors don't like being triggered twice, you can always add a unique class to the items added and only trigger those,
(cherry picked from commit c7d2488)
This commit adds the option of filtering on (No Category) in the firewall rules. A tooltip for visual aid is also added. In order to run static text through gettext(), a separate API endpoint has been created. This is a clean PR and invalidates the old one (#4775) since it was pretty messy.