toga-ai 1.0.338 → 1.0.340
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ project: TOGa Commerce
|
|
|
6
6
|
client: shared
|
|
7
7
|
type: feature
|
|
8
8
|
status: active
|
|
9
|
-
updated: 2026-07-
|
|
9
|
+
updated: 2026-07-15
|
|
10
10
|
owners: ["apeterson", "tcox"]
|
|
11
11
|
files:
|
|
12
12
|
- src/fieldsConfig/index.ts
|
|
@@ -48,7 +48,8 @@ resolved per tenant, per language, and per role**. There are **two layers**:
|
|
|
48
48
|
{
|
|
49
49
|
"languageSwitcher": { "uuid": "1", "isEnabled": true|false },
|
|
50
50
|
"userApiFields": ["firstName", "lastName", "email", "uuid", "_isAdmin", ...],
|
|
51
|
-
"fetchUsersApiFields": ["firstName", "lastName", "email", "uuid", ...]
|
|
51
|
+
"fetchUsersApiFields": ["firstName", "lastName", "email", "uuid", ...],
|
|
52
|
+
"fetchUserApiFields": ["firstName", "lastName", "email", "uuid", "supervisorUser.uuid", ...]
|
|
52
53
|
}
|
|
53
54
|
```
|
|
54
55
|
|
|
@@ -65,12 +66,18 @@ resolved per tenant, per language, and per role**. There are **two layers**:
|
|
|
65
66
|
(`fetchUsers()` in `src/pages/Cart/api/CartApi.ts`, driven from `NavIconList.tsx`). Distinct from
|
|
66
67
|
`userApiFields` (which is the login fetch). COMPASS/COMPASSCANADA use the 14-field default list;
|
|
67
68
|
**QUAD uses an 8-field list that intentionally omits `supervisorUser.*`** (see gotcha).
|
|
69
|
+
- `fetchUserApiFields` — the allow-list of user columns fetched by the **singular detail fetch**
|
|
70
|
+
(`fetchUser()` in `src/pages/Cart/api/CartApi.ts`, driven from `NavIconList.tsx` and
|
|
71
|
+
`fetchUserByContactUuid()`). COMPASS/COMPASSCANADA use the 19-field default list;
|
|
72
|
+
**QUAD uses a 13-field list that — unlike the plural `fetchUsersApiFields` — *does* include
|
|
73
|
+
`supervisorUser.*`** (reporting-chain data comes from the detail fetch, not the search list;
|
|
74
|
+
see gotcha).
|
|
68
75
|
|
|
69
76
|
Resolved by **`src/fieldsConfig/getClientLoginFields.ts`** — a `switch(client)` returning the JSON;
|
|
70
77
|
**default is `COMPASS`** (not DEFAULT). Called from `AuthContext` as `getClientLoginFields(host)`.
|
|
71
78
|
The `languageSwitcher.isEnabled` value feeds the login-settings branch in `getLoginSettings.ts`.
|
|
72
79
|
|
|
73
|
-
### `fetchUsersApiFields` and the config-driven
|
|
80
|
+
### `fetchUsersApiFields` / `fetchUserApiFields` and the config-driven Cart fetches (C6)
|
|
74
81
|
|
|
75
82
|
`fetchUsers()` in `src/pages/Cart/api/CartApi.ts` no longer hardcodes its field list. It resolves it
|
|
76
83
|
via `getClientLoginFields(fieldKey ?? "").fetchUsersApiFields`, replacing a former
|
|
@@ -82,9 +89,25 @@ tenant JSONs are **statically imported**, a tenant missing `fetchUsersApiFields`
|
|
|
82
89
|
compile error — not a silent empty fetch — so the list is client-editable via config without
|
|
83
90
|
touching Cart code.
|
|
84
91
|
|
|
85
|
-
**
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
**Singular `fetchUser()` — same treatment (TRUE-80016).** `fetchUser()` (the detail fetch, same
|
|
93
|
+
`CartApi.ts`) now hoists its default field list from config too:
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
const fields = singleUserFields ?? getClientLoginFields(fieldKey).fetchUserApiFields;
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The former hardcoded default lists moved byte-for-byte into `fetchUserApiFields` in each tenant JSON
|
|
100
|
+
(COMPASS/COMPASSCANADA = the old 19-field default; QUAD = the old 13-field list). Precedence is
|
|
101
|
+
preserved: a caller-supplied **`singleUserFields`** override (Layer B `fields?.getSingleUserFields?.fields`,
|
|
102
|
+
passed by `useEditOrderViewModel.ts` and `useEditCartViewModel.ts`) still wins; `NavIconList.tsx` and
|
|
103
|
+
`fetchUserByContactUuid()` take the config defaults.
|
|
104
|
+
|
|
105
|
+
Unlike `fetchUsers`, the `fieldKey === "QUAD"` vs default **branch was retained** — it encodes
|
|
106
|
+
genuine behavior differences beyond the field list: the default branch uses `depth: 5` and enriches
|
|
107
|
+
the result with `fetchCostCenter()` (cost-center name); the QUAD branch does neither. Only the field
|
|
108
|
+
*lists* were externalized to config; the structural difference stays in code. Naming convention now
|
|
109
|
+
established: **`fetch<X>ApiFields` in `clientFields/<TENANT>.json` mirrors the CartApi function name**
|
|
110
|
+
(`fetchUsers` → `fetchUsersApiFields`, `fetchUser` → `fetchUserApiFields`).
|
|
88
111
|
|
|
89
112
|
### `userApiFields` and the SAML post-auth fetch (`useAuthenticationFlow`)
|
|
90
113
|
|
|
@@ -232,6 +255,11 @@ Common field attributes: `uuid`, `label`, `valueKey` (path into the data object)
|
|
|
232
255
|
`fetchUser()` after selection. QUAD also uses the `_isGlobalAdmin`/`_isBuyer`/`_isItShopper` role
|
|
233
256
|
model, not the supervisor hierarchy. Aligning the two lists would smuggle a behavior change into a
|
|
234
257
|
refactor.
|
|
258
|
+
- **The two QUAD lists intentionally differ on `supervisorUser.*`.** QUAD's `fetchUserApiFields`
|
|
259
|
+
(singular detail fetch) **includes** `supervisorUser.*`, while its `fetchUsersApiFields` (plural
|
|
260
|
+
search list) **omits** them. This is the same fact from both directions: reporting-chain data is
|
|
261
|
+
loaded on the detail fetch, not the search list — so the asymmetry is correct, not a copy-paste
|
|
262
|
+
slip. Do not "reconcile" the two lists.
|
|
235
263
|
|
|
236
264
|
## Change history
|
|
237
265
|
- 2026-06-23 — Initial: documented the two-layer field system (global `clientFields/<TENANT>.json`
|
|
@@ -249,4 +277,13 @@ Common field attributes: `uuid`, `label`, `valueKey` (path into the data object)
|
|
|
249
277
|
TRUE-80015 `fetchUsers` refactor). All user-field lists now flow through config;
|
|
250
278
|
COMPASSCANADA now resolves its own JSON rather than the generic `else`. Behavior-identical, `tsc`
|
|
251
279
|
clean. (tcox)
|
|
280
|
+
- 2026-07-15 — Completed the `fetchUser()` follow-up (TRUE-80016): added a `fetchUserApiFields` key
|
|
281
|
+
to each tenant JSON (COMPASS/COMPASSCANADA = former 19-field default, QUAD = former 13-field list,
|
|
282
|
+
byte-for-byte) and made the singular detail fetch hoist `singleUserFields ??
|
|
283
|
+
getClientLoginFields(fieldKey).fetchUserApiFields`. Caller override precedence preserved; the
|
|
284
|
+
`fieldKey === "QUAD"` branch retained (it also gates `depth: 5` + `fetchCostCenter()` enrichment,
|
|
285
|
+
not just fields). Established the `fetch<X>ApiFields` ↔ CartApi-function naming convention. Intended
|
|
286
|
+
refactor-only, no behavior change — not yet verified with `tsc`. Landed standalone on branch
|
|
287
|
+
TRUE-80016 (not stacked on the unmerged TRUE-80015); whichever PR merges second takes minor "keep
|
|
288
|
+
both" conflicts on the shared import line and adjacent JSON keys. (tcox)
|
|
252
289
|
</content>
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
| Doc | Summary | Files |
|
|
4
4
|
|-----|---------|-------|
|
|
5
5
|
| [TOGa Supply (toga2-supply) Architecture](architecture.md) | `toga2-supply` is the **React + Vite frontend** for TOGa Supply — warehouse fulfillment tooling (shipment selection, fulfill & ship against carrier APIs, NetSui | toga2-supply/src/api/toga.ts, toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx |
|
|
6
|
-
| [Fulfill & Ship](features/fulfill-and-ship.md) | Fulfill & Ship lets a warehouse user select sales-order line items, enter serials, pick a carrier/method, and in one action: create the Item Fulfillment records | toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/view/components/forms/EditShipmentForm.tsx, toga2-supply/src/pages/EditShipment/view/components/SelectedShipmentItemsTable.tsx, toga2-supply/src/pages/EditShipment/view/helpers/ShipmentDetailsForm/renderEditShipmentFormInput.tsx, toga2-supply/src/pages/EditShipment/viewModel/FIELDS/DUMMYUPDATESHIPMENTFIELDS.json, toga2-supply/src/pages/EditShipment/view/modals/ReturnShippingModal.tsx, toga2-supply/src/components/ui/BaseInput/BaseInput.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/EditShipment/types.ts, toga2-supply/src/pages/Shipments/view/ShipmentsPage.tsx, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx, toga2-supply/src/pages/Shipments/api/ShipmentsApi.ts, toga2-supply/src/pages/Shipments/types.ts, toga2-supply/src/pages/FulfilledShipments/view/FulfilledShipmentsPage.tsx, toga2-supply/src/components/ui/CardTable/CardTable.tsx, toga2-supply/src/components/ui/CardTable/types.ts, toga2-supply/src/assets/pen-line.svg, _underscore/Model/Client/ItemFulfillment.php, _underscore/Trait/Netsuite/ItemFulfillment.php, _underscore/Component/Library/Carriers/Ups/Ups.php |
|
|
6
|
+
| [Fulfill & Ship](features/fulfill-and-ship.md) | Fulfill & Ship lets a warehouse user select sales-order line items, enter serials, pick a carrier/method, and in one action: create the Item Fulfillment records | toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/view/components/forms/EditShipmentForm.tsx, toga2-supply/src/pages/EditShipment/view/components/SelectedShipmentItemsTable.tsx, toga2-supply/src/pages/EditShipment/view/helpers/ShipmentDetailsForm/renderEditShipmentFormInput.tsx, toga2-supply/src/pages/EditShipment/viewModel/FIELDS/DUMMYUPDATESHIPMENTFIELDS.json, toga2-supply/src/pages/EditShipment/view/modals/ReturnShippingModal.tsx, toga2-supply/src/components/ui/BaseInput/BaseInput.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/formatShipmentData.ts, toga2-supply/src/pages/EditShipment/types.ts, toga2-supply/src/pages/Shipments/view/ShipmentsPage.tsx, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx, toga2-supply/src/pages/Shipments/api/ShipmentsApi.ts, toga2-supply/src/pages/Shipments/types.ts, toga2-supply/src/pages/FulfilledShipments/view/FulfilledShipmentsPage.tsx, toga2-supply/src/components/ui/CardTable/CardTable.tsx, toga2-supply/src/components/ui/CardTable/types.ts, toga2-supply/src/assets/pen-line.svg, _underscore/Model/Client/ItemFulfillment.php, _underscore/Trait/Netsuite/ItemFulfillment.php, _underscore/Component/Library/Carriers/Ups/Ups.php |
|
|
7
7
|
| [AWS Amplify Build & Deploy (non-prod environments)](workflows/amplify-build-and-deploy.md) | How `toga2-supply` (React + Vite) builds and deploys on **AWS Amplify**. | toga2-supply/amplify.yml, toga2-supply/.gitattributes, toga2-supply/.github/workflows/sync-stage-environments.yml, toga2-supply/.env.qc-security |
|
|
@@ -18,6 +18,7 @@ files:
|
|
|
18
18
|
- toga2-supply/src/pages/EditShipment/view/modals/ReturnShippingModal.tsx
|
|
19
19
|
- toga2-supply/src/components/ui/BaseInput/BaseInput.tsx
|
|
20
20
|
- toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts
|
|
21
|
+
- toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/formatShipmentData.ts
|
|
21
22
|
- toga2-supply/src/pages/EditShipment/types.ts
|
|
22
23
|
- toga2-supply/src/pages/Shipments/view/ShipmentsPage.tsx
|
|
23
24
|
- toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx
|
|
@@ -96,16 +97,20 @@ The New Shipment / Edit Shipment form is **config-driven**: fields come from
|
|
|
96
97
|
`viewModel/FIELDS/DUMMYUPDATESHIPMENTFIELDS.json`, are rendered by
|
|
97
98
|
`view/helpers/ShipmentDetailsForm/renderEditShipmentFormInput.tsx` through the shared
|
|
98
99
|
`EditShipmentForm.tsx`, and the individual inputs are `components/ui/BaseInput/BaseInput.tsx`
|
|
99
|
-
(text/currency) plus react-select (State/Country). To change field
|
|
100
|
-
required-ness, or ordering, edit the **config JSON**, not the component.
|
|
100
|
+
(text/currency) plus react-select (Carrier/State/Country/Signature Type). To change field
|
|
101
|
+
layout, labels, required-ness, or ordering, edit the **config JSON**, not the component.
|
|
102
|
+
**Every react-select field's form value is the whole option OBJECT `{uuid, name}`, never a
|
|
103
|
+
bare string** — see the gotcha below before wiring a new select field.
|
|
101
104
|
|
|
102
105
|
- **Create vs Edit are distinct entry points (decision — kept, not merged).** Select Items →
|
|
103
106
|
Next = create a **New Shipment**; the pending-shipments pencil = **edit** an existing draft.
|
|
104
107
|
They are deliberately NOT merged and there is no auto-load from Select Items, because a Sales
|
|
105
108
|
Order can have **multiple** shipments (partial fulfillment — Select Items shows
|
|
106
109
|
Ordered/Fulfilled/Committed per line), so "the saved shipment" is not singular and auto-loading
|
|
107
|
-
would be ambiguous. Page title
|
|
108
|
-
**"Edit Shipment"
|
|
110
|
+
would be ambiguous. Page title signals the mode: create = **"Update Info"**, edit =
|
|
111
|
+
**"Edit Shipment"**. (Title history: create was "Update Info" → briefly changed to
|
|
112
|
+
"New Shipment" → **reverted to "Update Info" 2026-07-14 (David flagged "New Shipment" as
|
|
113
|
+
wrong)**. If you're re-deriving the "right" create title, David's call is "Update Info".)
|
|
109
114
|
- **Fulfillment Location is READ-ONLY (decision — Eric, Exec Dir Services Ops, authoritative).**
|
|
110
115
|
Sourced from the Sales Order's location and shown display-only; the value must **not** change
|
|
111
116
|
in the tool — any change happens back at the SO. Implemented as `getAddress` fetching
|
|
@@ -256,6 +261,20 @@ the call 403s and returns no label.
|
|
|
256
261
|
`valueKey "addressee"` — the same key as the Address name — so both wrote to `addressee` and the
|
|
257
262
|
form showed the same value twice (e.g. "Eric" in both). Rebound Attention to `"attention"`. When a
|
|
258
263
|
config-driven field mirrors another field's value, suspect a duplicated `valueKey`.
|
|
264
|
+
- **Config-driven react-select values are the whole option OBJECT `{uuid, name}`, not a bare
|
|
265
|
+
string — string comparisons silently fail to persist.** `BaseInput`'s `onChange` calls
|
|
266
|
+
`field.onChange({uuid, name})` and its value resolution reads `field.value.uuid`; this is the
|
|
267
|
+
repo-wide shape for every select field (carrier/state/shippingMethod — e.g. `data.carrier.uuid`).
|
|
268
|
+
So **any code mapping a select value into a payload MUST read `data.<field>.uuid`**, and **any
|
|
269
|
+
rehydrate/reset MUST set the option OBJECT** (not a string) or the select renders blank on reopen.
|
|
270
|
+
*The Signature Type bug (2026-07):* the mapping compared `data.signatureType === "Required"` (object
|
|
271
|
+
vs string) → always `false` → `requiresSignature` stayed `undefined` → dropped from the PUT payload
|
|
272
|
+
→ never saved; and rehydrate set a bare string so the select showed blank when the shipment was
|
|
273
|
+
reopened. Fix: map on `data.signatureType?.uuid` (the `?.` tolerates the plain-string `useForm`
|
|
274
|
+
default) in **both** `formatShipmentData.ts` and `updateShipment` (`UpdateShipmentApi.ts`), and
|
|
275
|
+
rehydrate `signatureType` in `EditShipmentForm.tsx` to the option object `{uuid, name}` derived from
|
|
276
|
+
`trackingNumber.requiresSignature` (`true`→`{uuid:"Required",name:"Required"}`, `false`→Not Required,
|
|
277
|
+
`null`→None Specified). Reusable checklist for any NEW select field in these forms.
|
|
259
278
|
- **The `/shipments` list is PER-SALES-ORDER (open product decision, Eric to decide).**
|
|
260
279
|
`getShipments` filters by `SalesOrders.c_netsuiteInternalSalesOrderId = <internalId>`, so
|
|
261
280
|
`/shipments` with no `internalId` shows the empty state — the tool is a per-SO **punch-out**
|
|
@@ -283,8 +302,9 @@ the call 403s and returns no label.
|
|
|
283
302
|
- **Responsiveness (phase 2/3 — explicitly NOT in original scope per the 2026-02-27 Process Review
|
|
284
303
|
and 2026-05-20 Dev Sync).** David Mancol's Figma annotation **is** the spec: reduce the in-box
|
|
285
304
|
column count by 1 on narrower screens; flexible gaps that scale with screen size (min 2px, max
|
|
286
|
-
50px); may explore stacking. Owners: David Mancol (design) + Alexandra Peterson (phase 2/3).
|
|
287
|
-
|
|
305
|
+
50px); may explore stacking. Owners: David Mancol (design) + Alexandra Peterson (phase 2/3).
|
|
306
|
+
**Partly landed 2026-07-14:** the flexible-gap part of the spec now ships as a CSS
|
|
307
|
+
`clamp(2px,1vw,50px)` on the row gaps; column-count reduction and stacking are still open.
|
|
288
308
|
- **Reference 1/2 value wiring** — fields render but values aren't sourced/persisted; see the form
|
|
289
309
|
section (SO# vs internal id, PO# in NetSuite) before wiring.
|
|
290
310
|
- **Global-vs-per-SO Shipments list** — pending Eric's model decision; see the gotcha above.
|
|
@@ -325,6 +345,14 @@ not the base `_Model_Client_ItemFulfillment`. Tested with GroWrk; UPS support wa
|
|
|
325
345
|
for Compass and is not yet in prod.
|
|
326
346
|
|
|
327
347
|
## Change history
|
|
348
|
+
- 2026-07-14 — TRUE-79191 (commit `724d17c1a`): fixed **Signature Type** not saving/rehydrating —
|
|
349
|
+
documented the reusable **whole-object react-select** convention (`{uuid,name}`; map on `.uuid`,
|
|
350
|
+
rehydrate the object) as a gotcha; the string comparison `data.signatureType === "Required"`
|
|
351
|
+
silently dropped `requiresSignature` from the PUT. Corrected the create-mode **page title back to
|
|
352
|
+
"Update Info"** (David reverted the earlier "New Shipment"). Noted the flexible-gap part of David's
|
|
353
|
+
responsiveness spec now ships as `clamp(2px,1vw,50px)`. (Logo swap to TOGA Technology branding and
|
|
354
|
+
the Reference 1/2 placeholder-hint text were cosmetic — no doc change; Ref 1/2 semantics already
|
|
355
|
+
recorded.) (mhammontree)
|
|
328
356
|
- 2026-07-14 — TRUE-79191 (Figma-alignment pass on the config-driven New/Edit Shipment form):
|
|
329
357
|
fixed the **Attention** field writing to `addressee` (rebound to `attention`); Figma layout
|
|
330
358
|
(inline left address labels, residential checkbox below Country, carrier section as two vertical
|
package/package.json
CHANGED