Skip to content

Restart Interfaces in Portadmin fails#3589

Merged
Simrayz merged 3 commits intomasterfrom
fix/restart-interfaces-in-portadmin-modal-fails
Oct 16, 2025
Merged

Restart Interfaces in Portadmin fails#3589
Simrayz merged 3 commits intomasterfrom
fix/restart-interfaces-in-portadmin-modal-fails

Conversation

@Simrayz
Copy link
Copy Markdown
Contributor

@Simrayz Simrayz commented Oct 15, 2025

Scope and purpose

During testing of #3545, @johannaengland discovered that the restarting interfaces progress fails, leaving a modal that does not close. This PR fixes the bug by ensuring that all code properly awaits creation of new elements, http requests and dom updates.

In addition, this PR replaces the (why?) tooltip with a toggleable message panel (see image below). This was done as there are issues with displaying the tooltip (which as positioned fixed) within the modal element (which is also fixed). A follow-up task is to investigate whether we can support fixed tooltips in modals as well, but I opted for this solution instead of spending too much time. I also think that this is a more user-friendly solution than displaying a large tooltip within a modal element.

A message panel is shown when clicking on the (why?) element
image

How to test

  1. Open Portadmin and find an interface you are comfortable modifying the Vlan on (e.g. one that is not linked)
  2. Change the Vlan to something else, e.g. between guest and employee networks
  3. Wait for the configuration and change commit to complete, then "Restarting interfaces" should be added with a progress bar.
  4. Clicking "(why?)" should open the message panel.
  5. When restarting interfaces completes, it should resolve with an "OK" and show a close button.

This pull request

  • Fixes portadmin save functions by adding proper async/await
  • Fixes bug where restart interfaces does not complete, leaving an unresolved modal
  • Changes the (why?) tooltip to a message panel for functional and usability reasons

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

@Simrayz Simrayz requested a review from a team October 15, 2025 09:54
@Simrayz Simrayz self-assigned this Oct 15, 2025
@Simrayz Simrayz added cleanup javascript uu Related to Universal Design and accessibility statement labels Oct 15, 2025
@Simrayz Simrayz force-pushed the fix/restart-interfaces-in-portadmin-modal-fails branch from 3364135 to 07b1bab Compare October 15, 2025 10:01
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 15, 2025

Test results

    27 files      27 suites   45m 48s ⏱️
 2 618 tests  2 618 ✅ 0 💤 0 ❌
19 334 runs  19 334 ✅ 0 💤 0 ❌

Results for commit 6354c36.

♻️ This comment has been updated with latest results.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.49%. Comparing base (cb569e9) to head (6354c36).
⚠️ Report is 284 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3589   +/-   ##
=======================================
  Coverage   62.49%   62.49%           
=======================================
  Files         611      611           
  Lines       45020    45020           
  Branches       43       43           
=======================================
  Hits        28137    28137           
  Misses      16873    16873           
  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 force-pushed the fix/restart-interfaces-in-portadmin-modal-fails branch from 07b1bab to 6354c36 Compare October 15, 2025 17:18
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

👍

@Simrayz Simrayz merged commit 042b2ef into master Oct 16, 2025
19 checks passed
@Simrayz Simrayz deleted the fix/restart-interfaces-in-portadmin-modal-fails branch October 16, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup javascript uu Related to Universal Design and accessibility statement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants