Skip to content
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

Merged
merged 2 commits into from
Mar 11, 2021

Conversation

swhite2
Copy link
Member

@swhite2 swhite2 commented Mar 9, 2021

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.

@@ -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 === "") {
Copy link
Member

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.

Copy link
Member Author

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();
Copy link
Member

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,

@AdSchellevis AdSchellevis merged commit c7d2488 into opnsense:master Mar 11, 2021
@AdSchellevis AdSchellevis self-assigned this Mar 11, 2021
AdSchellevis pushed a commit that referenced this pull request Mar 14, 2021
AdSchellevis pushed a commit that referenced this pull request Mar 14, 2021
fichtner pushed a commit that referenced this pull request Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants