Skip to content

Fix subnet selection bug in subnet allocator#3692

Merged
Simrayz merged 1 commit intomasterfrom
fix/subnet-selection-not-compatible-with-jquery-3
Dec 15, 2025
Merged

Fix subnet selection bug in subnet allocator#3692
Simrayz merged 1 commit intomasterfrom
fix/subnet-selection-not-compatible-with-jquery-3

Conversation

@Simrayz
Copy link
Copy Markdown
Contributor

@Simrayz Simrayz commented Dec 12, 2025

Scope and purpose

When upgrading select2, I discovered that the subnet allocator does not work (in master). Clicking on a subnet does not open the subpanel, but throws the following error in the console:

{
    "name": "Error",
    "message": "An \"el\" undefined must exist in DOM"
}

The bug is due to an incompatiblity with Marionette 2.x, which requires jQuery 2.x to work as intended. However, this PR adds a workaround which adds some manual jQuery to bypass the rendering issues.

Further follow-up work should be done to either upgrade or replace Backbone Marionette with something else, and is described in #3691.

This PR fixes the issue, and subnet allocation should work again.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with ruff, easiest by using pre-commit
  • Wrote the commit message so that the first line continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • Based this pull request on the correct upstream branch: For a patch/bugfix affecting the latest stable version, it should be based on that version's branch (<major>.<minor>.x). For a new feature or other additions, it should be based on master.
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • If it's not obvious from a linked issue, described how to interact with NAV in order for a reviewer to observe the effects of this change first-hand (commands, URLs, UI interactions)
  • If this results in changes in the UI: Added screenshots of the before and after
  • If this adds a new Python source code file: Added the boilerplate header to that file

@sonarqubecloud
Copy link
Copy Markdown

@Simrayz Simrayz marked this pull request as ready for review December 12, 2025 15:52
@Simrayz Simrayz requested a review from a team December 12, 2025 15:52
@github-actions
Copy link
Copy Markdown

Test results

    27 files      27 suites   44m 53s ⏱️
 2 729 tests  2 729 ✅ 0 💤 0 ❌
20 222 runs  20 222 ✅ 0 💤 0 ❌

Results for commit 8b5c217.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.06%. Comparing base (cdbbfb2) to head (8b5c217).
⚠️ Report is 406 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3692      +/-   ##
==========================================
+ Coverage   63.01%   63.06%   +0.04%     
==========================================
  Files         612      612              
  Lines       45228    45237       +9     
  Branches       43       43              
==========================================
+ Hits        28502    28529      +27     
+ Misses      16716    16698      -18     
  Partials       10       10              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Simrayz Simrayz mentioned this pull request Dec 15, 2025
10 tasks
Copy link
Copy Markdown
Contributor

@aleksfl aleksfl left a comment

Choose a reason for hiding this comment

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

Looks good, slight confusion is mitigated by clear comments.

@Simrayz Simrayz merged commit a30882c into master Dec 15, 2025
22 checks passed
@Simrayz Simrayz deleted the fix/subnet-selection-not-compatible-with-jquery-3 branch December 15, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants