@attabot/complaint-app 1.0.14 → 1.0.16

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.
package/README.md CHANGED
@@ -157,3 +157,20 @@ npm run build # emit dist/ for publishing
157
157
  ## License
158
158
 
159
159
  MIT
160
+
161
+ ### Parent-owned catalogs
162
+
163
+ Pass `roleList` and `storeList` from the parent application (for example, its Redux selectors). Each entry has an `id` and a `name` or `label`. The parent loads these catalogs; the package uses roles in category/workflow selectors and stores in Store ID controls in the complaint form and preview. Updates to the props are reflected on rerender. Store controls submit IDs. Complaint types, workflows, fields, statuses, and complaint submissions continue using the complaint API.
164
+
165
+ ```jsx
166
+ <ComplaintApp apiUrl={complaintApiUrl} authToken={token}
167
+ roleList={roleList} storeList={storeList} useDemoData={false} />
168
+ ```
169
+
170
+ The legacy `rolelist` prop remains an alias; `roleList` takes precedence. Missing roles default to an empty list. If `storeList` is omitted, Store ID fields retain their API-defined controls/options; an explicitly supplied empty array renders an empty store selector. The package keeps its own Redux provider unless an explicit `store` is supplied.
171
+
172
+ ### Company context
173
+
174
+ Pass the parent company object using `company={company}`. The package forwards it with page props and synchronizes it to `state.appDetails.details.company`, so nested components can read it through the existing package Redux provider. Parent updates replace the company object; passing `null` clears it. The package does not fetch company details.
175
+
176
+ Visible location labels use `company.level4` (for example, `Branch ID` and `Select Branch`). Missing or blank names fall back to `Store`. Field keys, IDs, saved data, and dependency values retain their original values.