Skip to content

PTZ controls: drop the Type column, as ZoneMinder 1.39.39 did - #42

Open
connortechnology wants to merge 4 commits into
ci-audit-and-seed-fixfrom
ptz-controls-drop-type
Open

connortechnology wants to merge 4 commits into
ci-audit-and-seed-fixfrom
ptz-controls-drop-type

Conversation

@connortechnology

Copy link
Copy Markdown
Member

Summary

ZoneMinder 1.39.39 (ZoneMinder/zoneminder@104327349) dropped Controls.Type, which nothing ever read, and removed it from the control list and the controlcap edit form. zm-api now returns type: null and ignores the field on create and update. As a result, zm-web showed an always-empty Type column and an editor dropdown whose value was thrown away.

This PR removes Type from the UI, matching legacy:

  • List, both skins: the Type column and its sort are gone. The modern search placeholder now reads "Search name or protocol…", and the string is updated in every locale.
  • Editor, both skins: the Type dropdown is gone (it offered Local/Remote/Ffmpeg/Libvlc/cURL), and so is its Local default in the empty form.
  • API types:
    • Create payloads no longer include type; only name is required.
    • Control.type stays as type?: null, since zm-api still sends the key, but it isn't an editable field.
  • OpenAPI snapshot: only ControlResponse.type is patched (nullable, no longer required), to match what zm-api publishes now. The rest of the snapshot is untouched.

Stacked on #41, which makes the search handle a null type and fixes CI. The base branch is #41's, so this diff shows only the Type removal. Once #41 is merged, GitHub will retarget this PR to main.

Tests

  • Unit tests were updated:
    • The mocked controls now return type: null, as zm-api does.
    • The list tests check that the Type column is absent.
    • The create tests check that no type is sent.
  • Locally, tsc, eslint and i18n:check are clean, and all 4,051 unit tests pass.

🤖 Generated with Claude Code

connortechnology and others added 4 commits October 27, 2026 11:06
npm audit --audit-level=high now fails every branch on newly published
advisories in vite (<=7.3.6), seroval (<=1.6.2) and source-map-js
(1.0.0-1.2.1). `npm audit fix` moves the lockfile to vite 7.3.7,
seroval 1.6.12 and source-map-js 1.2.2; package.json is unchanged.

The seeded e2e job loads ZoneMinder master's schema, which dropped
Controls.Type (ZoneMinder 104327349), so the seed's positional
`INSERT INTO Controls VALUES` had one value too many and failed with
ERROR 1136. Name the columns instead and drop Type, so a column added
or removed elsewhere in Controls no longer breaks the load. Stock rows
now live in db/controls.sql; the comment points there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ZoneMinder 1.39.39 dropped Controls.Type (ZoneMinder 104327349), so
zm-api now returns `type: null` for every control. The PTZ controls
page searched with `c.type.toLowerCase()`, which throws as soon as
anything is typed in the search box; client.ts reports a TypeError as
"Cannot reach the server.", which is what the seeded e2e saw. Type the
field as nullable and search `c.type ?? ''`. The e2e check that the
seeded row says "Ffmpeg" now checks its protocol, PelcoD, instead.

The e2e job also still checked out SteveGilvarry/zm-api, which stopped
moving when the project moved to ZoneMinder/zm-api; build that instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ZoneMinder 104327349 removed Controls.Type, which nothing ever read,
along with its row in the controlcap edit form and its column in the
control list. zm-api now returns `type: null` and ignores it on writes,
so zm-web showed an always-blank Type column and an editor select whose
value went nowhere.

Remove the Type column (and its sort) from the list in both skins, the
Type select from the editor, its default from the empty form and its
key from create payloads. The search placeholder no longer offers
type. `Control.type` stays as `type?: null`, since zm-api still sends
the key, and is excluded from the editable field keys.

The OpenAPI snapshot is patched for just ControlResponse.type, which
zm-api now documents as nullable and optional.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SteveGilvarry
SteveGilvarry force-pushed the ci-audit-and-seed-fix branch 2 times, most recently from baa6d11 to e7b5713 Compare October 29, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant