Conversation
…tBox UI elements and functions
|
@jsenecal Going to get you to review this since I know you did some of these changes originally. I think I captured everything but just to make sure. |
jsenecal
left a comment
There was a problem hiding this comment.
I noticed that this PR removes the four-state tabbed display introduced in #127 and replaces it with two flat ObjectsTablePanels driven by a boolean expired filter. Beyond the filter_expired bug I flagged in the code review, the design itself loses behavior worth calling out:
-
SupportContractAssignment.statusdistinguishes four states :FUTURE(contract.start > today),ACTIVE,UNSPECIFIED(end_date IS NULL),EXPIRED.
A boolean filter only carves out
EXPIRED, soFUTUREcontracts end up in the "Active Contracts" panel. A contract that hasn't started yet shouldn't render as active. -
The lazy-load-on-click behavior on the Expired tab is gone. Devices with long expired-contract histories used to defer that query until a user clicked the tab; the new panel renders both tables eagerly on every device/VM detail page load.
If the simplification away from tabs is intentional, two minimal changes would preserve correctness without bringing the tabs back:
- In
_render_contract_card, drop future contracts from the Active panel:filters={..., 'status': 'active'} # or status__in=['active', 'unspecified']
- Replace the
BooleanFilterexpiredwith aChoiceFilterstatusdriven by the existingCONTRACT_STATUS_*constants, so the panel asks for what it wants instead of relying on the inverse-of-expired heuristic.
If the four-state breakdown is meant to come back later, building on ChoiceFilter makes that a one-line addition rather than another filter rewrite.
Co-authored-by: Jonathan Senecal <jonathan.senecal@metrooptic.com>
Co-authored-by: Jonathan Senecal <contact@jonathansenecal.com> Co-authored-by: Daniel Sheppard <dans@dansheps.com>
This was somewhat unintentional, I didn't realise there were multiple tabs that showed as on a cursory look it appears to be 1-2 tabs. I wonder if I could build a custom panel for nesting panels and just have that show as two tabs.
Should be back now, can you give it a check? |
Closes: #157 - Modernize Lifecycle Plugin to take advantage of new NetBox UI elements and functions