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

Fix delete button to unassign VLAN from network port #18877

Open
wants to merge 3 commits into
base: 10.0/bugfixes
Choose a base branch
from

Conversation

eduardomozart
Copy link
Contributor

@eduardomozart eduardomozart commented Feb 1, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

I was able to reproduce #18845 when trying to remove a VLAN into https://glpi.example.com/front/networkequipment.form.php?id=XXX page so I decided to poke around and fix it. Clicking on the trash icon redirects to a broken page. I couldn't find any references to pass GET parameters and do some action on backend, but noticed that the Massive Actions works, so this passes the same parameters used to unassign a VLAN from port on https://glpi.example.com/front/networkport.form.php?id=XXX.

Screenshots (if appropriate):

Unassign VLAN with this PR applied:

Gravacao.de.Tela.2025-01-31.as.22.21.44.mov

In the commit 56263a9 I also added the hyperlink to the VLAN name to go to the VLAN form.

image

@cconard96
Copy link
Contributor

I think the delete link should just be removed. It was added in 10.0 as part of a network port UI rework when the native inventory feature was added, but doesn't seem like it was implemented completely. Also, there is already the massive actions on this list which include actions to assign/remove VLANs. Having these separate buttons is just a duplication.

@eduardomozart
Copy link
Contributor Author

It's pretty convenient have such button because it makes easier to exclude a specific VLAN from port for anyone handling VLANs assigns manually. The massive action isn't intuitive (I didn't even know it exists, and I'm already planning improvements to it - only show existing VLANs on selected devices and allow multiple selection). But that's on your call. I added the hyper-link to the VLAN on commit 56263a9 so I think if the Delete button be removed, most users should use the Massive actions dropdown from there, which also would make it easier to remove a specific VLAN from multiple ports or single port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants