Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ export function App() {
</section>
<ProductConfigStatusPanel
statuses={configStatuses}
selectedEnvironment={activeEnvironment?.environment ?? selectedEnvironment}
loading={configStatusLoading}
error={configStatusError}
/>
Expand Down Expand Up @@ -1390,6 +1391,7 @@ function StateFixtureGallery({
<div className="fixture-wide">
<ProductConfigStatusPanel
statuses={fixtureConfigStatuses}
selectedEnvironment={fixtureEnvironment}
loading={false}
error=""
/>
Expand Down
24 changes: 18 additions & 6 deletions frontend/src/ProductConfigStatusPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@ import type {

export function ProductConfigStatusPanel({
statuses,
selectedEnvironment,
loading,
error,
}: {
statuses: ProductEnvironmentConfigStatus[];
selectedEnvironment: string;
loading: boolean;
error: string;
}) {
const totals = summarizeConfigStatuses(statuses);
const scopedStatuses = selectedEnvironment.trim()
? statuses.filter((status) => status.environment === selectedEnvironment)
: statuses;
const totals = summarizeConfigStatuses(scopedStatuses);
return (
<section className="panel config-status-panel" aria-busy={loading}>
<PanelHead
eyebrow="settings readiness"
title="Expected config"
title={`Expected config${selectedEnvironment ? ` / ${selectedEnvironment}` : ""}`}
right={
<div className="panel-badges">
<StatusPill status={statusToUiStatus(totals.worst)} />
Expand All @@ -40,11 +45,18 @@ export function ProductConfigStatusPanel({
<code>{error}</code>
</div>
) : null}
{loading && !statuses.length ? <ConfigStatusSkeleton /> : null}
{!loading && !statuses.length && !error ? (
<StateBlock icon={<Settings2 size={18} />} title="No expected config status" />
{loading && !scopedStatuses.length ? <ConfigStatusSkeleton /> : null}
{!loading && !scopedStatuses.length && !error ? (
<StateBlock
icon={<Settings2 size={18} />}
title={
selectedEnvironment
? `No expected config status for ${selectedEnvironment}`
: "No expected config status"
}
/>
) : null}
{statuses.map((status) => (
{scopedStatuses.map((status) => (
<EnvironmentConfigStatus key={`${status.product}:${status.environment}`} status={status} />
))}
</section>
Expand Down
Loading