Repository navigation
Conversation
2 of 3 tasks
…ew casts
The five alert-capability endpoints returned untyped data, and the rule
editor worked around it with local interfaces — one of them wrong: the
modal declared Proxmox scope options as {id, name} while the server and
AlertRuleStepSource use {id, label}. AlertsView then bound fifteen props
and handlers through `as any`, which vue-tsc does not check and the
no-explicit-any lint rule cannot see in templates.
- api/alerts.ts types the capability GETs with the generated models
(AlertSplitCapabilities, AlertDockerCapabilities, AlertHostCapabilities)
plus AlertMetricCatalog for the {metrics} envelope; types/alert.ts adds
AlertRuleCapabilities, the merged shape useAlertsPage builds.
- AlertRuleModal, AlertRuleStepSource and AlertRuleList drop their local
copies for the generated types (AlertRule, AlertMetricCapability,
AlertScopeOption, AlertDockerHostScope, ...).
- The modal emits the API AlertRulePayload; the form→API conversion (the
form keeps explicit nulls for cleared values) happens in one helper
instead of three casts.
- AlertsView has no `as any` left.
Root CLAUDE.md no longer claims every API response is typed and says
which modules still return untyped data.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rem7474
force-pushed
the
refactor/dedupe-css-and-template-blocks
branch
from
September 30, 2026 19:31
ba9e1d4 to
4e028c5
Compare
Rem7474
force-pushed
the
refactor/type-alert-capabilities
branch
from
September 30, 2026 19:31
60b7275 to
720529a
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rem7474
force-pushed
the
refactor/type-alert-capabilities
branch
from
September 30, 2026 19:37
720529a to
3af0beb
Compare
|
Owner
Author
|
SonarCloud new-code coverage: 54.5 % (gate 80 %), left as is on purpose. The remaining uncovered new lines have no runtime behaviour to test:
A spec for the "Tester" action (payload plus API error display) was added, since that path had no test. A test for each typed line would only re-assert the TypeScript types. vue-tsc covers those at build time. 🤖 Generated with Claude Code |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
AlertSplitCapabilities,AlertDockerCapabilities,AlertHostCapabilities) +AlertMetricCatalogfor the{metrics}envelope.types/alert.tsaddsAlertRuleCapabilities(the merged shapeuseAlertsPagebuilds).AlertRuleModal,AlertRuleStepSource,AlertRuleListdrop their local interfaces for the generated ones. One local type was wrong: the modal described Proxmox scope options as{id, name}while the server and the step component use{id, label}.AlertRulePayload; the form→API conversion (form keeps explicitnullfor cleared hysteresis/scopes) happens in one helper instead of three casts.AlertsView.vue: 15as anytemplate casts → 0. They hid nothing serious once the types lined up — the remaining mismatches wereformatDatenot acceptingundefinedand the handler/payload types above.CLAUDE.md: no longer claims every API response is typed; points at the modules that still return untyped data (51api.get(calls remain, mostlyproxmox/hosts/auth).Other views with template casts (
DockerView,HostDetailView,GitWebhooksView,DashboardView) are left for follow-ups, one per view.Stacked on #433.
Test plan
typecheck,lint, fullnpm run test(alerts specs updated to typed fixtures)🤖 Generated with Claude Code