Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Prune files not in the deploy set (stale build context)
Browse files
web/src/customer-grid/AmazonPeriodPicker.tsx
DELETED
|
@@ -1,313 +0,0 @@
|
|
| 1 |
-
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
| 2 |
-
import type { MutableRefObject } from "react";
|
| 3 |
-
import { createPortal } from "react-dom";
|
| 4 |
-
import { Barcode, ChartBar, Kanban, NotePencil, Tag, TreeStructure } from "@phosphor-icons/react";
|
| 5 |
-
import type { Icon } from "@phosphor-icons/react";
|
| 6 |
-
import { API_V1, CREDENTIALS, ROWS_STALE_EVENT, signal } from "../apiContract";
|
| 7 |
-
import { clearTopicRowsCache, dropTableRowsCache, refusalMessage } from "./apiBridge";
|
| 8 |
-
import { dataPathHash, readDataPath } from "./dataPath";
|
| 9 |
-
import AccountView, { AccountTabs, useAccountDashboardComponents } from "../apps/amazon-profit/AccountView";
|
| 10 |
-
import type { AccountDashboardComponents, AccountSkuSelection, AccountTab } from "../apps/amazon-profit/AccountView";
|
| 11 |
-
import "./amazonPeriodPicker.css";
|
| 12 |
-
export { DashboardPeriodPicker } from "./DashboardPeriodPicker";
|
| 13 |
-
|
| 14 |
-
/** The SKU grain table. It owns the period and the dashboard. */
|
| 15 |
-
export const AMAZON_PROFIT_TABLE = "ut_amazon_sku_profit";
|
| 16 |
-
|
| 17 |
-
type CommandCenterGrain = "sku" | "asin" | "parent" | "projects" | "data_entry";
|
| 18 |
-
/** S82-T72: the incomplete SKUs. It has no period. */
|
| 19 |
-
export const AMAZON_DATA_ENTRY_TABLE = "ut_amazon_data_entry";
|
| 20 |
-
/** The Command Center tables. Every other database renders nothing. */
|
| 21 |
-
export const COMMAND_CENTER_TABLES: Record<string, CommandCenterGrain> = {
|
| 22 |
-
[AMAZON_PROFIT_TABLE]: "sku",
|
| 23 |
-
ut_amazon_asin_profit: "asin",
|
| 24 |
-
ut_amazon_parent_profit: "parent",
|
| 25 |
-
ut_amazon_projects: "projects",
|
| 26 |
-
[AMAZON_DATA_ENTRY_TABLE]: "data_entry",
|
| 27 |
-
};
|
| 28 |
-
const GRAIN_TABLE: Record<CommandCenterGrain, string> = Object.fromEntries(
|
| 29 |
-
Object.entries(COMMAND_CENTER_TABLES).map(([table, grain]) => [grain, table])) as Record<CommandCenterGrain, string>;
|
| 30 |
-
/** The period POST rewrites these three tables. Projects and Data Entry have no period. */
|
| 31 |
-
const PERIOD_TABLES = [AMAZON_PROFIT_TABLE, "ut_amazon_asin_profit", "ut_amazon_parent_profit"];
|
| 32 |
-
const hasPeriod = (grain: CommandCenterGrain | undefined) => !!grain && grain !== "projects" && grain !== "data_entry";
|
| 33 |
-
const COMMAND_CENTER_TABS: Array<{ id: AccountTab; label: string; icon: Icon }> = [
|
| 34 |
-
{ id: "sku", label: "SKU", icon: Barcode }, { id: "asin", label: "Child ASIN", icon: Tag },
|
| 35 |
-
{ id: "parent", label: "Parent ASIN", icon: TreeStructure },
|
| 36 |
-
{ id: "projects", label: "Projects", icon: Kanban }, { id: "dashboard", label: "Dashboard", icon: ChartBar },
|
| 37 |
-
{ id: "data_entry", label: "Data Entry", icon: NotePencil },
|
| 38 |
-
].filter((tab) => tab.id !== "data_entry") as Array<{ id: AccountTab; label: string; icon: Icon }>;
|
| 39 |
-
type Mode = "grid" | "dashboard";
|
| 40 |
-
// A Dashboard click on another table navigates to the SKU table. The grid can remount on that
|
| 41 |
-
// switch, so the request rides here as well as on the `.cg-main` dataset.
|
| 42 |
-
let dashboardRequested = false;
|
| 43 |
-
|
| 44 |
-
/** Open a database's Grid through the same hash the Table rail writes. */
|
| 45 |
-
function openCommandCenterTable(table: string) {
|
| 46 |
-
const current = readDataPath();
|
| 47 |
-
if (current?.database === table) return;
|
| 48 |
-
window.location.hash = dataPathHash({ database: table });
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
type PeriodChoice = { key: string; label: string };
|
| 52 |
-
type ProfitStatus = {
|
| 53 |
-
period: { key: string; label: string };
|
| 54 |
-
periods: PeriodChoice[];
|
| 55 |
-
canEdit: boolean;
|
| 56 |
-
refusal: string | null;
|
| 57 |
-
verified?: string | null;
|
| 58 |
-
};
|
| 59 |
-
|
| 60 |
-
/** A refused period POST retains the stored period and rows cache. */
|
| 61 |
-
export function usePeriodChoice(load: () => Promise<void>) {
|
| 62 |
-
const [busy, setBusy] = useState(false);
|
| 63 |
-
const [pending, setPending] = useState<string | null>(null);
|
| 64 |
-
const [message, setMessage] = useState<string | null>(null);
|
| 65 |
-
const choose = useCallback(async (key: string) => {
|
| 66 |
-
setBusy(true);
|
| 67 |
-
setPending(key);
|
| 68 |
-
setMessage(null);
|
| 69 |
-
try {
|
| 70 |
-
const res = await fetch(`${API_V1}/amazon-profit/period`, {
|
| 71 |
-
method: "POST", credentials: CREDENTIALS,
|
| 72 |
-
headers: { "Content-Type": "application/json" },
|
| 73 |
-
body: JSON.stringify({ period: key }),
|
| 74 |
-
});
|
| 75 |
-
if (!res.ok) {
|
| 76 |
-
const body: unknown = await res.json().catch(() => null);
|
| 77 |
-
setMessage(refusalMessage(body, res.status, "The period did not change. Try again."));
|
| 78 |
-
await load().catch(() => undefined);
|
| 79 |
-
return;
|
| 80 |
-
}
|
| 81 |
-
for (const table of PERIOD_TABLES) {
|
| 82 |
-
clearTopicRowsCache(`tables/${table}/rows`);
|
| 83 |
-
dropTableRowsCache(table);
|
| 84 |
-
}
|
| 85 |
-
signal(ROWS_STALE_EVENT);
|
| 86 |
-
await load();
|
| 87 |
-
} catch {
|
| 88 |
-
setMessage("The period did not change. Try again.");
|
| 89 |
-
} finally {
|
| 90 |
-
setPending(null);
|
| 91 |
-
setBusy(false);
|
| 92 |
-
}
|
| 93 |
-
}, [load]);
|
| 94 |
-
return { busy, pending, message, setMessage, choose };
|
| 95 |
-
}
|
| 96 |
-
|
| 97 |
-
/** The Period select. `pending` holds the choice in flight, so a refusal reverts it. */
|
| 98 |
-
function PeriodSelectField({ status, pending, busy, choose, notesHost }: {
|
| 99 |
-
status: ProfitStatus; pending: string | null; busy: boolean;
|
| 100 |
-
choose: (key: string) => Promise<void>; notesHost?: HTMLElement | null }) {
|
| 101 |
-
const choices = status.periods.some((p) => p.key === status.period.key)
|
| 102 |
-
? status.periods : [{ key: status.period.key, label: status.period.label }, ...status.periods];
|
| 103 |
-
const notes = busy ? <span className="cg-period-busy">Updating</span> : null;
|
| 104 |
-
return (
|
| 105 |
-
<div className="cg-period-picker" data-testid="amazon-period-picker">
|
| 106 |
-
<label>
|
| 107 |
-
<span>Period</span>
|
| 108 |
-
<select
|
| 109 |
-
className="cg-select"
|
| 110 |
-
aria-label="Period"
|
| 111 |
-
value={pending ?? status.period.key}
|
| 112 |
-
disabled={!status.canEdit || busy}
|
| 113 |
-
title={status.canEdit ? undefined : "Only an editor can change the period."}
|
| 114 |
-
onChange={(event) => void choose(event.target.value)}
|
| 115 |
-
>
|
| 116 |
-
{choices.map((p) => <option key={p.key} value={p.key}>{p.label}</option>)}
|
| 117 |
-
</select>
|
| 118 |
-
</label>
|
| 119 |
-
{notes && (notesHost ? createPortal(<span className="cg-period-notes">{notes}</span>, notesHost) : notes)}
|
| 120 |
-
</div>
|
| 121 |
-
);
|
| 122 |
-
}
|
| 123 |
-
|
| 124 |
-
/** The Command Center toolbar's Period select is passed as the grid's `toolbarLead`. */
|
| 125 |
-
export function AmazonPeriodSelect({ database }: { database: string }) {
|
| 126 |
-
const grain: CommandCenterGrain | undefined = COMMAND_CENTER_TABLES[database];
|
| 127 |
-
const [status, setStatus] = useState<ProfitStatus | null>(null);
|
| 128 |
-
const anchor = useRef<HTMLSpanElement>(null);
|
| 129 |
-
const [notesHost, setNotesHost] = useState<HTMLElement | null>(null);
|
| 130 |
-
const load = useCallback(async (abortSignal?: AbortSignal) => {
|
| 131 |
-
const res = await fetch(`${API_V1}/amazon-profit`, { credentials: CREDENTIALS,
|
| 132 |
-
signal: abortSignal ?? AbortSignal.timeout(20000) });
|
| 133 |
-
if (!res.ok) return;
|
| 134 |
-
setStatus((await res.json()) as ProfitStatus);
|
| 135 |
-
}, []);
|
| 136 |
-
const { busy, pending, message, setMessage, choose } = usePeriodChoice(load);
|
| 137 |
-
useEffect(() => {
|
| 138 |
-
if (!hasPeriod(grain)) return;
|
| 139 |
-
const controller = new AbortController();
|
| 140 |
-
const timeout = window.setTimeout(() => controller.abort(), 20000);
|
| 141 |
-
void load(controller.signal).catch(() => {
|
| 142 |
-
if (!controller.signal.aborted) setMessage("The period could not be loaded.");
|
| 143 |
-
}).finally(() => window.clearTimeout(timeout));
|
| 144 |
-
return () => { window.clearTimeout(timeout); controller.abort(); };
|
| 145 |
-
}, [grain, load, setMessage]);
|
| 146 |
-
useLayoutEffect(() => {
|
| 147 |
-
setNotesHost(anchor.current?.closest(".cg-main")?.querySelector<HTMLElement>(".ap-table-switcher") ?? null);
|
| 148 |
-
}, [status, message]);
|
| 149 |
-
if (!hasPeriod(grain)) return null;
|
| 150 |
-
return <span className="cc-toolbar-period" ref={anchor}>
|
| 151 |
-
{status ? <PeriodSelectField status={status} pending={pending} busy={busy}
|
| 152 |
-
choose={choose} notesHost={notesHost} />
|
| 153 |
-
: null}
|
| 154 |
-
</span>;
|
| 155 |
-
}
|
| 156 |
-
|
| 157 |
-
/** Set by the Command Center App: a tab switches the hosted table, never the hash. */
|
| 158 |
-
export const CommandCenterTableContext = createContext<((table: string) => void) | null>(null);
|
| 159 |
-
|
| 160 |
-
/** The Command Center tab strip drawn outside a grid, for a table that is not built yet. */
|
| 161 |
-
export function CommandCenterTabStrip({ database, onOpenTable }: {
|
| 162 |
-
database: string; onOpenTable: (table: string) => void }) {
|
| 163 |
-
const shared = useAccountDashboardComponents();
|
| 164 |
-
const grain: CommandCenterGrain | undefined = COMMAND_CENTER_TABLES[database];
|
| 165 |
-
if (!grain) return null;
|
| 166 |
-
const chooseTab = (next: AccountTab) => {
|
| 167 |
-
if (next !== "dashboard") {
|
| 168 |
-
dashboardRequested = false;
|
| 169 |
-
onOpenTable(GRAIN_TABLE[next]);
|
| 170 |
-
return;
|
| 171 |
-
}
|
| 172 |
-
// The Dashboard lives on the SKU table, so a missing SKU table has no Dashboard to open.
|
| 173 |
-
if (grain === "sku") return;
|
| 174 |
-
dashboardRequested = true;
|
| 175 |
-
onOpenTable(AMAZON_PROFIT_TABLE);
|
| 176 |
-
};
|
| 177 |
-
return <div className="ap-table-switcher">
|
| 178 |
-
<AccountTabs tabs={COMMAND_CENTER_TABS} activeTab={grain} onTabChange={chooseTab}
|
| 179 |
-
components={shared.components} />
|
| 180 |
-
</div>;
|
| 181 |
-
}
|
| 182 |
-
|
| 183 |
-
type Props = { database: string; dashboardComponents?: AccountDashboardComponents;
|
| 184 |
-
onSelectSku?: (selection: AccountSkuSelection) => void };
|
| 185 |
-
|
| 186 |
-
/** Keep the shared table period separate from each reader's account analysis window. */
|
| 187 |
-
export default function AmazonPeriodPicker(props: Props) {
|
| 188 |
-
const mainRef = useRef<HTMLElement | null>(null);
|
| 189 |
-
const grain: CommandCenterGrain | undefined = COMMAND_CENTER_TABLES[props.database];
|
| 190 |
-
useLayoutEffect(() => {
|
| 191 |
-
if (!grain && mainRef.current) delete mainRef.current.dataset.amazonProfitTab;
|
| 192 |
-
}, [grain]);
|
| 193 |
-
useLayoutEffect(() => () => {
|
| 194 |
-
// A toolbar remount mounts a new switcher in the same commit, so clear only when none came back.
|
| 195 |
-
const main = mainRef.current;
|
| 196 |
-
if (main) window.setTimeout(() => {
|
| 197 |
-
if (!main.querySelector(".ap-table-switcher")) delete main.dataset.amazonProfitTab;
|
| 198 |
-
}, 0);
|
| 199 |
-
}, []);
|
| 200 |
-
if (!grain) return null;
|
| 201 |
-
return <ProfitTablePeriodPicker {...props} grain={grain} mainRef={mainRef} />;
|
| 202 |
-
}
|
| 203 |
-
|
| 204 |
-
function ProfitTablePeriodPicker({ dashboardComponents, onSelectSku, mainRef, grain }: Props & {
|
| 205 |
-
grain: CommandCenterGrain; mainRef: MutableRefObject<HTMLElement | null> }) {
|
| 206 |
-
const onOpenTable = useContext(CommandCenterTableContext);
|
| 207 |
-
const [status, setStatus] = useState<ProfitStatus | null>(null);
|
| 208 |
-
const [loading, setLoading] = useState(true);
|
| 209 |
-
const [mode, setMode] = useState<Mode>("grid");
|
| 210 |
-
const dashboardOn = grain === "sku" && mode === "dashboard";
|
| 211 |
-
const tab: AccountTab = dashboardOn ? "dashboard" : grain;
|
| 212 |
-
const lastGrain = useRef(grain);
|
| 213 |
-
const anchor = useRef<HTMLDivElement>(null);
|
| 214 |
-
const [slot, setSlot] = useState<HTMLElement | null>(null);
|
| 215 |
-
// An embedded grid (the Projects popup, a record drawer) is not the App: no tab strip there.
|
| 216 |
-
const [embedded, setEmbedded] = useState(false);
|
| 217 |
-
useLayoutEffect(() => {
|
| 218 |
-
setEmbedded(!!anchor.current?.closest(".cg-link-grid-modal, .cg-record-backdrop"));
|
| 219 |
-
}, []);
|
| 220 |
-
const shared = useAccountDashboardComponents(dashboardComponents);
|
| 221 |
-
|
| 222 |
-
const load = useCallback(async (abortSignal?: AbortSignal) => {
|
| 223 |
-
const res = await fetch(`${API_V1}/amazon-profit`, { credentials: CREDENTIALS,
|
| 224 |
-
signal: abortSignal ?? AbortSignal.timeout(20000) });
|
| 225 |
-
if (!res.ok) return;
|
| 226 |
-
setStatus((await res.json()) as ProfitStatus);
|
| 227 |
-
}, []);
|
| 228 |
-
const { busy, pending, setMessage, choose } = usePeriodChoice(load);
|
| 229 |
-
|
| 230 |
-
useEffect(() => {
|
| 231 |
-
if (grain === "data_entry") { setLoading(false); return; }
|
| 232 |
-
let current = true;
|
| 233 |
-
const controller = new AbortController();
|
| 234 |
-
const timeout = window.setTimeout(() => controller.abort(), 20000);
|
| 235 |
-
void load(controller.signal).catch(() => { if (current) setMessage("The period could not be loaded."); })
|
| 236 |
-
.finally(() => { window.clearTimeout(timeout); if (current) setLoading(false); });
|
| 237 |
-
return () => { current = false; window.clearTimeout(timeout); controller.abort(); };
|
| 238 |
-
}, [grain, load, setMessage]);
|
| 239 |
-
|
| 240 |
-
useLayoutEffect(() => {
|
| 241 |
-
const main = anchor.current?.closest<HTMLElement>(".cg-main");
|
| 242 |
-
if (!main) return;
|
| 243 |
-
mainRef.current = main;
|
| 244 |
-
// The grid can remount this toolbar during its row refresh or a Command Center table switch.
|
| 245 |
-
const wanted = main.dataset.amazonProfitTab === "dashboard" || dashboardRequested;
|
| 246 |
-
if (lastGrain.current === "sku") {
|
| 247 |
-
setMode(wanted ? "dashboard" : "grid");
|
| 248 |
-
dashboardRequested = false;
|
| 249 |
-
}
|
| 250 |
-
const panel = document.createElement("div");
|
| 251 |
-
panel.className = "ap-account-slot";
|
| 252 |
-
main.appendChild(panel);
|
| 253 |
-
setSlot(panel);
|
| 254 |
-
return () => { main.classList.remove("ap-profit-dashboard"); panel.remove(); };
|
| 255 |
-
}, [mainRef]);
|
| 256 |
-
|
| 257 |
-
useLayoutEffect(() => {
|
| 258 |
-
const main = anchor.current?.closest<HTMLElement>(".cg-main");
|
| 259 |
-
if (!main || !slot) return;
|
| 260 |
-
// A pending Dashboard request from another grain keeps "dashboard" until the SKU table arrives.
|
| 261 |
-
main.dataset.amazonProfitTab = dashboardOn || dashboardRequested ? "dashboard" : "grid";
|
| 262 |
-
main.classList.toggle("ap-profit-dashboard", dashboardOn);
|
| 263 |
-
slot.hidden = !dashboardOn;
|
| 264 |
-
return () => { main.classList.remove("ap-profit-dashboard"); };
|
| 265 |
-
}, [slot, dashboardOn]);
|
| 266 |
-
|
| 267 |
-
// Any grain switch, by a tab, the rail or the URL, opens that table's Grid. Only a pending
|
| 268 |
-
// Dashboard request opens the SKU dashboard on arrival.
|
| 269 |
-
useLayoutEffect(() => {
|
| 270 |
-
if (lastGrain.current === grain) return;
|
| 271 |
-
lastGrain.current = grain;
|
| 272 |
-
setMode(grain === "sku" && dashboardRequested ? "dashboard" : "grid");
|
| 273 |
-
if (grain === "sku") dashboardRequested = false;
|
| 274 |
-
}, [grain]);
|
| 275 |
-
|
| 276 |
-
const openTable = (table: string) => {
|
| 277 |
-
if (!onOpenTable) openCommandCenterTable(table);
|
| 278 |
-
else if (table !== GRAIN_TABLE[grain]) onOpenTable(table);
|
| 279 |
-
};
|
| 280 |
-
|
| 281 |
-
const chooseTab = (next: AccountTab) => {
|
| 282 |
-
if (next !== "dashboard") {
|
| 283 |
-
dashboardRequested = false;
|
| 284 |
-
setMode("grid");
|
| 285 |
-
openTable(GRAIN_TABLE[next]);
|
| 286 |
-
return;
|
| 287 |
-
}
|
| 288 |
-
if (grain === "sku") {
|
| 289 |
-
setMode("dashboard");
|
| 290 |
-
return;
|
| 291 |
-
}
|
| 292 |
-
dashboardRequested = true;
|
| 293 |
-
if (mainRef.current) mainRef.current.dataset.amazonProfitTab = "dashboard";
|
| 294 |
-
openTable(AMAZON_PROFIT_TABLE);
|
| 295 |
-
};
|
| 296 |
-
|
| 297 |
-
// The Command Center App draws the Period select in its toolbar (AmazonPeriodSelect).
|
| 298 |
-
const showPeriod = !onOpenTable && !dashboardOn && hasPeriod(grain);
|
| 299 |
-
if (embedded) return <div className="ap-table-switcher" ref={anchor} hidden />;
|
| 300 |
-
return (
|
| 301 |
-
<div className="ap-table-switcher" ref={anchor}>
|
| 302 |
-
<AccountTabs tabs={COMMAND_CENTER_TABS}
|
| 303 |
-
activeTab={tab} onTabChange={chooseTab} components={shared.components} />
|
| 304 |
-
{tab === "dashboard" && slot && createPortal(loading
|
| 305 |
-
? <div className="ap-state" role="status" aria-label="Loading account figures"><span className="lp-spin lp-spin--lg" /></div>
|
| 306 |
-
: <AccountView initialPeriod={status?.period.key} periods={status?.periods}
|
| 307 |
-
components={shared.components} onSelectSku={onSelectSku} />, slot)}
|
| 308 |
-
{tab === "dashboard" && !slot && <p role="status">Dashboard unavailable</p>}
|
| 309 |
-
{showPeriod && status && <PeriodSelectField status={status} pending={pending} busy={busy}
|
| 310 |
-
choose={choose} />}
|
| 311 |
-
</div>
|
| 312 |
-
);
|
| 313 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
web/src/customer-grid/PendingEdits.css
DELETED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
.cg-pending-summary { flex: 0 0 auto; padding: 4px 12px; font-size: var(--lp-fs-sm); }
|
| 2 |
-
.cg-pending-tools, .cg-pending-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
|
| 3 |
-
.cg-pending-tools { justify-content: space-between; }
|
| 4 |
-
.cg-pending-list { margin: 0; padding-left: 24px; font-size: var(--lp-fs-sm); }
|
| 5 |
-
.cg-pending-list > li { padding: 16px 0; border-bottom: 1px solid var(--lp-line); }
|
| 6 |
-
.cg-pending-heading > span { color: var(--lp-muted); }
|
| 7 |
-
.cg-pending-heading strong { color: var(--lp-ink); font-weight: var(--lp-fw-semibold); font-variant-numeric: tabular-nums; }
|
| 8 |
-
.cg-pending-change { margin-top: 8px; }
|
| 9 |
-
.cg-pending-change > span:first-child { color: var(--lp-muted); }
|
| 10 |
-
.cg-pending-change pre { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--lp-ink); font: inherit; font-variant-numeric: tabular-nums; }
|
| 11 |
-
.cg-pending-failure { color: var(--lp-red-deep); }
|
| 12 |
-
.cg-pending-list p { margin: 8px 0 0; }
|
| 13 |
-
.cg-pending-heading .cg-save-retry:disabled { opacity: var(--lp-home-disabled-opacity); cursor: not-allowed; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
web/src/customer-grid/PendingEdits.tsx
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
import type { Field } from "./types";
|
| 2 |
-
|
| 3 |
-
/** The toolbar's SaveState owns scoped feedback without adding a Table notice row. */
|
| 4 |
-
export default function PendingEdits(_props: { scope: string; fields: readonly Field[] }) {
|
| 5 |
-
return null;
|
| 6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|