Lifecycle planning, and consistent empty and loading states
- Inventory: end of support and replacement cost per asset; a Lifecycle page showing what ages out year by year and what replacing it will cost; support ending within 90 days in the weekly digest - Lists: a shared empty state saying what is missing, why, and the one thing to do; "nothing matches" with a clear button; skeleton rows instead of empty-looking lists while loading Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
92726568b7
commit
846af02851
50 files changed
+4434
-233
No files matched your search
@@ -3,6 +3,7 @@ import { Link, useSearchParams } from "react-router-dom";
|
||||
import { api, type ChangeEntry, type ChangeKind } from "../api/client";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { BlockSkeleton } from "../components/Skeleton";
|
||||
import EmptyState from "../components/EmptyState";
|
||||
import { downloadCsv } from "../utils/csv";
|
||||
import { formatDate, formatTime } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
@@ -157,10 +158,16 @@ export default function ChangeLog() {
|
||||
{entries === null && !error && <BlockSkeleton lines={5} />}
|
||||
{entries !== null && entries.length === 0 && (
|
||||
<div className="card">
|
||||
<div className="card-body text-secondary text-center">
|
||||
Nothing {q || kind || serverId ? "matches that" : "has changed"} in {RANGES.find((r) => r.days === days)?.label.toLowerCase()}.
|
||||
{(q || kind || serverId || days < 400) && " Try a wider range or fewer filters."}
|
||||
</div>
|
||||
{q || kind || serverId ? (
|
||||
<EmptyState
|
||||
filtered
|
||||
title="Nothing matches that"
|
||||
hint={`Nothing in ${RANGES.find((r) => r.days === days)?.label.toLowerCase()} fits what is searched for. Try a wider range, or fewer filters.`}
|
||||
action={{ label: "Clear the search and filters", onClick: () => { setText(""); setParams(new URLSearchParams(), { replace: true }); } }}
|
||||
/>
|
||||
) : (
|
||||
<EmptyState title="Nothing has changed" hint={`No change was recorded in ${RANGES.find((r) => r.days === days)?.label.toLowerCase()}. Try a wider range.`} action={days < 400 ? { label: "Show everything kept", onClick: () => setParam("days", "400") } : undefined} />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{days_.map((group) => (
|
||||
|
||||
Reference in new issue
Block a user