github netbox-community/netbox-reorder-rack v1.1.5

4 hours ago

v1.1.5

The front-end upgrades below cross two major versions of Gridstack, and the minimum supported
NetBox version rises to 4.7, so this is a larger release than its patch-level number suggests.

Breaking Changes

  • NetBox 4.7 is now the minimum. The reorder page is built from NetBox's declarative UI
    components and imports netbox.ui.breadcrumbs, which 4.7 introduced, so the plugin no longer
    imports at all on 4.3 to 4.6. Those versions should stay on 1.1.4. See
    COMPATIBILITY.md.

Bug Fixes

  • Devices less than a whole rack unit tall now render and save correctly
    (#25,
    #35). The elevation is
    drawn on a grid of half-unit rows, but a device's height was truncated to a whole number
    before being converted into rows. A 1.5U device was drawn 1U tall, and a 0.5U device was
    given a height of zero rows. Half-unit devices were also placed one row above where they
    belong, so the reorder page disagreed with NetBox's own elevation and subsequent saves
    failed for want of space.

  • Reordering devices no longer fails when they shift into one another's units
    (#34). Saving a
    layout applied each device's new position one at a time, validating each one against the
    units still held by the devices that had not been saved yet. Dropping a device into a rack
    so that the devices below it shift down therefore failed with an error such as
    U8 is already occupied or does not have sufficient space to accommodate this device type,
    naming whichever device was validated before the one beneath it had moved out of the way.
    The unit reported depended on the order the grid happened to list the devices in.

  • Gridstack upgraded from 10.1.2 to 12.6.0, matching the version NetBox ships.

    Two breaking changes in that range were fixed:

    • addWidget() stopped accepting an HTMLElement in v11. Copying a full-depth device to
      the opposite rack face passed a cloned element, which logged a console error on every
      drop before falling back internally. It now calls makeWidget().
    • disableOneColumnMode was removed in v12.1.0 and had become a silently ignored option.
      Responsive column collapsing is now opt-in via columnOpts, which is absent from
      Gridstack's defaults, so omitting the option preserves the fixed layout it requested.
  • Bootstrap pinned to 5.3.8, matching NetBox. The plugin now imports Toast directly from
    bootstrap/js/dist/toast.js rather than from the package entry point.

Other Changes

  • The reorder page now uses NetBox's declarative UI components. ReorderView is a
    generic.ObjectView carrying a SimpleLayout, with the elevation embedded as a
    TemplatePanel — the same approach NetBox uses for its own rack elevations. The page also
    registers a ViewTab, so it appears as a tab on the rack rather than a standalone page.

    This fixes chrome that never rendered. The template previously extended
    base/layout.html and hand-copied NetBox's breadcrumbs, object identifier, subtitle and
    tab strip; base/layout.html defines no subtitle, tabs or content-wrapper blocks,
    and Django ignores unknown blocks silently, so the subtitle and tab strip were absent on
    every page load. Both now render. rack.html drops from 143 lines to 18, keeping only the
    CSS and JavaScript blocks a panel cannot reach.

  • Fixed a duplicated gs-locked attribute in the rack elevation template. Because HTML
    uses the first of a duplicated attribute, the literal gs-locked="false" overrode the
    permission-derived value that followed it, so rear-face devices were never lock-flagged for
    users without change permission. Dragging was still prevented by gs-no-move, which was not
    duplicated, so this weakened the lock rather than bypassing permissions. It was also the
    outstanding djlint H037 error, so pre-commit now passes.

  • All four outstanding dependency advisories resolved (braces, picomatch, immutable,
    esbuild). None was reachable by users — all were build-time only, and none appears in the
    shipped bundle. Three came solely from esbuild-sass-pluginsasschokidar, which was
    removed: there are no .scss files and the stylesheet uses no Sass features, so esbuild
    bundles the plain CSS natively. The CSS output is byte-identical. esbuild was upgraded to
    0.28.2 for the remaining advisory. yarn audit now reports no vulnerabilities, and the
    install dropped from over 200 audited packages to 29.

  • Every front-end dependency is now pinned exactly, with no ^ or ~ ranges. Gridstack
    and Bootstrap so they cannot drift from the versions NetBox serves; esbuild because it is
    pre-1.0 and because it determines the bytes of the committed bundle.

  • Removed package-lock.json. The project carried both it and yarn.lock, which
    disagreed about peer dependencies — the direct cause of the Bootstrap build fragility above.
    yarn.lock is retained: it is the original lockfile, and NetBox core is also locked with
    yarn.

Housekeeping

  • Added API regression tests for the save endpoint: shifting a column of devices down by one,
    and two devices exchanging units. Both fail against the previous save logic.

  • Documentation restructured into an MkDocs site, with the compatibility matrix moved out of
    the README into COMPATIBILITY.md. A duplicated v4.1.x row was removed from the matrix in
    the process.

  • docs/img/development.md moved to docs/development.md — it is a development guide, not an
    image — and expanded to cover installing the JavaScript toolchain, which it previously
    omitted entirely, so a fresh clone could not build the bundle.

  • Corrected issue and repository links, which pointed at a repository that no longer hosts
    this plugin.


Earlier Releases

Releases prior to this change log are recorded on the
GitHub releases page, with
their supported NetBox versions in
COMPATIBILITY.md.

Don't miss a new netbox-reorder-rack release

NewReleases is sending notifications on new releases.