netbox
netbox copied to clipboard
Assign Device to Position
Fixes: #8552
Allow user to assign a device to an empty slot within the Rack UI.

This also works for non-racked devices.
I'm not comfortable with the pattern used here, as it's going to be very difficult to maintain long-term. I suspect you're replicating the workflow for IP address assignment; we actually need to ditch that because of how "snowflakey" it is.
@jeremystretch Yes the workflow is replicated from the IP address assignment. Happy to work on another workflow if you have any ideas?
This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is taken.
Not sure, why IP assignment and this would ultimately be ditched. But, I have several complaints from my team for device assignment to a rack being extremely difficult especially when they are standing in front of a rack. First, a device is needed to be searched from the device page, go into edit and then fill up the rack-related values whereas clicking on the rack U position and allocating a device directly from the search is much more suitable. This way they don't have to go back and forth between the rack and the device pages to validate the data.
Having something like this is very beneficial.
Not sure, why IP assignment and this would ultimately be ditched
This is in reference to the exact method in which this is implemented in both IP Address assignment and here. The root of the problem is that IPAddress assignments use a M2O GFK (If I am remembering correctly) and as such cannot be assigned directly on the address model and traditional assignment methods do not work as well.
Going to close this as I have not worked on it in ages and don't have time at the moment to work on it. We can reopen in future if needed.