fix: render SOVD resources for subcomponent entity type#73
Open
fix: render SOVD resources for subcomponent entity type#73
Conversation
Subcomponent entities served via /api/v1/components/{id} expose the
full resource set (data, operations, configurations, faults, logs) but
EntityDetailPanel and refreshSelectedEntity only branched on
type === 'component', leaving subcomponents with a bare header and the
"No detailed information available" fallback. Treat 'subcomponent' the
same as 'component' for resource fetching, tab rendering, type-icon /
background, and refresh routing.
There was a problem hiding this comment.
Pull request overview
Fixes the entity detail view so subcomponent entities render and fetch SOVD resources the same way as component entities, aligning UI behavior with how the gateway serves subcomponent resources (via the components API namespace).
Changes:
- Map
subcomponent→componentsfor refresh and API entity-type routing. - Treat
subcomponentas a component inEntityDetailPanelso the resource tab bar renders and resource counts/data are fetched. - Add a regression test ensuring subcomponents prefetch counts as
componentsand render the full resource tab set.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/lib/store.ts |
Ensures Refresh re-fetches subcomponents using the components API type mapping. |
src/components/EntityDetailPanel.tsx |
Enables resource fetching + tab rendering + header styling for subcomponent entities. |
src/components/EntityDetailPanel.test.tsx |
Adds a regression test covering the subcomponent tab bar and counts prefetch behavior. |
Comment on lines
629
to
633
| case 'area': | ||
| return <Layers className="w-6 h-6 text-cyan-500" />; | ||
| case 'component': | ||
| case 'subcomponent': | ||
| return <Box className="w-6 h-6 text-indigo-500" />; |
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
Subcomponent entities (served via
/api/v1/components/{id}after peer aggregation) expose the full SOVD resource set (data, operations, configurations, faults, logs), but the UI rendered only the entity header for them, then fell through to "No detailed information available for this entity." with no tab bar and no fetch.This change treats
'subcomponent'identically to'component'for:fetchEntityDatainEntityDetailPanel<ComponentTabContent>render branchgetEntityTypeForApimappingtypeMapinrefreshSelectedEntity(so the Refresh button actually re-fetches)Issue
Type
Testing
EntityDetailPanel.test.tsxmounts the panel withselectedEntity.type === 'subcomponent'and asserts thatprefetchResourceCountsis called with'components'and that the Data / Operations / Config / Faults / Logs buttons render. The test fails onmain.npm test(404 passed).npm run lintandnpm run typecheckare clean.npm run buildsucceeds; Docker image builds.Checklist
npm run lint)npm run build)