fix(#5154): prevent alert message from showing while loading SBOMs#5157
fix(#5154): prevent alert message from showing while loading SBOMs#5157
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the SBOM dependency trees instance view to avoid showing the “no data provided” warning while SBOM IDs are still being fetched.
Changes:
- Gate the “no data provided” warning behind
hasLoadedto prevent it from appearing during initial load. - Reset
hasLoadedat the start offetchSboms()to re-enable the loading state on refetch. - Introduce a new
isLoadingdata property (currently unused).
Comments suppressed due to low confidence (1)
spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/index.vue:38
- The "no data provided" warning will still render when the SBOM fetch fails (because
hasLoadedbecomes true andsbomsstays empty), leading to a misleading second alert alongside the fetch error. Consider guarding this block with!error(or similar) so it only shows when the request succeeded but returned no IDs.
<template v-if="hasLoaded && sboms.length === 0">
<sba-alert
severity="WARN"
:error="$t('instances.dependencies.no_data_provided')"
/>
You can also share your feedback on Copilot code review. Take the survey.
spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/index.vue
Show resolved
Hide resolved
spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/index.vue
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Updates the SBOM dependency trees instance view to avoid showing the “no data provided” warning while SBOM IDs are still loading, and adds a regression test for the empty-state loading behavior.
Changes:
- Gate the empty-state warning in the SBOM dependency trees view behind a
hasLoadedflag. - Reset
hasLoadedtofalsewhen starting an SBOM ID fetch. - Add a new UI test that asserts the warning is hidden while the fetch is pending and appears after an empty result resolves.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/index.vue |
Prevents the empty-state warning from rendering during the initial/pending load by requiring hasLoaded. |
spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/index.spec.ts |
Adds a regression test covering the pending-load vs. resolved-empty behavior. |
Comments suppressed due to low confidence (1)
spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/index.vue:38
- The “no data provided” warning will also render when
fetchSbomIds()fails (becausehasLoadedbecomes true andsbomsstays empty), leading to a misleading warning alongside the section’s error alert. Consider gating the empty-state warning on!error(e.g., include!errorin thev-if) so it only shows for a successful load with an empty result.
<template v-if="hasLoaded && sboms.length === 0">
<sba-alert
severity="WARN"
:error="$t('instances.dependencies.no_data_provided')"
/>
You can also share your feedback on Copilot code review. Take the survey.
fixes #5154