netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.1k stars 2.58k forks source link

Circuits Column Sorting by Termination/Side Doesn't Properly Sort #16444

Closed jniec-js closed 4 months ago

jniec-js commented 4 months ago

Deployment Type

Self-hosted

NetBox Version

v3.7, 1, v4.0.5

Python Version

3.10

Steps to Reproduce

  1. Navigate to Circuits listing page
  2. Click on either Side A or Side Z to sort column alphabetically
  3. Observe that the Side A/Side Z columns are not sorted, but instead the provider column gets sorted alphabetically

See: https://demo.netbox.dev/circuits/circuits/?sort=termination_a.

At the time of creating this issue, I modified the termination_a of Circuit https://demo.netbox.dev/circuits/circuits/1/ to be DM-Akron, then attempted to sort Side A alphabetically.

Screenshot from 2024-06-07 09-29-02

Notice that https://demo.netbox.dev/circuits/circuits/1/ is located in the middle of all the Side A terminations, I expect it to be at the top.

Expected Behavior

I expect that the column clicked on (to sort) is the one sorted alphabetically

Observed Behavior

The provider column was sorted alphabetically instead of the Side A/Side Z column that was clicked on.

jeffgdotorg commented 4 months ago

Hi, thanks for reporting an issue that you're experiencing in NetBox.

For our developers to validate your bug report, they need to be able to reproduce it in the lab, and to do that they need a detailed set of steps to reproduce the problem you're seeing, starting with a freshly installed and empty instance of NetBox. Please update your issue body's Steps to Reproduce section so that it assumes an empty starting point and specifies each object that needs to be created to get the system to the point where we can see the problem in action.

One additional note: The demo system is not appropriate for use in bug reports, because anybody can log in as an admin user and totally wreck its contents. That's why we reset it nightly.

joshniec commented 4 months ago

I can appreciate asking for detailed production steps - but I think the issue as reported is fairly basic, the Site columns do not sort properly in the circuits. I expect them to sort alphabetically like all other columns when clicked on.

Problem Statement: When sorting the side columns on the circuit page they aren't sorted alphabetically.

Reproduction:

  1. Add multiple sites, providers and circuits to netbox.
  2. For the circuits, make sure you create multiple circuits for each of the providers.
  3. For each of the circuits created, create circuit terminations on each of the sites created in step 1.
  4. Go back to the circuits view to see all your circuits.
  5. Click on Side A column to sort it alphabetically.
  6. Observe that the column is not properly sorted alphabetically (as seen in the screenshot of my original post)

Expectation: Objects in column I sort should be sorted alphabetically.

jeremystretch commented 4 months ago

Ordering the list by these columns should not be permitted, as there is no sensible mechanism for ordering e.g. a combination of site and provider networks.