@genesislcap/ai-assistant 15.70.0 → 15.71.0-FUI-2650.1
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/dist/ai-assistant.api.json +97 -0
- package/dist/ai-assistant.d.ts +65 -0
- package/dist/chat-driver.cjs +18031 -0
- package/dist/chat-driver.cjs.map +4 -4
- package/dist/chat-driver.mjs +18024 -0
- package/dist/chat-driver.mjs.map +4 -4
- package/dist/custom-elements.json +9287 -6447
- package/dist/dts/chat-driver-node.d.ts +2 -0
- package/dist/dts/chat-driver-node.d.ts.map +1 -1
- package/dist/dts/code-review/code-review.types.d.ts +76 -0
- package/dist/dts/code-review/code-review.types.d.ts.map +1 -0
- package/dist/dts/code-review/code-reviewer.agent.d.ts +77 -0
- package/dist/dts/code-review/code-reviewer.agent.d.ts.map +1 -0
- package/dist/dts/code-review/code-reviewer.prompt.d.ts +23 -0
- package/dist/dts/code-review/code-reviewer.prompt.d.ts.map +1 -0
- package/dist/dts/code-review/gate.d.ts +44 -0
- package/dist/dts/code-review/gate.d.ts.map +1 -0
- package/dist/dts/code-review/index.d.ts +27 -0
- package/dist/dts/code-review/index.d.ts.map +1 -0
- package/dist/dts/code-review/review-changes.d.ts +70 -0
- package/dist/dts/code-review/review-changes.d.ts.map +1 -0
- package/dist/dts/code-review/rules/context-trigger-map.d.ts +6 -0
- package/dist/dts/code-review/rules/context-trigger-map.d.ts.map +1 -0
- package/dist/dts/code-review/rules/context.registry.d.ts +123 -0
- package/dist/dts/code-review/rules/context.registry.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-ai-extensions.d.ts +13 -0
- package/dist/dts/code-review/rules/fui-ai-extensions.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-blotter.d.ts +16 -0
- package/dist/dts/code-review/rules/fui-blotter.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-chart.d.ts +20 -0
- package/dist/dts/code-review/rules/fui-chart.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-column-defs.d.ts +21 -0
- package/dist/dts/code-review/rules/fui-column-defs.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-components.d.ts +9 -0
- package/dist/dts/code-review/rules/fui-components.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-criteria.d.ts +32 -0
- package/dist/dts/code-review/rules/fui-criteria.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-custom-renderer.d.ts +15 -0
- package/dist/dts/code-review/rules/fui-custom-renderer.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-dashboard.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-dashboard.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-dialogs.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-dialogs.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-entity-management.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-entity-management.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-error-boundary.d.ts +9 -0
- package/dist/dts/code-review/rules/fui-error-boundary.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-eventing.d.ts +8 -0
- package/dist/dts/code-review/rules/fui-eventing.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-flexlayout.d.ts +17 -0
- package/dist/dts/code-review/rules/fui-flexlayout.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-flyout-panel.d.ts +10 -0
- package/dist/dts/code-review/rules/fui-flyout-panel.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-form-component.d.ts +9 -0
- package/dist/dts/code-review/rules/fui-form-component.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-formatters.d.ts +12 -0
- package/dist/dts/code-review/rules/fui-formatters.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-foundation-comms.d.ts +10 -0
- package/dist/dts/code-review/rules/fui-foundation-comms.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-global-filters.d.ts +33 -0
- package/dist/dts/code-review/rules/fui-global-filters.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-import-surface.d.ts +37 -0
- package/dist/dts/code-review/rules/fui-import-surface.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-inline-editing.d.ts +10 -0
- package/dist/dts/code-review/rules/fui-inline-editing.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-layout.d.ts +7 -0
- package/dist/dts/code-review/rules/fui-layout.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-notifications.d.ts +12 -0
- package/dist/dts/code-review/rules/fui-notifications.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-primitives.d.ts +26 -0
- package/dist/dts/code-review/rules/fui-primitives.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts +18 -0
- package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-redux-store.d.ts +8 -0
- package/dist/dts/code-review/rules/fui-redux-store.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-reporting.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-reporting.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-styling.d.ts +15 -0
- package/dist/dts/code-review/rules/fui-styling.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-trade-form.d.ts +13 -0
- package/dist/dts/code-review/rules/fui-trade-form.d.ts.map +1 -0
- package/dist/dts/code-review/submit-code-review.tool.d.ts +12 -0
- package/dist/dts/code-review/submit-code-review.tool.d.ts.map +1 -0
- package/dist/dts/code-review/unified-diff.d.ts +7 -0
- package/dist/dts/code-review/unified-diff.d.ts.map +1 -0
- package/dist/dts/code-review/verdict.d.ts +23 -0
- package/dist/dts/code-review/verdict.d.ts.map +1 -0
- package/dist/dts/components/code-review-result/code-review-result.d.ts +26 -0
- package/dist/dts/components/code-review-result/code-review-result.d.ts.map +1 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/react.d.ts +10 -0
- package/dist/esm/chat-driver-node.js +6 -0
- package/dist/esm/code-review/code-review.types.js +6 -0
- package/dist/esm/code-review/code-reviewer.agent.js +167 -0
- package/dist/esm/code-review/code-reviewer.prompt.js +103 -0
- package/dist/esm/code-review/gate.js +93 -0
- package/dist/esm/code-review/index.js +28 -0
- package/dist/esm/code-review/review-changes.js +123 -0
- package/dist/esm/code-review/rules/context-trigger-map.js +20 -0
- package/dist/esm/code-review/rules/context.registry.js +772 -0
- package/dist/esm/code-review/rules/fui-ai-extensions.js +306 -0
- package/dist/esm/code-review/rules/fui-blotter.js +596 -0
- package/dist/esm/code-review/rules/fui-chart.js +669 -0
- package/dist/esm/code-review/rules/fui-column-defs.js +862 -0
- package/dist/esm/code-review/rules/fui-components.js +245 -0
- package/dist/esm/code-review/rules/fui-criteria.js +538 -0
- package/dist/esm/code-review/rules/fui-custom-renderer.js +612 -0
- package/dist/esm/code-review/rules/fui-dashboard.js +604 -0
- package/dist/esm/code-review/rules/fui-dialogs.js +588 -0
- package/dist/esm/code-review/rules/fui-entity-management.js +1014 -0
- package/dist/esm/code-review/rules/fui-error-boundary.js +244 -0
- package/dist/esm/code-review/rules/fui-eventing.js +628 -0
- package/dist/esm/code-review/rules/fui-flexlayout.js +860 -0
- package/dist/esm/code-review/rules/fui-flyout-panel.js +432 -0
- package/dist/esm/code-review/rules/fui-form-component.js +898 -0
- package/dist/esm/code-review/rules/fui-formatters.js +415 -0
- package/dist/esm/code-review/rules/fui-foundation-comms.js +518 -0
- package/dist/esm/code-review/rules/fui-global-filters.js +778 -0
- package/dist/esm/code-review/rules/fui-import-surface.js +452 -0
- package/dist/esm/code-review/rules/fui-inline-editing.js +445 -0
- package/dist/esm/code-review/rules/fui-layout.js +431 -0
- package/dist/esm/code-review/rules/fui-notifications.js +439 -0
- package/dist/esm/code-review/rules/fui-primitives.js +1216 -0
- package/dist/esm/code-review/rules/fui-rapid-grid-pro.js +650 -0
- package/dist/esm/code-review/rules/fui-redux-store.js +522 -0
- package/dist/esm/code-review/rules/fui-reporting.js +506 -0
- package/dist/esm/code-review/rules/fui-styling.js +1229 -0
- package/dist/esm/code-review/rules/fui-trade-form.js +618 -0
- package/dist/esm/code-review/submit-code-review.tool.js +43 -0
- package/dist/esm/code-review/unified-diff.js +96 -0
- package/dist/esm/code-review/verdict.js +24 -0
- package/dist/esm/components/code-review-result/code-review-result.js +89 -0
- package/dist/esm/index.js +3 -0
- package/dist/react.cjs +7 -0
- package/dist/react.mjs +6 -0
- package/docs/code-review.md +137 -0
- package/package.json +24 -17
- package/scripts/smoke-chat-driver-node.mjs +15 -0
|
@@ -0,0 +1,650 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context: RapidGridPro — read-only/server-side grid from @genesislcap/rapid-grid-pro/react
|
|
3
|
+
*
|
|
4
|
+
* Sources verified against:
|
|
5
|
+
* - foundation-ds/rapid-grid-pro/dist/dts/react.d.ts (RapidGridPro, RapidGridProRef)
|
|
6
|
+
* - foundation-marketplace/grids/grid-pro/dist/dts/react.d.ts (GridProGenesisDatasource, GridProClientSideDatasource, GridProServerSideDatasource, GridProColumn, ref types, datasource events)
|
|
7
|
+
* - foundation-marketplace/grids/grid-pro/dist/dts/grid-pro.d.ts (GridPro class — all public props)
|
|
8
|
+
* - foundation-marketplace/grids/grid-pro/dist/dts/grid-pro.types.d.ts (GridProCaseType, GridProRendererTypes, GridProStatusBarConfig, GridOptionsConfig, etc.)
|
|
9
|
+
* - foundation-marketplace/grids/grid-pro/dist/dts/datasource/base.datasource.d.ts (GenesisGridDatasourceElement props)
|
|
10
|
+
* - foundation-marketplace/grids/grid-pro/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts
|
|
11
|
+
* - showcase react-client: ReactTypes.tsx, Home.tsx
|
|
12
|
+
* - sales-trader-hub: BlotterGrid.tsx
|
|
13
|
+
* - blank-app-seed templates: grid.hbs, component.hbs
|
|
14
|
+
*/
|
|
15
|
+
export const FUI_RAPID_GRID_PRO_DEPS = ['fui-column-defs'];
|
|
16
|
+
export const FUI_RAPID_GRID_PRO_TAGS = [
|
|
17
|
+
// technical / component names
|
|
18
|
+
'RapidGridPro',
|
|
19
|
+
'GridProGenesisDatasource',
|
|
20
|
+
'GridProClientSideDatasource',
|
|
21
|
+
'GridProServerSideDatasource',
|
|
22
|
+
'GridProColumn',
|
|
23
|
+
'GridProCaseType',
|
|
24
|
+
'GridProStatusBarConfig',
|
|
25
|
+
'GridOptionsConfig',
|
|
26
|
+
'grid-pro',
|
|
27
|
+
'rapid-grid-pro',
|
|
28
|
+
'RapidGrid',
|
|
29
|
+
'deferredGridOptions',
|
|
30
|
+
// user-facing phrases
|
|
31
|
+
'show a grid',
|
|
32
|
+
'display table',
|
|
33
|
+
'data grid',
|
|
34
|
+
'show trades',
|
|
35
|
+
'show positions',
|
|
36
|
+
'show blotter',
|
|
37
|
+
'trade blotter',
|
|
38
|
+
'display data',
|
|
39
|
+
'grid with data',
|
|
40
|
+
'live data grid',
|
|
41
|
+
'streaming grid',
|
|
42
|
+
'real-time grid',
|
|
43
|
+
'server-side grid',
|
|
44
|
+
'ag-grid',
|
|
45
|
+
'read-only grid',
|
|
46
|
+
'pagination',
|
|
47
|
+
'status bar',
|
|
48
|
+
'persist column state',
|
|
49
|
+
'filter model',
|
|
50
|
+
];
|
|
51
|
+
export const FUI_RAPID_GRID_PRO_CONTEXT = `
|
|
52
|
+
## RapidGridPro — Read-Only / Server-Side Grid
|
|
53
|
+
|
|
54
|
+
**Read react.d.ts BEFORE use:** VFS keys \`@genesislcap/rapid-grid-pro/react.d.ts\` (RapidGridPro component) and \`@genesislcap/grid-pro/react.d.ts\` (GridProGenesisDatasource, GridProClientSideDatasource, GridProServerSideDatasource, GridProColumn + all datasource events).
|
|
55
|
+
|
|
56
|
+
> **Docs:** \`https://docs.genesis.global/docs/develop/client-capabilities/grids/grid-pro/\`
|
|
57
|
+
|
|
58
|
+
### Import paths
|
|
59
|
+
|
|
60
|
+
\`\`\`tsx
|
|
61
|
+
// Grid component (Rapid Design System variant)
|
|
62
|
+
import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
|
|
63
|
+
import type { RapidGridProRef } from '@genesislcap/rapid-grid-pro/react';
|
|
64
|
+
|
|
65
|
+
// Datasource + column child components (from grid-pro, NOT rapid-grid-pro)
|
|
66
|
+
import { GridProGenesisDatasource, GridProClientSideDatasource, GridProColumn } from '@genesislcap/grid-pro/react';
|
|
67
|
+
import type { GridProColumnRef, GridProClientSideDatasourceRef, GridProGenesisDatasourceRef } from '@genesislcap/grid-pro/react';
|
|
68
|
+
|
|
69
|
+
// Types / enums — import from BASE PACKAGE ROOT, not /react
|
|
70
|
+
import { GridProCaseType, GridProRendererTypes } from '@genesislcap/grid-pro';
|
|
71
|
+
import type { GridProStatusBarConfig, GridOptionsConfig, GridProStatusBarLoadMoreConfig, GridProStatusBarReloadConfig } from '@genesislcap/grid-pro';
|
|
72
|
+
import type { ColDef, GridOptions, ValueFormatterParams, ColumnState } from '@ag-grid-community/core';
|
|
73
|
+
\`\`\`
|
|
74
|
+
|
|
75
|
+
### RapidGridPro — key props (verified from grid-pro.d.ts + rapid-grid-pro/react.d.ts)
|
|
76
|
+
|
|
77
|
+
| Prop | Type | Default | Description |
|
|
78
|
+
|------|------|---------|-------------|
|
|
79
|
+
| \`headerCaseType\` | \`GridProCaseType\` | — (unset → raw field name) | Auto-format column headers from field names. Valid values: \`camelCase\`, \`capitalCase\`, \`dotCase\`, \`headerCase\`, \`noCase\`, \`paramCase\`, \`pascalCase\`, \`pathCase\`, \`sentenceCase\`, \`snakeCase\` (there is NO \`CONSTANT_CASE\`). When unset, headers use the raw server field name |
|
|
80
|
+
| \`enableCellFlashing\` | \`boolean\` | \`false\` | Flash cells on data update |
|
|
81
|
+
| \`enableRowFlashing\` | \`boolean\` | \`false\` | Flash added rows (asyncAdd only) |
|
|
82
|
+
| \`asyncAdd\` | \`boolean\` | \`false\` | Use \`applyTransactionAsync\` for row adds |
|
|
83
|
+
| \`asyncUpdate\` | \`boolean\` | \`true\` | Use \`applyTransactionAsync\` for row updates |
|
|
84
|
+
| \`asyncRemove\` | \`boolean\` | \`false\` | Use \`applyTransactionAsync\` for row removes |
|
|
85
|
+
| \`gridAutosizingEnabled\` | \`boolean\` | \`false\` | Auto-fit columns to grid width on visibility change |
|
|
86
|
+
| \`sizeColumnsToContent\` | \`boolean\` | \`false\` | Auto-size columns to content width (calls \`autoSizeAllColumns\`) |
|
|
87
|
+
| \`sizeColumnsToFit\` | \`boolean\` | \`false\` | Size columns to fill available width (calls \`sizeColumnsToFit\`) |
|
|
88
|
+
| \`onlyTemplateColDefs\` | \`boolean\` | \`false\` | Only render \`GridProColumn\` children, ignore server schema columns |
|
|
89
|
+
| \`autoCellRendererByType\` | \`boolean\` | \`false\` | Auto-assign cellRenderer/cellEditor by server field type |
|
|
90
|
+
| \`persistColumnStateKey\` | \`string\` | — | Key for saving column state (width/order/visibility) to storage |
|
|
91
|
+
| \`persistFilterModelKey\` | \`string\` | — | Key for saving filter model to storage |
|
|
92
|
+
| \`withStatusBar\` | \`boolean\` | \`false\` | **DO NOT USE — not available.** Needs AG Grid \`StatusBarModule\` (Enterprise); the platform registers community modules only, so the status bar never renders. |
|
|
93
|
+
| \`statusBarConfig\` | \`GridProStatusBarConfig\` | — | **DO NOT USE — not available.** Only read when \`withStatusBar\` is set; inert without it. |
|
|
94
|
+
| \`pagination\` | \`boolean\` | \`false\` | Enable pagination |
|
|
95
|
+
| \`paginationPageSize\` | \`number\` | 25 | Page size when pagination is enabled |
|
|
96
|
+
| \`rowData\` | \`any[]\` | — | Set row data directly (no datasource child needed) |
|
|
97
|
+
| \`gridOptions\` | \`GridOptionsConfig\` | — | Pass AG Grid options at construction time (preferred for API-dependent options) |
|
|
98
|
+
| \`headerHeight\` | \`number\` | — | Override header row height |
|
|
99
|
+
| \`rowHeight\` | \`number\` | — | Override row height |
|
|
100
|
+
| \`defaultColumnConfig\` | \`ColDef[]\` | — | Default column state to restore to on \`deleteColumnState()\` |
|
|
101
|
+
| \`addIndex\` | \`number\` | — | Row index to insert new rows at |
|
|
102
|
+
| \`theme\` | \`string\` | — | Override the AG Grid theme class |
|
|
103
|
+
|
|
104
|
+
**onGridReady event** (from rapid-grid-pro/react.d.ts):
|
|
105
|
+
\`\`\`tsx
|
|
106
|
+
onGridReady?: (event: CustomEvent<unknown>) => void
|
|
107
|
+
\`\`\`
|
|
108
|
+
|
|
109
|
+
### GridProGenesisDatasource — key props (verified from base.datasource.d.ts + grid-pro-genesis-datasource.d.ts)
|
|
110
|
+
|
|
111
|
+
| Prop | Type | Default | Description |
|
|
112
|
+
|------|------|---------|-------------|
|
|
113
|
+
| \`resourceName\` | \`string\` | — | **Required.** An entity, view, Data Server query, or Request Server name — verify the exact one with \`query_project_schema\` before writing it |
|
|
114
|
+
| \`criteria\` | \`string\` | — | Groovy filter expression (active for subscription lifetime). Equality is \`==\`, never \`=\`. Building one from filter values (not just passing one through)? Read \`fui-criteria\` first — see "Building a criteria string from filter values" below, especially for DATE/DATETIME fields. |
|
|
115
|
+
| \`maxRows\` | \`number\` | 250 | Max rows in initial + MORE_ROWS messages |
|
|
116
|
+
| \`maxView\` | \`number\` | 1000 | Max rows tracked client-side (Data Server only) |
|
|
117
|
+
| \`orderBy\` | \`string\` | — | Data Server index to sort by |
|
|
118
|
+
| \`reverse\` | \`boolean\` | \`false\` | Reverse index iteration (Data Server only) |
|
|
119
|
+
| \`movingView\` | \`boolean\` | \`false\` | Discard oldest rows when maxView exceeded (Data Server only) |
|
|
120
|
+
| \`isSnapshot\` | \`boolean\` | \`false\` | Request snapshot (no live updates) |
|
|
121
|
+
| \`fields\` | \`string\` | — | Comma-separated field subset (Data Server only) |
|
|
122
|
+
| \`deferredGridOptions\` | \`GridOptions\` | — | AG Grid options merged at datasource init — **on datasource, NOT on RapidGridPro** |
|
|
123
|
+
| \`deferredColumnStates\` | \`ColumnState[]\` | — | Initial column state |
|
|
124
|
+
| \`rowDataMapper\` | \`Function\` | — | Transform row data before applying to grid |
|
|
125
|
+
| \`pollingInterval\` | \`number\` | 10000 | Polling interval ms (Request Server only) |
|
|
126
|
+
| \`disablePolling\` | \`boolean\` | \`false\` | Disable auto-polling (Request Server only) |
|
|
127
|
+
| \`requestAutoSetup\` | \`boolean\` | \`true\` | Auto-build the REQUEST object. **Set \`false\` whenever you pass \`criteria\`** — see DP below |
|
|
128
|
+
| \`request\` | \`any\` | — | Custom REQUEST object (Request Server only) |
|
|
129
|
+
| \`keepColDefsOnClearRowData\` | \`boolean\` | \`false\` | Preserve column defs when row data is cleared |
|
|
130
|
+
| \`restartOnReconnection\` | \`boolean\` | \`true\` | Restart datasource on reconnect |
|
|
131
|
+
|
|
132
|
+
**Datasource events** (verified from @genesislcap/grid-pro/react.d.ts — exact camelCase React prop names):
|
|
133
|
+
\`\`\`tsx
|
|
134
|
+
onBaseDatasourceError?: (event: CustomEvent<unknown>) => void // datasource error reported
|
|
135
|
+
onDatasourceError?: (event: CustomEvent<unknown>) => void // datasource error for grid
|
|
136
|
+
onBaseDatasourceConnected?: (event: CustomEvent<unknown>) => void // error cleared, reconnected
|
|
137
|
+
onDatasourceLoadingFinished?: (event: CustomEvent<unknown>) => void // transactions flushed with no row changes
|
|
138
|
+
onDatasourceNoDataAvailable?: (event: CustomEvent<unknown>) => void // load finished with empty rows
|
|
139
|
+
onDatasourceDataChanged?: (event: CustomEvent<unknown>) => void // row data changed from stream
|
|
140
|
+
onDatasourceDataLoaded?: (event: CustomEvent<unknown>) => void // data payload loaded
|
|
141
|
+
onDatasourceLoadingStarted?: (event: CustomEvent<unknown>) => void // load or refresh started
|
|
142
|
+
onDatasourceMoreDataAvailable?: (event: CustomEvent<unknown>) => void // more server rows available
|
|
143
|
+
onDatasourceSizeChanged?: (event: CustomEvent<unknown>) => void // row count / viewport changed
|
|
144
|
+
onMoreRowsChanged?: (event: CustomEvent<unknown>) => void // MORE_ROWS flag changed
|
|
145
|
+
onDatasourceReady?: (event: CustomEvent<unknown>) => void // host grid ready
|
|
146
|
+
onDatasourceInit?: (event: CustomEvent<unknown>) => void // initial data ready for CSRM
|
|
147
|
+
onDatasourceInitialize?: (event: CustomEvent<unknown>) => void // grid options hand-off
|
|
148
|
+
onDatasourceDestroy?: (event: CustomEvent<unknown>) => void // datasource torn down
|
|
149
|
+
onDatasourceDataCleared?: (event: CustomEvent<unknown>) => void // row data cleared
|
|
150
|
+
onDatasourceSchemaUpdated?: (event: CustomEvent<unknown>) => void // column metadata updated
|
|
151
|
+
onDatasourceFiltersRestored?: (event: CustomEvent<unknown>) => void // persisted filters reapplied
|
|
152
|
+
\`\`\`
|
|
153
|
+
|
|
154
|
+
> **Note:** \`onDatasourceConnected\` does NOT exist — use \`onBaseDatasourceConnected\` instead.
|
|
155
|
+
|
|
156
|
+
### GridProClientSideDatasource
|
|
157
|
+
|
|
158
|
+
Extends \`GridProGenesisDatasource\`. Use when you need the Client-Side Row Model (sorting, filtering, grouping all done client-side). Same props and events as \`GridProGenesisDatasource\`. Import from \`@genesislcap/grid-pro/react\`.
|
|
159
|
+
|
|
160
|
+
### GridProServerSideDatasource
|
|
161
|
+
|
|
162
|
+
Extends the base and adds server-side row model events:
|
|
163
|
+
\`\`\`tsx
|
|
164
|
+
onCacheFilterConfig?: (event: CustomEvent<unknown>) => void
|
|
165
|
+
onRefreshServerSide?: (event: CustomEvent<unknown>) => void
|
|
166
|
+
onSetServerSideDatasource?: (event: CustomEvent<unknown>) => void
|
|
167
|
+
onAddGridCssClass?: (event: CustomEvent<unknown>) => void
|
|
168
|
+
onRemoveGridCssClass?: (event: CustomEvent<unknown>) => void
|
|
169
|
+
onApplyServerSideTransaction?: (event: CustomEvent<unknown>) => void
|
|
170
|
+
\`\`\`
|
|
171
|
+
|
|
172
|
+
### GridProColumn
|
|
173
|
+
|
|
174
|
+
Renders a single column slot. Set the \`ColDef\` via a \`ref\` callback (preferred — avoids prop timing issues) or via the \`definition\` prop.
|
|
175
|
+
|
|
176
|
+
\`\`\`tsx
|
|
177
|
+
// Ref pattern (sales-trader-hub / showcase idiomatic)
|
|
178
|
+
{columnDefs.map((col) => (
|
|
179
|
+
<GridProColumn
|
|
180
|
+
key={col.field ?? col.headerName}
|
|
181
|
+
ref={(el: GridProColumnRef | null) => {
|
|
182
|
+
if (el) el.definition = col;
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
))}
|
|
186
|
+
\`\`\`
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
### Example 1 — Minimal live data grid (GenesisDatasource)
|
|
191
|
+
|
|
192
|
+
\`\`\`tsx
|
|
193
|
+
import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
|
|
194
|
+
import { GridProGenesisDatasource } from '@genesislcap/grid-pro/react';
|
|
195
|
+
import { GridProCaseType } from '@genesislcap/grid-pro';
|
|
196
|
+
|
|
197
|
+
export const TradeBlotter: React.FC = () => (
|
|
198
|
+
<RapidGridPro
|
|
199
|
+
headerCaseType={GridProCaseType.capitalCase}
|
|
200
|
+
enableRowFlashing
|
|
201
|
+
enableCellFlashing
|
|
202
|
+
asyncAdd
|
|
203
|
+
asyncUpdate
|
|
204
|
+
>
|
|
205
|
+
<GridProGenesisDatasource resourceName="ALL_TRADES" />
|
|
206
|
+
</RapidGridPro>
|
|
207
|
+
);
|
|
208
|
+
\`\`\`
|
|
209
|
+
|
|
210
|
+
### Example 2 — Grid with explicit column defs + column state persistence
|
|
211
|
+
|
|
212
|
+
\`\`\`tsx
|
|
213
|
+
import { useMemo } from 'react';
|
|
214
|
+
import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
|
|
215
|
+
import { GridProGenesisDatasource, GridProColumn } from '@genesislcap/grid-pro/react';
|
|
216
|
+
import type { GridProColumnRef } from '@genesislcap/grid-pro/react';
|
|
217
|
+
import { GridProCaseType } from '@genesislcap/grid-pro';
|
|
218
|
+
import type { ColDef } from '@ag-grid-community/core';
|
|
219
|
+
|
|
220
|
+
const COLUMN_DEFS: ColDef[] = [
|
|
221
|
+
{ field: 'TRADE_ID', headerName: 'Trade ID', width: 120 },
|
|
222
|
+
{ field: 'INSTRUMENT_NAME', headerName: 'Instrument', flex: 1 },
|
|
223
|
+
{ field: 'QUANTITY', headerName: 'Qty', type: 'numericColumn' },
|
|
224
|
+
{ field: 'PRICE', headerName: 'Price', type: 'numericColumn' },
|
|
225
|
+
];
|
|
226
|
+
|
|
227
|
+
export const TradeGrid: React.FC = () => {
|
|
228
|
+
const columnDefs = useMemo(() => COLUMN_DEFS, []);
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<RapidGridPro
|
|
232
|
+
headerCaseType={GridProCaseType.capitalCase}
|
|
233
|
+
onlyTemplateColDefs
|
|
234
|
+
enableRowFlashing
|
|
235
|
+
enableCellFlashing
|
|
236
|
+
persistColumnStateKey="trade-grid-columns"
|
|
237
|
+
persistFilterModelKey="trade-grid-filters"
|
|
238
|
+
gridAutosizingEnabled
|
|
239
|
+
>
|
|
240
|
+
<GridProGenesisDatasource resourceName="ALL_TRADES" maxRows={500} />
|
|
241
|
+
{columnDefs.map((col) => (
|
|
242
|
+
<GridProColumn
|
|
243
|
+
key={col.field ?? col.headerName}
|
|
244
|
+
ref={(el: GridProColumnRef | null) => {
|
|
245
|
+
if (el) el.definition = col;
|
|
246
|
+
}}
|
|
247
|
+
/>
|
|
248
|
+
))}
|
|
249
|
+
</RapidGridPro>
|
|
250
|
+
);
|
|
251
|
+
};
|
|
252
|
+
\`\`\`
|
|
253
|
+
|
|
254
|
+
### Example 3 — Pagination + ag-Grid options via gridOptions (showcase-verified pattern)
|
|
255
|
+
|
|
256
|
+
\`\`\`tsx
|
|
257
|
+
import { useMemo } from 'react';
|
|
258
|
+
import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
|
|
259
|
+
import { GridProClientSideDatasource } from '@genesislcap/grid-pro/react';
|
|
260
|
+
import { GridProCaseType } from '@genesislcap/grid-pro';
|
|
261
|
+
|
|
262
|
+
export const PaginatedGrid: React.FC = () => {
|
|
263
|
+
// ag-Grid API-dependent options belong in gridOptions for guaranteed
|
|
264
|
+
// construction-time application (showcase ReactTypes.tsx pattern).
|
|
265
|
+
const gridOptions = useMemo(
|
|
266
|
+
() => ({
|
|
267
|
+
suppressFieldDotNotation: true,
|
|
268
|
+
pagination: true,
|
|
269
|
+
paginationPageSize: 50,
|
|
270
|
+
rowSelection: 'single' as const,
|
|
271
|
+
}),
|
|
272
|
+
[],
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
return (
|
|
276
|
+
<RapidGridPro
|
|
277
|
+
headerCaseType={GridProCaseType.capitalCase}
|
|
278
|
+
gridAutosizingEnabled
|
|
279
|
+
enableCellFlashing
|
|
280
|
+
gridOptions={gridOptions as any}
|
|
281
|
+
onGridReady={(e: CustomEvent) => {
|
|
282
|
+
console.log('grid ready', e.detail);
|
|
283
|
+
}}
|
|
284
|
+
>
|
|
285
|
+
<GridProClientSideDatasource
|
|
286
|
+
resourceName="ALL_COUNTERPARTYS"
|
|
287
|
+
onDatasourceSizeChanged={(e: CustomEvent) => {
|
|
288
|
+
const detail: any = e.detail ?? e;
|
|
289
|
+
const size: number = detail?.size ?? detail?.rows ?? 0;
|
|
290
|
+
console.log('row count', size);
|
|
291
|
+
}}
|
|
292
|
+
/>
|
|
293
|
+
</RapidGridPro>
|
|
294
|
+
);
|
|
295
|
+
};
|
|
296
|
+
\`\`\`
|
|
297
|
+
|
|
298
|
+
### Example 4 — Cross-tile criteria filtering (Redux eventing pattern)
|
|
299
|
+
|
|
300
|
+
\`\`\`tsx
|
|
301
|
+
import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
|
|
302
|
+
import { GridProGenesisDatasource } from '@genesislcap/grid-pro/react';
|
|
303
|
+
import { GridProCaseType } from '@genesislcap/grid-pro';
|
|
304
|
+
import { useSelector } from 'react-redux';
|
|
305
|
+
import { selectors } from '../../../store/store';
|
|
306
|
+
|
|
307
|
+
export const FilteredTradeGrid: React.FC = () => {
|
|
308
|
+
// criteria string comes from Redux store (set by another tile via eventing)
|
|
309
|
+
const criteria = useSelector(selectors.eventing.getTradeCriteria);
|
|
310
|
+
|
|
311
|
+
return (
|
|
312
|
+
<RapidGridPro
|
|
313
|
+
headerCaseType={GridProCaseType.capitalCase}
|
|
314
|
+
enableCellFlashing
|
|
315
|
+
enableRowFlashing
|
|
316
|
+
>
|
|
317
|
+
<GridProGenesisDatasource
|
|
318
|
+
resourceName="ALL_TRADES"
|
|
319
|
+
criteria={criteria as any}
|
|
320
|
+
requestAutoSetup={false}
|
|
321
|
+
/>
|
|
322
|
+
</RapidGridPro>
|
|
323
|
+
);
|
|
324
|
+
};
|
|
325
|
+
\`\`\`
|
|
326
|
+
|
|
327
|
+
### Building a criteria string from filter values (not just passing one through)
|
|
328
|
+
|
|
329
|
+
Example 4 above assumes the criteria string already exists somewhere (built by another tile). The
|
|
330
|
+
moment YOU are the one turning raw filter values — a redux-selected currency, a DatePicker value —
|
|
331
|
+
into a criteria string, **read \`fui-criteria\` first** and use \`CriteriaBuilder\`/\`ExpressionBuilder\`,
|
|
332
|
+
not hand-written string concatenation. Two mistakes are common enough to call out here specifically:
|
|
333
|
+
|
|
334
|
+
\`\`\`tsx
|
|
335
|
+
// WRONG — \`=\` is assignment, not equality, in a Groovy criteria expression:
|
|
336
|
+
const clauses: string[] = [];
|
|
337
|
+
if (selectedCurrency) clauses.push(\`CURRENCY = '\${selectedCurrency}'\`);
|
|
338
|
+
if (selectedBusinessDate) clauses.push(\`BUSINESS_DATE = \${selectedBusinessDate}\`);
|
|
339
|
+
const criteria = clauses.join(' && ');
|
|
340
|
+
|
|
341
|
+
// STILL WRONG even with \`==\` fixed — a DATE/DATETIME field's real server type is a datetime
|
|
342
|
+
// object, not a number. Comparing it to a raw epoch-millis value with \`==\` NEVER matches (no
|
|
343
|
+
// exception, no coercion — it silently evaluates false), regardless of which epoch-millis value
|
|
344
|
+
// you pass:
|
|
345
|
+
if (selectedBusinessDate) clauses.push(\`BUSINESS_DATE == \${selectedBusinessDate}\`);
|
|
346
|
+
|
|
347
|
+
// CORRECT — CriteriaBuilder, and Serialisers.dateIsEqual for the date field specifically. Its
|
|
348
|
+
// value must be a STRING in exactly \`yyyyMMdd\` — not epoch millis, not ISO ("2026-08-31"):
|
|
349
|
+
import { CriteriaBuilder, ExpressionBuilder, Serialisers, Join } from '@genesislcap/foundation-criteria';
|
|
350
|
+
|
|
351
|
+
function toYyyyMmDd(epochMillis: number): string {
|
|
352
|
+
const d = new Date(epochMillis);
|
|
353
|
+
const yyyy = d.getFullYear();
|
|
354
|
+
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
|
355
|
+
const dd = String(d.getDate()).padStart(2, '0');
|
|
356
|
+
return \`\${yyyy}\${mm}\${dd}\`;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const builder = new CriteriaBuilder();
|
|
360
|
+
if (selectedCurrency) {
|
|
361
|
+
builder.And(new ExpressionBuilder().withField('CURRENCY').withValue(selectedCurrency).withSerialiser(Serialisers.EQ).build());
|
|
362
|
+
}
|
|
363
|
+
if (selectedBusinessDate !== null) {
|
|
364
|
+
builder.And(new ExpressionBuilder().withField('BUSINESS_DATE').withValue(toYyyyMmDd(selectedBusinessDate)).withSerialiser(Serialisers.dateIsEqual).build());
|
|
365
|
+
}
|
|
366
|
+
const built = builder.build();
|
|
367
|
+
const criteria = built === '()' ? undefined : built; // empty guard — see fui-criteria
|
|
368
|
+
\`\`\`
|
|
369
|
+
|
|
370
|
+
This applies equally to \`GridProGenesisDatasource\`'s \`criteria\`, \`OptionsDatasource\`/
|
|
371
|
+
\`MultiselectDatasource\`'s \`criteria\`, and any other datasource's \`criteria\` prop — the rule is
|
|
372
|
+
about the server-side criteria grammar, not this specific component. See DP-8 below and
|
|
373
|
+
\`read_context('fui-criteria')\` for the full \`CriteriaBuilder\`/\`Serialisers\` reference (date
|
|
374
|
+
ranges, OR groups, the \`dateIsToday\`/\`dateTimeIsGreaterEqual\` family, etc.).
|
|
375
|
+
|
|
376
|
+
### Example 5 — The status bar is NOT available (do not use it)
|
|
377
|
+
|
|
378
|
+
\`\`\`tsx
|
|
379
|
+
// ✗ WRONG — renders nothing. Do not write this.
|
|
380
|
+
<RapidGridPro withStatusBar statusBarConfig={STATUS_BAR as any}>
|
|
381
|
+
\`\`\`
|
|
382
|
+
|
|
383
|
+
\`withStatusBar\` / \`statusBarConfig\` set AG Grid's \`statusBar\` grid option, which needs
|
|
384
|
+
\`StatusBarModule\` — an **AG Grid Enterprise** module. The platform registers community modules
|
|
385
|
+
only (\`ModuleRegistry.registerModules([CsvExportModule, ClientSideRowModelModule])\`), so the
|
|
386
|
+
props are accepted, nothing renders, and AG Grid logs a missing-module error. The props exist on
|
|
387
|
+
the component and in its types; that does not make them usable here.
|
|
388
|
+
|
|
389
|
+
**The same applies to every other AG Grid Enterprise feature** — \`sideBar\`, \`rowGroup\` /
|
|
390
|
+
\`pivot\`, \`masterDetail\`, \`enableRangeSelection\`, \`getContextMenuItems\`, \`treeData\`,
|
|
391
|
+
Set Filter, Excel Export. None of them work, for the same reason.
|
|
392
|
+
|
|
393
|
+
**Never** try to make them work by importing \`ag-grid-enterprise\` or calling
|
|
394
|
+
\`ModuleRegistry.registerModules([AllEnterpriseModule])\`. There is no licence, so the grid
|
|
395
|
+
renders a watermark and logs a licence error — worse than the feature simply being absent.
|
|
396
|
+
|
|
397
|
+
If the user explicitly asks for something a status bar would have given (a row count, a reload
|
|
398
|
+
button), build it as ordinary React beside the grid and drive it from your own state or the
|
|
399
|
+
datasource's events. Do not reach for the enterprise prop.
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
### Key rules (MUST follow)
|
|
404
|
+
|
|
405
|
+
1. **\`deferredGridOptions\` belongs on \`GridProGenesisDatasource\`**, NOT on \`RapidGridPro\`. Placing it on the grid component is a silent no-op — the datasource merges these options at init time.
|
|
406
|
+
|
|
407
|
+
2. **AG Grid API-dependent options (suppressFieldDotNotation, rowSelection, complex grouping…) MUST go inside \`gridOptions\`** passed as a prop to \`RapidGridPro\` rather than as individual top-level props. The \`gridOptions\` object is applied at construction time; individual props fire via setters which may race with AG Grid initialisation. \`pagination\` and \`paginationPageSize\` exist as direct props but passing them via \`gridOptions\` is the safer, showcase-verified pattern.
|
|
408
|
+
|
|
409
|
+
3. **\`resourceName\` is camelCase on the React wrapper**, not the kebab-case attribute \`resource-name\`. Always use camelCase props.
|
|
410
|
+
|
|
411
|
+
4. **\`GridProColumn\` DOM order = grid column order** (grid-pro reads slotted columns via \`querySelectorAll\` in document order). The datasource child is found anywhere among the children; convention is datasource first, columns after.
|
|
412
|
+
|
|
413
|
+
5. **\`resourceName\` must be a verified resource** — an entity, view, or query, whichever the project actually has. Call \`query_project_schema('entities')\` / \`('queries')\` to get valid names. Do not guess.
|
|
414
|
+
|
|
415
|
+
6. **For column definitions** with renderers, cell editors, or valueFormatters, see \`fui-column-defs\` and \`fui-inline-editing\` context modules.
|
|
416
|
+
|
|
417
|
+
7. **Use \`GridProClientSideDatasource\`** (not Genesis datasource) when you only need client-side row model and do not need server-side pagination/infinite scroll. Both share the same props and events.
|
|
418
|
+
|
|
419
|
+
8. **\`onlyTemplateColDefs\`** on \`RapidGridPro\`: when set, only \`GridProColumn\` children are rendered; server schema columns are suppressed. Use when you want full control over which columns appear.
|
|
420
|
+
|
|
421
|
+
9. **Wrap \`RapidGridPro\` in an error boundary** in production code — the AG Grid instance can throw on bad config. See \`fui-error-boundary\` context.
|
|
422
|
+
|
|
423
|
+
10. **\`useMemo\` for \`gridOptions\` and \`columnDefs\`** arrays — these are compared by reference. Inline object/array literals cause unnecessary grid re-initialisation on every render.
|
|
424
|
+
|
|
425
|
+
11. **\`onDatasourceConnected\` does NOT exist.** The correct event for reconnection is \`onBaseDatasourceConnected\`.
|
|
426
|
+
|
|
427
|
+
### Type imports summary
|
|
428
|
+
|
|
429
|
+
| Type | Import from |
|
|
430
|
+
|------|-------------|
|
|
431
|
+
| \`ColDef\`, \`GridOptions\`, \`ValueFormatterParams\`, \`ICellRendererParams\`, \`ColumnState\` | \`@ag-grid-community/core\` |
|
|
432
|
+
| \`GridProCaseType\`, \`GridProRendererTypes\` | \`@genesislcap/grid-pro\` (bare) |
|
|
433
|
+
| \`GridProStatusBarConfig\`, \`GridOptionsConfig\`, \`GridProStatusBarLoadMoreConfig\`, \`GridProStatusBarReloadConfig\` | \`@genesislcap/grid-pro\` (bare) |
|
|
434
|
+
| \`GridProColumnRef\`, \`GridProClientSideDatasourceRef\`, \`GridProGenesisDatasourceRef\` | \`@genesislcap/grid-pro/react\` |
|
|
435
|
+
| \`RapidGridProRef\` | \`@genesislcap/rapid-grid-pro/react\` |
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
### DANGEROUS PATTERNS
|
|
440
|
+
|
|
441
|
+
#### DP-1: \`deferredGridOptions\` on wrong element
|
|
442
|
+
|
|
443
|
+
\`\`\`tsx
|
|
444
|
+
// WRONG — deferredGridOptions on RapidGridPro is silently ignored:
|
|
445
|
+
<RapidGridPro deferredGridOptions={gridOptions}>
|
|
446
|
+
<GridProGenesisDatasource resourceName="ALL_TRADES" />
|
|
447
|
+
</RapidGridPro>
|
|
448
|
+
|
|
449
|
+
// CORRECT — deferredGridOptions belongs on the datasource:
|
|
450
|
+
<RapidGridPro>
|
|
451
|
+
<GridProGenesisDatasource
|
|
452
|
+
resourceName="ALL_TRADES"
|
|
453
|
+
deferredGridOptions={gridOptions}
|
|
454
|
+
/>
|
|
455
|
+
</RapidGridPro>
|
|
456
|
+
\`\`\`
|
|
457
|
+
|
|
458
|
+
#### DP-2: Inline object literal for gridOptions causes grid re-init on every render
|
|
459
|
+
|
|
460
|
+
\`\`\`tsx
|
|
461
|
+
// WRONG — new object on every render triggers grid re-init:
|
|
462
|
+
<RapidGridPro gridOptions={{ pagination: true, paginationPageSize: 25 }}>
|
|
463
|
+
...
|
|
464
|
+
</RapidGridPro>
|
|
465
|
+
|
|
466
|
+
// CORRECT — stable reference via useMemo:
|
|
467
|
+
const gridOptions = useMemo(() => ({ pagination: true, paginationPageSize: 25 }), []);
|
|
468
|
+
<RapidGridPro gridOptions={gridOptions as any}>
|
|
469
|
+
...
|
|
470
|
+
</RapidGridPro>
|
|
471
|
+
\`\`\`
|
|
472
|
+
|
|
473
|
+
#### DP-3: kebab-case attribute names in JSX
|
|
474
|
+
|
|
475
|
+
\`\`\`tsx
|
|
476
|
+
// WRONG — kebab-case is ignored by the React wrapper:
|
|
477
|
+
<GridProGenesisDatasource resource-name="ALL_TRADES" max-rows={500} />
|
|
478
|
+
|
|
479
|
+
// CORRECT — camelCase props:
|
|
480
|
+
<GridProGenesisDatasource resourceName="ALL_TRADES" maxRows={500} />
|
|
481
|
+
\`\`\`
|
|
482
|
+
|
|
483
|
+
#### DP-4: Expecting column order to come from ColDef arrays alone
|
|
484
|
+
|
|
485
|
+
\`\`\`tsx
|
|
486
|
+
// GridProColumn children are collected with querySelectorAll in DOM order —
|
|
487
|
+
// the JSX order of <GridProColumn> nodes IS the displayed column order.
|
|
488
|
+
// Reordering the columnDefs array is only effective because it reorders the JSX children.
|
|
489
|
+
<RapidGridPro>
|
|
490
|
+
<GridProGenesisDatasource resourceName="ALL_TRADES" />
|
|
491
|
+
{columnDefs.map((col) => (
|
|
492
|
+
<GridProColumn key={col.field} ref={(el: GridProColumnRef | null) => { if (el) el.definition = col; }} />
|
|
493
|
+
))}
|
|
494
|
+
</RapidGridPro>
|
|
495
|
+
\`\`\`
|
|
496
|
+
|
|
497
|
+
#### DP-5: Importing types from /react
|
|
498
|
+
|
|
499
|
+
\`\`\`tsx
|
|
500
|
+
// WRONG — enums and complex types are NOT in /react:
|
|
501
|
+
import { GridProCaseType } from '@genesislcap/grid-pro/react';
|
|
502
|
+
|
|
503
|
+
// CORRECT — types/enums come from the base package root:
|
|
504
|
+
import { GridProCaseType } from '@genesislcap/grid-pro';
|
|
505
|
+
\`\`\`
|
|
506
|
+
|
|
507
|
+
#### DP-6: Using deprecated \`enabledRowFlashing\`
|
|
508
|
+
|
|
509
|
+
\`\`\`tsx
|
|
510
|
+
// WRONG — deprecated alias (grid-pro.d.ts marks it @deprecated):
|
|
511
|
+
<RapidGridPro enabledRowFlashing>...
|
|
512
|
+
|
|
513
|
+
// CORRECT — use the current prop name:
|
|
514
|
+
<RapidGridPro enableRowFlashing>...
|
|
515
|
+
\`\`\`
|
|
516
|
+
|
|
517
|
+
#### DP-7: Using \`onDatasourceConnected\` (does not exist)
|
|
518
|
+
|
|
519
|
+
\`\`\`tsx
|
|
520
|
+
// WRONG — this event name is not in react.d.ts; handler will never fire:
|
|
521
|
+
<GridProGenesisDatasource
|
|
522
|
+
resourceName="ALL_TRADES"
|
|
523
|
+
onDatasourceConnected={handleReconnect}
|
|
524
|
+
/>
|
|
525
|
+
|
|
526
|
+
// CORRECT — the real reconnection event is onBaseDatasourceConnected:
|
|
527
|
+
<GridProGenesisDatasource
|
|
528
|
+
resourceName="ALL_TRADES"
|
|
529
|
+
onBaseDatasourceConnected={handleReconnect}
|
|
530
|
+
/>
|
|
531
|
+
\`\`\`
|
|
532
|
+
|
|
533
|
+
#### DP-8: Hand-built criteria string with \`=\` instead of \`==\`, or a bare comparison against a DATE/DATETIME field
|
|
534
|
+
|
|
535
|
+
A criteria string is compiled server-side as a Groovy expression against the resource's real
|
|
536
|
+
column types. Two silent (no exception, no empty-dropdown-style hint) failure shapes:
|
|
537
|
+
|
|
538
|
+
\`\`\`tsx
|
|
539
|
+
// WRONG — single \`=\` is assignment, not a valid comparison in this grammar:
|
|
540
|
+
criteria={\`CURRENCY = '\${selectedCurrency}'\`}
|
|
541
|
+
|
|
542
|
+
// WRONG — \`==\` fixes the operator, but BUSINESS_DATE's real server type is a datetime object;
|
|
543
|
+
// comparing it to a raw epoch-millis number with \`==\` always evaluates false, silently:
|
|
544
|
+
criteria={\`BUSINESS_DATE == \${selectedBusinessDate}\`}
|
|
545
|
+
|
|
546
|
+
// CORRECT — see "Building a criteria string from filter values" above:
|
|
547
|
+
criteria={new CriteriaBuilder()
|
|
548
|
+
.And(new ExpressionBuilder().withField('CURRENCY').withValue(selectedCurrency).withSerialiser(Serialisers.EQ).build())
|
|
549
|
+
.And(new ExpressionBuilder().withField('BUSINESS_DATE').withValue(toYyyyMmDd(selectedBusinessDate)).withSerialiser(Serialisers.dateIsEqual).build())
|
|
550
|
+
.build()}
|
|
551
|
+
\`\`\`
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
#### DP-9: Passing \`criteria\` without \`requestAutoSetup={false}\` — the filter silently does not apply
|
|
555
|
+
|
|
556
|
+
MEASURED (GENC-1575, margin-dashboard). The datasource below is exactly what was shipped, and the
|
|
557
|
+
criteria it builds is never applied:
|
|
558
|
+
|
|
559
|
+
\`\`\`tsx
|
|
560
|
+
// WRONG — no requestAutoSetup, so it defaults to TRUE:
|
|
561
|
+
<GridProGenesisDatasource
|
|
562
|
+
resourceName={TOTAL_MARGIN_SUMMARY_RESOURCE}
|
|
563
|
+
criteria={criteria}
|
|
564
|
+
/>
|
|
565
|
+
|
|
566
|
+
// CORRECT — the two always travel together:
|
|
567
|
+
<GridProGenesisDatasource
|
|
568
|
+
resourceName={TOTAL_MARGIN_SUMMARY_RESOURCE}
|
|
569
|
+
criteria={criteria}
|
|
570
|
+
requestAutoSetup={false}
|
|
571
|
+
/>
|
|
572
|
+
\`\`\`
|
|
573
|
+
|
|
574
|
+
\`requestAutoSetup\` does not mean "fetch automatically" — it decides whether the datasource builds
|
|
575
|
+
the \`REQUEST\` object for you. The \`true\` default comes from grid-pro's datasource ELEMENT
|
|
576
|
+
(\`base.datasource.ts\`: \`@attr({ attribute: 'request-auto-setup' }) requestAutoSetup = true\`), and on
|
|
577
|
+
a Request Server resource it is destructive to a filter, in \`foundation-comms\` \`datasource.js\`:
|
|
578
|
+
|
|
579
|
+
\`\`\`js
|
|
580
|
+
CRITERIA_MATCH: !this.options.requestAutoSetup ? DETAILS.CRITERIA_MATCH : undefined // dropped when true
|
|
581
|
+
buildRequestFields() { if (!this.options.requestAutoSetup) return {}; /* else criteriaToFields(criteria) */ }
|
|
582
|
+
\`\`\`
|
|
583
|
+
|
|
584
|
+
Your \`CRITERIA_MATCH\` is discarded and the criteria is rewritten into a \`REQUEST\` field object.
|
|
585
|
+
Nothing throws. The grid returns unfiltered or empty rows, and there is no error anywhere to trace
|
|
586
|
+
it back from — which is why this needs to be a habit, not a debugging step.
|
|
587
|
+
|
|
588
|
+
**Set it whenever you pass \`criteria\`, without checking the resource type first.** The flag is only
|
|
589
|
+
ever read on the REQUEST_SERVER path, so on a Data Server resource it is an inert no-op — there is
|
|
590
|
+
no case where adding it is wrong. \`blank-app-seed\` sets \`requestAutoSetup: false\` for every
|
|
591
|
+
request/reply tile it generates (\`.genx/templates/react/component/component.hbs\`), so this keeps
|
|
592
|
+
hand-written grids consistent with the generated baseline — though the seed is not a complete
|
|
593
|
+
safety net either: \`grid.hbs\` gates \`criteria\` on \`eventing.listener\` but \`requestAutoSetup\` on
|
|
594
|
+
\`reqrep\`, so a listener-criteria tile that is not reqrep emits the same broken shape.
|
|
595
|
+
|
|
596
|
+
The same applies to the object form: \`datasourceConfig={{ criteria, requestAutoSetup: false }}\`.
|
|
597
|
+
|
|
598
|
+
---
|
|
599
|
+
|
|
600
|
+
---
|
|
601
|
+
|
|
602
|
+
## CONTAINER SIZING — adding ANY sibling next to a grid
|
|
603
|
+
|
|
604
|
+
A grid has **no intrinsic height**. It fills a sized container, so the moment you put something
|
|
605
|
+
beside it — a toolbar, a button, a filter bar, a heading — you have changed how that container
|
|
606
|
+
distributes space, and the grid is what loses.
|
|
607
|
+
|
|
608
|
+
This is the single most common way a working grid disappears: the user asks for "a button above
|
|
609
|
+
the grid", the button is added correctly, and the grid vanishes. Nothing about the grid itself
|
|
610
|
+
changed; its container stopped giving it height.
|
|
611
|
+
|
|
612
|
+
\`\`\`tsx
|
|
613
|
+
// WRONG — adding a sibling into a plain flex column collapses the grid.
|
|
614
|
+
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
|
|
615
|
+
<Button appearance="primary" onClick={openModal}>Run Daily Calcs</Button>
|
|
616
|
+
<TradeGrid /> {/* squeezed to 0 — or overflows the panel */}
|
|
617
|
+
</div>
|
|
618
|
+
|
|
619
|
+
// CORRECT — the sibling is fixed, the grid takes the rest, and minHeight: 0 lets it shrink.
|
|
620
|
+
// The strip is a plain flex div: Toolbar's internal positioning-region hardcodes
|
|
621
|
+
// justify-content: flex-start, so its buttons clamp to the left unless you add an outer rule.
|
|
622
|
+
// See fui-styling -> "action strip above a grid".
|
|
623
|
+
<div style={{ display: 'flex', flexDirection: 'column', height: '100%', minHeight: 0 }}>
|
|
624
|
+
<div style={{ flex: '0 0 auto', display: 'flex', justifyContent: 'flex-end',
|
|
625
|
+
gap: 'calc(var(--design-unit) * 2px)', padding: 'calc(var(--design-unit) * 2px)' }}>
|
|
626
|
+
<Button appearance="primary" onClick={openModal}>Run Daily Calcs</Button>
|
|
627
|
+
</div>
|
|
628
|
+
<div style={{ flex: 1, minHeight: 0 }}>
|
|
629
|
+
<TradeGrid /> {/* inner grid gets height: '100%' */}
|
|
630
|
+
</div>
|
|
631
|
+
</div>
|
|
632
|
+
\`\`\`
|
|
633
|
+
|
|
634
|
+
(\`Button\` and \`Toolbar\` come from \`@genesislcap/rapid-design-system/react\` — never a raw
|
|
635
|
+
\`<button>\`. The \`<div>\`s here are pure layout wrappers, which is the correct use for a div.)
|
|
636
|
+
|
|
637
|
+
**\`minHeight: 0\` is required, not optional.** A flex item defaults to \`min-height: auto\`, which
|
|
638
|
+
refuses to shrink below its content — so the grid either overflows its panel or is pushed to zero.
|
|
639
|
+
This is the rule people forget, because the layout looks correct until there is a second child.
|
|
640
|
+
|
|
641
|
+
### Verify it, do not assume it
|
|
642
|
+
|
|
643
|
+
After ANY edit that adds, wraps, or re-parents an element in a file that renders a grid — not only
|
|
644
|
+
when you write the grid itself — call \`get_preview_diagnostics\` and check BOTH:
|
|
645
|
+
|
|
646
|
+
1. \`agGridInstances[*].hasZeroHeight\` is \`false\`; and
|
|
647
|
+
2. the grid is **still present at all**. A grid that failed to render produces NO entry in
|
|
648
|
+
\`agGridInstances\`, so an empty list reads exactly like "this page has no grids". If the page had
|
|
649
|
+
a grid before your edit and reports none after, you removed it — fix that before \`file_done\`.
|
|
650
|
+
`.trim();
|