fix the four typecheck errors that broke the build
`npm run build` runs `tsc --noEmit` first, so all four stopped the deploy before vite ever ran. They came in with the redesign commit. KpiCard: the note pill was removed from the tile but `note` was still destructured, and `noUnusedLocals` rejects that. The prop stays declared — 87 call sites across 21 files pass it — and is now documented as accepted and ignored, the same way `fill` already was. Those 87 strings are written and never shown; the comment says so rather than leaving it a puzzle. InventoryPage: dropped an unused SectionHeader import, and `colour` is not a BadgeProps field. The intent was a brand-coloured "In transit", so that is now `variant="purple"` — a real variant in BadgeVariantMap, and the brand is purple. StoreAccountPage: `current` is a BRANCH, and `gettenantlocations` sends no tenantname on it (checked on the wire against tenant 1147). So the second half of `shopQuery.data?.tenantname || current?.tenantname` could never fire. Removed rather than added to the type — a field the backend does not send is exactly the bug the previous commit fixed on the summary endpoints. Verified: tsc clean, 625 tests pass, vite build clean, and the lock file installs under `npm@10.9.8 ci` — the builder's npm, which the image pins. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JYEsb8PNZ19G9R8gUjTU7n
This commit is contained in:
@@ -19,8 +19,17 @@ export interface KpiCardProps {
|
||||
label: string;
|
||||
value: string;
|
||||
/**
|
||||
* The sub-pill. This is where the number gets its meaning — "1 of 84 orders"
|
||||
* says something "1.2%" does not.
|
||||
* Accepted and ignored, like `fill` below.
|
||||
*
|
||||
* This was the sub-pill — where the number got its meaning, since "1 of 84
|
||||
* orders" says something "1.2%" does not. The pill was removed from the tile
|
||||
* deliberately; 87 call sites across 21 files still pass the text, so the
|
||||
* prop stays declared to keep them compiling and is not read.
|
||||
*
|
||||
* That means every one of those 87 strings is now written and never shown.
|
||||
* Either drop them from the callers or bring the pill back — right now it is
|
||||
* neither, and this comment is here so that is visible rather than a puzzle
|
||||
* for whoever next wonders where "84 orders" went.
|
||||
*/
|
||||
note?: string;
|
||||
tone?: KpiTone;
|
||||
@@ -39,11 +48,12 @@ export interface KpiCardProps {
|
||||
/**
|
||||
* A KPI tile.
|
||||
*
|
||||
* Label and icon, a large tabular value, a muted sub-pill carrying the
|
||||
* interpretation, and a 2px underline in the tile's tone. Sized to sit 4–6
|
||||
* Label and icon, then a large tabular value. The sub-pill and the 2px tone
|
||||
* underline were both removed from the tile; `note` and `fill` still arrive
|
||||
* from the call sites and are ignored — see the props above. Sized to sit 4–6
|
||||
* across rather than 4 — a console is glanced at all day, not read once.
|
||||
*/
|
||||
export function KpiCard({ label, value, note, tone = 'neutral', icon }: KpiCardProps) {
|
||||
export function KpiCard({ label, value, tone = 'neutral', icon }: KpiCardProps) {
|
||||
const color = TONE_COLOR[tone];
|
||||
|
||||
return (
|
||||
|
||||
@@ -28,7 +28,6 @@ import { stockApi } from '@/api/stock';
|
||||
import type { StockRequest } from '@/api/types';
|
||||
import { KpiCard } from '@/components/KpiCard';
|
||||
import { PageHeader } from '@/components/PageHeader';
|
||||
import { SectionHeader } from '@/components/SectionHeader';
|
||||
import { queryKeys } from '@/queries/keys';
|
||||
import { useStockRequests, useStockStatement } from '@/queries/hooks';
|
||||
import { useSelection } from '@/components/useSelection';
|
||||
@@ -683,7 +682,7 @@ function RequestsPanel({
|
||||
{request.status === 'Pending' ? (
|
||||
<Badge variant="warning" label="Awaiting approval" />
|
||||
) : request.status === 'Approved' ? (
|
||||
<Badge variant="neutral" label="In transit" colour="var(--color-brand)" />
|
||||
<Badge variant="purple" label="In transit" />
|
||||
) : request.status === 'Received' ? (
|
||||
<Badge variant="success" label="Stock added" />
|
||||
) : (
|
||||
|
||||
@@ -267,9 +267,13 @@ export function StoreAccountPage() {
|
||||
icon={<Store size={15} />}
|
||||
title="Shop & location"
|
||||
>
|
||||
{/* `current` is a BRANCH, and `gettenantlocations` sends no tenant
|
||||
name on it — verified on the wire, tenant 1147. So the second
|
||||
half of this fallback could never fire; `gettenantinfo` is the
|
||||
only call that carries the business name. */}
|
||||
<Row
|
||||
label="Store / Business"
|
||||
value={shopQuery.data?.tenantname || current?.tenantname || 'Your business'}
|
||||
value={shopQuery.data?.tenantname || 'Your business'}
|
||||
/>
|
||||
<Row
|
||||
label="Assigned shop"
|
||||
|
||||
Reference in New Issue
Block a user