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
@@ -185,11 +185,16 @@ export async function buildDigest(now: Date = new Date()): Promise<Digest> {
|
||||
expiring.push({ daysLeft: d.daysLeft, text: d.daysLeft < 0 ? `Domain ${d.name} expired ${plural(Math.abs(d.daysLeft), "day")} ago` : `Domain ${d.name} expires in ${plural(d.daysLeft, "day")} (${d.expiresAt})` });
|
||||
}
|
||||
// A warranty about to end is worth knowing while there is still time to claim on it; one that ended long ago is not news.
|
||||
for (const a of await db.select({ name: assets.name, warrantyUntil: assets.warrantyUntil }).from(assets)) {
|
||||
for (const a of await db.select({ name: assets.name, warrantyUntil: assets.warrantyUntil, endOfSupport: assets.endOfSupport }).from(assets)) {
|
||||
const days = warrantyDaysLeft(a.warrantyUntil, now);
|
||||
if (days !== null && days >= -30 && days <= 60) {
|
||||
expiring.push({ daysLeft: days, text: days < 0 ? `Warranty on ${a.name} ended ${plural(Math.abs(days), "day")} ago` : `Warranty on ${a.name} ends in ${plural(days, "day")} (${a.warrantyUntil})` });
|
||||
}
|
||||
// The end of support gives more notice: it is when something has to be replaced, not claimed on.
|
||||
const supportDays = warrantyDaysLeft(a.endOfSupport, now);
|
||||
if (supportDays !== null && supportDays >= -30 && supportDays <= 90) {
|
||||
expiring.push({ daysLeft: supportDays, text: supportDays < 0 ? `Support for ${a.name} ended ${plural(Math.abs(supportDays), "day")} ago` : `Support for ${a.name} ends in ${plural(supportDays, "day")} (${a.endOfSupport})` });
|
||||
}
|
||||
}
|
||||
if (expiring.length > 0) {
|
||||
expiring.sort((a, b) => a.daysLeft - b.daysLeft);
|
||||
|
||||
Reference in new issue
Block a user