mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2026-09-03 05:10:16 +03:00
Hide processor pipelines stat boxes during loading/empty state (#6983)
# Description of Changes Gate the processor Pipelines KPI strip on having real pipelines, so the loading and empty states no longer flash a row of empty `—` stat boxes. Matches the Policies view; Sources is intentionally left as-is. --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [x] I have run `task check` to verify linters, typechecks, and tests pass - [x] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#7-testing) for more details.
This commit is contained in:
@@ -22,10 +22,12 @@ export function Pipelines() {
|
||||
const { isLoading } = useSectionFlags(state);
|
||||
|
||||
const pipelines = data?.pipelines ?? [];
|
||||
// Empty once the fetch settles with no pipelines (or fails → no data). Gates
|
||||
// both the KPI strip and the empty panel so no placeholder stat boxes sit
|
||||
// above an empty page.
|
||||
// Empty once the fetch settles with no pipelines (or fails → no data); gates
|
||||
// the empty panel below.
|
||||
const showEmpty = !isLoading && pipelines.length === 0;
|
||||
// The KPI strip is pure stat boxes: show it only once real pipelines exist, so
|
||||
// the loading and empty states don't flash a row of placeholder cards.
|
||||
const hasPipelines = pipelines.length > 0;
|
||||
|
||||
const openCreate = () =>
|
||||
navigate(`${toPortalPath(VIEW_PATHS.pipelines)}/new`);
|
||||
@@ -54,7 +56,7 @@ export function Pipelines() {
|
||||
</Button>
|
||||
</header>
|
||||
|
||||
{!showEmpty && <KpiStrip data={data} loading={loading} />}
|
||||
{hasPipelines && <KpiStrip data={data} loading={loading} />}
|
||||
|
||||
{isLoading && (
|
||||
<div className="portal-pipelines__table-skeleton" aria-hidden>
|
||||
|
||||
Reference in New Issue
Block a user