Skip to content

Conversation

@cpmills1975
Copy link
Contributor

indicate to users whether the cable length is
accurate or not.

Fixes: #5650

CablePath.get_total_length() retrieves Cable objects where _abs_length is not null as well as the id being in the list of IDs for the path. If the number of cables returned is equal to the number of cable IDs in the path, all cables have a length and the length is determined to be definitive.

The total length and whether it is definitive is returned in a tuple.

PathTraceView.get_extra_context handles the new is_definitive flag and returns that to the template.

The cable_trace template checks whether is_definitive is false and if it is, prefixes the total length with a greater than sign indicting that the length of the cable is at least as long as the length shown.

When cable length is definitive:

Screenshot 2021-01-22 at 16 57 44

When one or more cables have no length defined:

Screenshot 2021-01-22 at 16 58 08

indicate to users whether the cable length is
accurate or not.
@cpmills1975 cpmills1975 changed the title Changes to template, view and CablePath class to Indicate when cable length is not definitive Jan 22, 2021
@stale
Copy link

stale bot commented Mar 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale stale bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Mar 19, 2021
@cpmills1975
Copy link
Contributor Author

PR raised.

@stale stale bot removed the pending closure Requires immediate attention to avoid being closed for inactivity label Mar 19, 2021
@jeremystretch jeremystretch merged commit a135396 into netbox-community:develop Mar 25, 2021
@blgo blgo mentioned this pull request Mar 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cable length calculation incorrect when segment lengths are missing

2 participants