@wix/auto-patterns 1.28.0 → 1.29.0
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/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +19 -58
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js +48 -0
- package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js +11 -7
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/cjs/components/ModalRenderer.js +1 -1
- package/dist/cjs/components/ModalRenderer.js.map +1 -1
- package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js +5 -0
- package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
- package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js +2 -2
- package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
- package/dist/cjs/hooks/useBaseSDK.js +1 -1
- package/dist/cjs/hooks/useBaseSDK.js.map +1 -1
- package/dist/cjs/hooks/useColumns.js +1 -1
- package/dist/cjs/hooks/useColumns.js.map +1 -1
- package/dist/cjs/hooks/useEmptyStates.js +1 -1
- package/dist/cjs/hooks/useEmptyStates.js.map +1 -1
- package/dist/cjs/hooks/useEntityPageHeaderTexts.js +2 -2
- package/dist/cjs/hooks/useEntityPageHeaderTexts.js.map +1 -1
- package/dist/cjs/hooks/useFilters.js +2 -2
- package/dist/cjs/hooks/useFilters.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js +2 -2
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/providers/{PatternsWizardOverridesContext.js → AutoPatternsOverridesContext.js} +14 -11
- package/dist/cjs/providers/AutoPatternsOverridesContext.js.map +1 -0
- package/dist/cjs/providers/SchemaContext.js +24 -7
- package/dist/cjs/providers/SchemaContext.js.map +1 -1
- package/dist/cjs/providers/index.js +4 -4
- package/dist/cjs/providers/index.js.map +1 -1
- package/dist/cjs/types/BaseSDK.js.map +1 -1
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/types.js.map +1 -1
- package/dist/cjs/utils/actions/resolveAction.js +2 -1
- package/dist/cjs/utils/actions/resolveAction.js.map +1 -1
- package/dist/cjs/utils/actions/types.js.map +1 -1
- package/dist/cjs/utils/vibe.js +11 -0
- package/dist/cjs/utils/vibe.js.map +1 -0
- package/dist/docs/action_cell.md +18 -8
- package/dist/docs/app_config_structure.md +36 -1
- package/dist/docs/app_context.md +45 -0
- package/dist/docs/auto-patterns-guide.md +180 -64
- package/dist/docs/bulk_actions.md +10 -5
- package/dist/docs/collection_page.md +1 -1
- package/dist/docs/collection_page_actions.md +16 -9
- package/dist/docs/custom_overrides.md +21 -21
- package/dist/docs/entity_page.md +10 -10
- package/dist/docs/entity_page_actions.md +11 -4
- package/dist/docs/index.md +4 -0
- package/dist/docs/installation.md +3 -3
- package/dist/docs/resolved_action.md +6 -2
- package/dist/docs/wix_fqdn_custom_data_source.md +2 -2
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +2 -25
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +2 -2
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js +29 -0
- package/dist/esm/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +2 -2
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +2 -2
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js +5 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/esm/components/ModalRenderer.js +2 -2
- package/dist/esm/components/ModalRenderer.js.map +1 -1
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js +4 -0
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
- package/dist/esm/hooks/useAutoPatternsOptimisticActions.js +2 -2
- package/dist/esm/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
- package/dist/esm/hooks/useBaseSDK.js +2 -2
- package/dist/esm/hooks/useBaseSDK.js.map +1 -1
- package/dist/esm/hooks/useColumns.js +2 -2
- package/dist/esm/hooks/useColumns.js.map +1 -1
- package/dist/esm/hooks/useEmptyStates.js +2 -2
- package/dist/esm/hooks/useEmptyStates.js.map +1 -1
- package/dist/esm/hooks/useEntityPageHeaderTexts.js +2 -2
- package/dist/esm/hooks/useEntityPageHeaderTexts.js.map +1 -1
- package/dist/esm/hooks/useFilters.js +2 -2
- package/dist/esm/hooks/useFilters.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +2 -2
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/providers/AutoPatternsOverridesContext.js +19 -0
- package/dist/esm/providers/AutoPatternsOverridesContext.js.map +1 -0
- package/dist/esm/providers/SchemaContext.js +23 -6
- package/dist/esm/providers/SchemaContext.js.map +1 -1
- package/dist/esm/providers/index.js +1 -1
- package/dist/esm/providers/index.js.map +1 -1
- package/dist/esm/types/BaseSDK.js.map +1 -1
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/types.js.map +1 -1
- package/dist/esm/utils/actions/resolveAction.js +2 -1
- package/dist/esm/utils/actions/resolveAction.js.map +1 -1
- package/dist/esm/utils/actions/types.js.map +1 -1
- package/dist/esm/utils/vibe.js +6 -0
- package/dist/esm/utils/vibe.js.map +1 -0
- package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.d.ts +3 -0
- package/dist/types/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsRoute/AutoPatternsRoutes.d.ts.map +1 -1
- package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts +2 -1
- package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/providers/{PatternsWizardOverridesContext.d.ts → AutoPatternsOverridesContext.d.ts} +12 -4
- package/dist/types/providers/AutoPatternsOverridesContext.d.ts.map +1 -0
- package/dist/types/providers/SchemaContext.d.ts.map +1 -1
- package/dist/types/providers/index.d.ts +1 -1
- package/dist/types/providers/index.d.ts.map +1 -1
- package/dist/types/types/BaseSDK.d.ts +2 -2
- package/dist/types/types/BaseSDK.d.ts.map +1 -1
- package/dist/types/types/actions/base.d.ts +1 -0
- package/dist/types/types/actions/base.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +7 -2
- package/dist/types/types/types.d.ts.map +1 -1
- package/dist/types/utils/actions/resolveAction.d.ts +1 -0
- package/dist/types/utils/actions/resolveAction.d.ts.map +1 -1
- package/dist/types/utils/actions/types.d.ts +1 -0
- package/dist/types/utils/actions/types.d.ts.map +1 -1
- package/dist/types/utils/vibe.d.ts +2 -0
- package/dist/types/utils/vibe.d.ts.map +1 -0
- package/package.json +6 -6
- package/dist/cjs/dataSourceAdapters/factory.js +0 -14
- package/dist/cjs/dataSourceAdapters/factory.js.map +0 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +0 -1
- package/dist/esm/dataSourceAdapters/factory.js +0 -10
- package/dist/esm/dataSourceAdapters/factory.js.map +0 -1
- package/dist/esm/providers/PatternsWizardOverridesContext.js +0 -15
- package/dist/esm/providers/PatternsWizardOverridesContext.js.map +0 -1
- package/dist/types/dataSourceAdapters/factory.d.ts +0 -3
- package/dist/types/dataSourceAdapters/factory.d.ts.map +0 -1
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +0 -1
|
@@ -78,6 +78,34 @@ It is configured using a TypeScript file conforming to the `AppConfig` interface
|
|
|
78
78
|
|
|
79
79
|
# AppConfig Structure
|
|
80
80
|
|
|
81
|
+
## ⚠️ CRITICAL REQUIREMENT: Mandatory `biName` Property
|
|
82
|
+
|
|
83
|
+
**Every action configuration in auto-patterns MUST include a `biName` property.** This is not optional - it's a mandatory requirement for all auto-patterns applications.
|
|
84
|
+
|
|
85
|
+
### Why `biName` is Mandatory:
|
|
86
|
+
- **Analytics Tracking**: Enables tracking of user interactions with actions
|
|
87
|
+
- **Feature Usage**: Helps understand which features are most/least used
|
|
88
|
+
- **User Behavior**: Provides insights into user workflows and preferences
|
|
89
|
+
- **Business Intelligence**: Supports data-driven decision making
|
|
90
|
+
- **A/B Testing**: Enables testing different action configurations
|
|
91
|
+
- **Compliance**: Required for proper application monitoring and reporting
|
|
92
|
+
|
|
93
|
+
### `biName` Requirements:
|
|
94
|
+
- **MUST be included** in every action configuration
|
|
95
|
+
- **Use descriptive, kebab-case naming** (e.g., "toggle-vaccination-action")
|
|
96
|
+
- **Must be unique** across the application
|
|
97
|
+
- **Follow the pattern**: `{action-purpose}-action`
|
|
98
|
+
|
|
99
|
+
### Example:
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"id": "toggleVaccination",
|
|
103
|
+
"type": "custom",
|
|
104
|
+
"label": "Toggle Vaccination",
|
|
105
|
+
"biName": "toggle-vaccination-action" // MANDATORY
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
81
109
|
## Configuration Rules
|
|
82
110
|
|
|
83
111
|
- **Configuration must come only from a TypeScript file** - never inline or from other sources
|
|
@@ -102,6 +130,8 @@ It is configured using a TypeScript file conforming to the `AppConfig` interface
|
|
|
102
130
|
- **Missing action type properties**: Not including `create`, `update`, `delete`, or `bulkDelete` properties when required by the action type
|
|
103
131
|
- **Including wrong action properties**: Adding properties from different action types in the same action configuration
|
|
104
132
|
- **Action type mismatches**: Using action cell types in collection actions, or bulk action types in regular actions
|
|
133
|
+
- **Missing `biName` property**: Every action configuration MUST include a `biName` property for analytics tracking
|
|
134
|
+
- **Generic `biName` values**: Using generic names like "action" or "button" instead of descriptive, kebab-case names
|
|
105
135
|
|
|
106
136
|
```ts
|
|
107
137
|
export interface AppConfig {
|
|
@@ -128,6 +158,7 @@ export interface AppConfig {
|
|
|
128
158
|
id: string; // Unique identifier for the action
|
|
129
159
|
type: 'create' | 'custom'; // Action type
|
|
130
160
|
label?: string; // Text displayed for the action
|
|
161
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
131
162
|
collection: {
|
|
132
163
|
collectionId: string; // ID of the Wix Data collection
|
|
133
164
|
entityTypeSource: 'cms' | 'custom'; // Data source type.
|
|
@@ -222,6 +253,7 @@ export interface AppConfig {
|
|
|
222
253
|
type: 'update' | 'delete' | 'custom'; // Action type
|
|
223
254
|
label?: string; // Text displayed for the action
|
|
224
255
|
skin?: string; // Visual appearance of the action button (see Action Button Skin Values section)
|
|
256
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
225
257
|
disabled?: boolean; // Whether the action is disabled
|
|
226
258
|
tooltip?: string; // Tooltip text shown on hover
|
|
227
259
|
update?: { // Required when type is 'update'
|
|
@@ -274,6 +306,7 @@ export interface AppConfig {
|
|
|
274
306
|
id: string; // Unique identifier for the bulk action
|
|
275
307
|
type: 'bulkDelete' | 'custom'; // Bulk action type
|
|
276
308
|
label?: string; // Text displayed for the action
|
|
309
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
277
310
|
bulkDelete?: { // Required when type is 'bulkDelete'
|
|
278
311
|
mode: 'modal'; // Currently only 'modal' is supported
|
|
279
312
|
modal: {
|
|
@@ -379,7 +412,7 @@ export interface AppConfig {
|
|
|
379
412
|
} |
|
|
380
413
|
{
|
|
381
414
|
type: 'custom'; // Component type for custom slot components
|
|
382
|
-
id: string; // Unique identifier that maps to a custom React component provided through
|
|
415
|
+
id: string; // Unique identifier that maps to a custom React component provided through AutoPatternsOverridesProvider slots
|
|
383
416
|
}
|
|
384
417
|
]; // End of components array
|
|
385
418
|
};
|
|
@@ -411,6 +444,7 @@ export interface AppConfig {
|
|
|
411
444
|
id: string;
|
|
412
445
|
type: 'create' | 'custom';
|
|
413
446
|
label?: string;
|
|
447
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
414
448
|
create?: { // Required when type is 'create'
|
|
415
449
|
mode: 'page';
|
|
416
450
|
page: {
|
|
@@ -433,6 +467,7 @@ export interface AppConfig {
|
|
|
433
467
|
id: string;
|
|
434
468
|
type: 'custom';
|
|
435
469
|
label?: string;
|
|
470
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
436
471
|
}[];
|
|
437
472
|
};
|
|
438
473
|
parentPageId?: string; // ID of the parent collection page
|
|
@@ -709,7 +744,7 @@ The `layout` array contains the rendering components for the collection. Each la
|
|
|
709
744
|
1. **Table Layout Item** (`type: 'Table'`):
|
|
710
745
|
* `table` field contains table-specific configuration
|
|
711
746
|
* Used for displaying collection in a **table view**
|
|
712
|
-
* Includes columns,
|
|
747
|
+
* Includes columns, bulkActionToolbar, etc.
|
|
713
748
|
|
|
714
749
|
2. **Grid Layout Item** (`type: 'Grid'`):
|
|
715
750
|
* `grid` field contains grid-specific configuration
|
|
@@ -774,7 +809,7 @@ In addition to these common properties, each action item must specify a `type` w
|
|
|
774
809
|
### 2. `type: "custom"`
|
|
775
810
|
* **Purpose**: Executes custom JavaScript logic defined in your application's overrides.
|
|
776
811
|
* **Details**:
|
|
777
|
-
* The `custom` object in the configuration is typically empty. The functionality is determined by a custom action resolver function that you implement and register in the `actions` section of your `
|
|
812
|
+
* The `custom` object in the configuration is typically empty. The functionality is determined by a custom action resolver function that you implement and register in the `actions` section of your `AutoPatternsOverridesProvider`. The `id` of this action item must exactly match the name (key) of the registered custom action resolver. The resolver will receive parameters including `collectionId`.
|
|
778
813
|
|
|
779
814
|
### 3. `type: "divider"`
|
|
780
815
|
* **Purpose**: Creates a visual separator between action groups in menus and lists.
|
|
@@ -863,6 +898,7 @@ Custom collection page actions execute JavaScript code that you define for colle
|
|
|
863
898
|
"id": "exportCollection", // MUST match the function name exactly
|
|
864
899
|
"type": "custom", // REQUIRED: Must be exactly "custom"
|
|
865
900
|
"label": "Export Collection", // Optional: Displayed text
|
|
901
|
+
"biName": "export-collection-action", // MANDATORY: Analytics tracking identifier
|
|
866
902
|
"collection": {
|
|
867
903
|
"collectionId": "WixPets",
|
|
868
904
|
"entityTypeSource": "cms"
|
|
@@ -870,7 +906,7 @@ Custom collection page actions execute JavaScript code that you define for colle
|
|
|
870
906
|
}
|
|
871
907
|
```
|
|
872
908
|
|
|
873
|
-
5. Register your action in the `
|
|
909
|
+
5. Register your action in the `AutoPatternsOverridesProvider`:
|
|
874
910
|
```typescript
|
|
875
911
|
import { useActions } from '../components/actions';
|
|
876
912
|
|
|
@@ -878,9 +914,9 @@ Custom collection page actions execute JavaScript code that you define for colle
|
|
|
878
914
|
const actions = useActions();
|
|
879
915
|
|
|
880
916
|
return (
|
|
881
|
-
<
|
|
917
|
+
<AutoPatternsOverridesProvider value={{ actions }}>
|
|
882
918
|
<AutoPatternsApp configuration={config} />
|
|
883
|
-
</
|
|
919
|
+
</AutoPatternsOverridesProvider>
|
|
884
920
|
);
|
|
885
921
|
}
|
|
886
922
|
```
|
|
@@ -952,6 +988,7 @@ export const handleRowClick: CustomActionCollectionPageActionOnRowClickResolver
|
|
|
952
988
|
|
|
953
989
|
// Your custom logic...
|
|
954
990
|
},
|
|
991
|
+
biName: 'view-details-action' // MANDATORY: For analytics tracking
|
|
955
992
|
};
|
|
956
993
|
};
|
|
957
994
|
```
|
|
@@ -987,6 +1024,7 @@ export const openSidePanel: CustomActionCollectionPageActionOnRowClickResolver =
|
|
|
987
1024
|
// Or use a modal service/context that you've set up
|
|
988
1025
|
// modalService.openSidePanel(item);
|
|
989
1026
|
},
|
|
1027
|
+
biName: 'open-side-panel-action' // MANDATORY: For analytics tracking
|
|
990
1028
|
};
|
|
991
1029
|
};
|
|
992
1030
|
```
|
|
@@ -1016,7 +1054,7 @@ export const useActions = () => {
|
|
|
1016
1054
|
}
|
|
1017
1055
|
```
|
|
1018
1056
|
|
|
1019
|
-
**Step 4: Register in `
|
|
1057
|
+
**Step 4: Register in `AutoPatternsOverridesProvider`**:
|
|
1020
1058
|
```typescript
|
|
1021
1059
|
import { useActions } from '../components/actions';
|
|
1022
1060
|
|
|
@@ -1024,9 +1062,9 @@ export default function YourPage() {
|
|
|
1024
1062
|
const actions = useActions();
|
|
1025
1063
|
|
|
1026
1064
|
return (
|
|
1027
|
-
<
|
|
1065
|
+
<AutoPatternsOverridesProvider value={{ actions }}>
|
|
1028
1066
|
<AutoPatternsApp configuration={config} />
|
|
1029
|
-
</
|
|
1067
|
+
</AutoPatternsOverridesProvider>
|
|
1030
1068
|
);
|
|
1031
1069
|
}
|
|
1032
1070
|
```
|
|
@@ -1063,6 +1101,7 @@ export const quickToggle: CustomActionCollectionPageActionOnRowClickResolver = (
|
|
|
1063
1101
|
})
|
|
1064
1102
|
});
|
|
1065
1103
|
},
|
|
1104
|
+
biName: 'quick-toggle-action' // MANDATORY: For analytics tracking
|
|
1066
1105
|
};
|
|
1067
1106
|
};
|
|
1068
1107
|
```
|
|
@@ -1086,7 +1125,7 @@ export const quickToggle: CustomActionCollectionPageActionOnRowClickResolver = (
|
|
|
1086
1125
|
- The implementation must use the `CustomActionCollectionPageActionOnRowClickResolver` type
|
|
1087
1126
|
- **Required Return Object**: Must return a `ResolvedAction` object - see [ResolvedAction Reference](./resolved_action.md)
|
|
1088
1127
|
- Access the clicked item's data through `actionParams.item`
|
|
1089
|
-
- The implementation must be exported as a named export and registered in your `
|
|
1128
|
+
- The implementation must be exported as a named export and registered in your `AutoPatternsOverridesProvider`
|
|
1090
1129
|
- When `onRowClick` is configured, the default navigation to entity page is completely disabled
|
|
1091
1130
|
- **Complete Setup Required**: You need to create the action file, export it in the index, and register it in the provider - missing any step will cause errors
|
|
1092
1131
|
|
|
@@ -1104,10 +1143,13 @@ export const quickToggle: CustomActionCollectionPageActionOnRowClickResolver = (
|
|
|
1104
1143
|
✓ Divider actions use `{ "type": "divider" }` format and require no additional properties.
|
|
1105
1144
|
✓ If `onRowClick` is configured in table layout, it must have a valid `id` and `type: "custom"`.
|
|
1106
1145
|
✓ **CRITICAL**: Custom row click actions must have corresponding implementations registered in the `actions` override - configuration without implementation will cause errors.
|
|
1107
|
-
✓ Custom row click action implementations must return
|
|
1146
|
+
✓ Custom row click action implementations must return a `ResolvedAction` object with `label`, `icon`, `onClick`, and `biName` properties - all are required. See [ResolvedAction Reference](./resolved_action.md) for complete field documentation.
|
|
1108
1147
|
✓ Custom row click action implementations must be exported as named exports and included in the actions index file.
|
|
1109
1148
|
✓ `onRowClick` is optional - when not configured, rows navigate to entity page by default.
|
|
1110
1149
|
✓ **IMPORTANT**: Configuring `onRowClick` completely disables default navigation - you must handle all row click logic in your custom implementation.
|
|
1150
|
+
✓ **MANDATORY**: Every action configuration MUST include a `biName` property for analytics tracking.
|
|
1151
|
+
✓ **MANDATORY**: `biName` must use descriptive, kebab-case naming (e.g., "export-collection-action").
|
|
1152
|
+
✓ **MANDATORY**: `biName` must be unique across the application and follow the pattern `{action-purpose}-action`.
|
|
1111
1153
|
|
|
1112
1154
|
---
|
|
1113
1155
|
|
|
@@ -1549,6 +1591,7 @@ Custom actions execute JavaScript code that you define. These actions receive pa
|
|
|
1549
1591
|
})
|
|
1550
1592
|
});
|
|
1551
1593
|
},
|
|
1594
|
+
biName: 'download-pet-details-action' // MANDATORY: For analytics tracking
|
|
1552
1595
|
};
|
|
1553
1596
|
};
|
|
1554
1597
|
```
|
|
@@ -1573,10 +1616,11 @@ Custom actions execute JavaScript code that you define. These actions receive pa
|
|
|
1573
1616
|
"id": "downloadPetDetails", // MUST match the function name exactly
|
|
1574
1617
|
"type": "custom", // REQUIRED: Must be exactly "custom"
|
|
1575
1618
|
"label": "Download Details", // Optional: Displayed text
|
|
1619
|
+
"biName": "download-pet-details-action" // MANDATORY: Analytics tracking identifier
|
|
1576
1620
|
}
|
|
1577
1621
|
```
|
|
1578
1622
|
|
|
1579
|
-
5. Register your action in the `
|
|
1623
|
+
5. Register your action in the `AutoPatternsOverridesProvider`:
|
|
1580
1624
|
```typescript
|
|
1581
1625
|
import { useActions } from '../components/actions';
|
|
1582
1626
|
|
|
@@ -1584,9 +1628,9 @@ Custom actions execute JavaScript code that you define. These actions receive pa
|
|
|
1584
1628
|
const actions = useActions();
|
|
1585
1629
|
|
|
1586
1630
|
return (
|
|
1587
|
-
<
|
|
1631
|
+
<AutoPatternsOverridesProvider value={{ actions }}>
|
|
1588
1632
|
<AutoPatternsApp configuration={config} />
|
|
1589
|
-
</
|
|
1633
|
+
</AutoPatternsOverridesProvider>
|
|
1590
1634
|
);
|
|
1591
1635
|
}
|
|
1592
1636
|
```
|
|
@@ -1601,13 +1645,21 @@ Custom actions execute JavaScript code that you define. These actions receive pa
|
|
|
1601
1645
|
|
|
1602
1646
|
1. `id` must:
|
|
1603
1647
|
- Match exactly the function name of the custom action implementation
|
|
1604
|
-
- Be registered in the `actions` property of your `
|
|
1648
|
+
- Be registered in the `actions` property of your `AutoPatternsOverridesProvider`
|
|
1605
1649
|
- Follow JavaScript identifier naming rules (camelCase recommended)
|
|
1606
1650
|
|
|
1607
|
-
2.
|
|
1608
|
-
-
|
|
1651
|
+
2. `biName` must:
|
|
1652
|
+
- Be included in every action configuration (MANDATORY)
|
|
1653
|
+
- Use descriptive, kebab-case naming (e.g., "download-pet-details-action")
|
|
1654
|
+
- Be unique across the application
|
|
1655
|
+
- Follow the pattern: `{action-purpose}-action`
|
|
1656
|
+
- Enable analytics tracking for user interactions
|
|
1657
|
+
|
|
1658
|
+
2. The implementation must return a `ResolvedAction` object with:
|
|
1659
|
+
- `label`: Text displayed for the action
|
|
1609
1660
|
- `icon`: An Icon component from "@wix/wix-ui-icons-common"
|
|
1610
1661
|
- `onClick`: Handler function for the action
|
|
1662
|
+
- `biName`: Business intelligence name for analytics tracking. Must match the `biName` in your action configuration (required)
|
|
1611
1663
|
- `hidden` (optional): Boolean to hide the action when true
|
|
1612
1664
|
|
|
1613
1665
|
3. The implementation must:
|
|
@@ -1643,13 +1695,13 @@ Follow this decision process when implementing ActionCell:
|
|
|
1643
1695
|
- Complex, full-entity edits → Use `mode: "page"` to navigate to entity page
|
|
1644
1696
|
|
|
1645
1697
|
6. **Custom Implementation**:
|
|
1646
|
-
- For `custom` actions, you must provide implementations in your code and register them with `
|
|
1698
|
+
- For `custom` actions, you must provide implementations in your code and register them with `AutoPatternsOverridesProvider`
|
|
1647
1699
|
|
|
1648
1700
|
### ActionCell Validation Checklist
|
|
1649
1701
|
|
|
1650
1702
|
AI agents should verify these requirements before generating ActionCell configurations:
|
|
1651
1703
|
|
|
1652
|
-
✓ ActionCell is placed
|
|
1704
|
+
✓ ActionCell is placed at the collection component level (`collectionPage.components[*].actionCell`) as a sibling to `collection`, `layout`, etc. — NOT inside `table` or `grid`
|
|
1653
1705
|
✓ Each action has a unique `id` and correct `type` value
|
|
1654
1706
|
✓ Each action type only includes its required field(s)
|
|
1655
1707
|
✓ Update page action refers to a valid entity page ID
|
|
@@ -1788,6 +1840,7 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
1788
1840
|
})
|
|
1789
1841
|
});
|
|
1790
1842
|
},
|
|
1843
|
+
biName: 'bulk-export-pets-action' // MANDATORY: For analytics tracking
|
|
1791
1844
|
};
|
|
1792
1845
|
};
|
|
1793
1846
|
```
|
|
@@ -1810,10 +1863,11 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
1810
1863
|
"id": "bulkExportPets", // MUST match the function name exactly
|
|
1811
1864
|
"type": "custom", // REQUIRED: Must be exactly "custom"
|
|
1812
1865
|
"label": "Export Selected", // Optional: Displayed text
|
|
1866
|
+
"biName": "bulk-export-pets-action" // MANDATORY: Analytics tracking identifier
|
|
1813
1867
|
}
|
|
1814
1868
|
```
|
|
1815
1869
|
|
|
1816
|
-
5. Register your action in the `
|
|
1870
|
+
5. Register your action in the `AutoPatternsOverridesProvider`:
|
|
1817
1871
|
```typescript
|
|
1818
1872
|
import { useActions } from '../components/actions';
|
|
1819
1873
|
|
|
@@ -1821,9 +1875,9 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
1821
1875
|
const actions = useActions();
|
|
1822
1876
|
|
|
1823
1877
|
return (
|
|
1824
|
-
<
|
|
1878
|
+
<AutoPatternsOverridesProvider value={{ actions }}>
|
|
1825
1879
|
<AutoPatternsApp configuration={config} />
|
|
1826
|
-
</
|
|
1880
|
+
</AutoPatternsOverridesProvider>
|
|
1827
1881
|
);
|
|
1828
1882
|
}
|
|
1829
1883
|
```
|
|
@@ -1840,7 +1894,7 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
1840
1894
|
|
|
1841
1895
|
1. `id` must:
|
|
1842
1896
|
- Match exactly the function name of the custom bulk action implementation
|
|
1843
|
-
- Be registered in the `actions` property of your `
|
|
1897
|
+
- Be registered in the `actions` property of your `AutoPatternsOverridesProvider`
|
|
1844
1898
|
- Follow JavaScript identifier naming rules (camelCase recommended)
|
|
1845
1899
|
|
|
1846
1900
|
2. The implementation must return a `ResolvedAction`:
|
|
@@ -1930,7 +1984,7 @@ Follow this decision process when implementing Bulk Action Toolbar:
|
|
|
1930
1984
|
- Less common bulk operations → Place in `secondaryActions` array
|
|
1931
1985
|
|
|
1932
1986
|
3. **Custom Implementation**:
|
|
1933
|
-
- For `custom` bulk actions, you must provide implementations in your code and register them with `
|
|
1987
|
+
- For `custom` bulk actions, you must provide implementations in your code and register them with `AutoPatternsOverridesProvider`
|
|
1934
1988
|
|
|
1935
1989
|
### Bulk Action Toolbar Validation Checklist
|
|
1936
1990
|
|
|
@@ -1945,6 +1999,9 @@ AI agents should verify these requirements before generating Bulk Action Toolbar
|
|
|
1945
1999
|
✓ Primary actions use `action`/`menu` structure with proper `action` or `menu` properties
|
|
1946
2000
|
✓ Secondary actions are an array that can include dividers
|
|
1947
2001
|
✓ Menu items within primary actions is array that can include dividers
|
|
2002
|
+
✓ **MANDATORY**: Every action configuration MUST include a `biName` property for analytics tracking
|
|
2003
|
+
✓ **MANDATORY**: `biName` must use descriptive, kebab-case naming (e.g., "bulk-export-pets-action")
|
|
2004
|
+
✓ **MANDATORY**: `biName` must be unique across the application and follow the pattern `bulk-{action}-action`
|
|
1948
2005
|
|
|
1949
2006
|
---
|
|
1950
2007
|
|
|
@@ -1972,7 +2029,7 @@ When a user asks to "add badges to the entity page", understand that they want:
|
|
|
1972
2029
|
1. **Custom component overrides** - NOT direct configuration in JSON
|
|
1973
2030
|
2. **Function that returns badge objects** - NOT JSX components
|
|
1974
2031
|
3. **Badge properties** like `text`, `skin`, `prefixIcon`, etc.
|
|
1975
|
-
4. **Registration in
|
|
2032
|
+
4. **Registration in AutoPatternsOverridesProvider** under `entityPageHeaderBadges`
|
|
1976
2033
|
|
|
1977
2034
|
**Example Request**: "Add 2 badges with random skins and text 'wow'"
|
|
1978
2035
|
**Correct Implementation**: Create a function that returns `[{text: 'wow', skin: 'success'}, {text: 'wow', skin: 'premium'}]`
|
|
@@ -2066,7 +2123,7 @@ const Index: FC = () => {
|
|
|
2066
2123
|
const entityPageHeaderSubtitle = useEntityPageHeaderSubtitle();
|
|
2067
2124
|
|
|
2068
2125
|
return (
|
|
2069
|
-
<
|
|
2126
|
+
<AutoPatternsOverridesProvider
|
|
2070
2127
|
value={{
|
|
2071
2128
|
// ... other overrides
|
|
2072
2129
|
entityPageHeaderSubtitle: {
|
|
@@ -2075,7 +2132,7 @@ const Index: FC = () => {
|
|
|
2075
2132
|
}}
|
|
2076
2133
|
>
|
|
2077
2134
|
<WixPetsPage />
|
|
2078
|
-
</
|
|
2135
|
+
</AutoPatternsOverridesProvider>
|
|
2079
2136
|
);
|
|
2080
2137
|
};
|
|
2081
2138
|
```
|
|
@@ -2126,16 +2183,16 @@ export const myFunction = (entity) => { ... }
|
|
|
2126
2183
|
|
|
2127
2184
|
### Integration
|
|
2128
2185
|
|
|
2129
|
-
Register your subtitle override in the `
|
|
2186
|
+
Register your subtitle override in the `AutoPatternsOverridesProvider`:
|
|
2130
2187
|
|
|
2131
2188
|
```typescript
|
|
2132
|
-
<
|
|
2189
|
+
<AutoPatternsOverridesProvider value={{
|
|
2133
2190
|
entityPageHeaderSubtitle: {
|
|
2134
2191
|
mySubtitleOverride,
|
|
2135
2192
|
},
|
|
2136
2193
|
}}>
|
|
2137
2194
|
<AutoPatternsApp configuration={config} />
|
|
2138
|
-
</
|
|
2195
|
+
</AutoPatternsOverridesProvider>
|
|
2139
2196
|
```
|
|
2140
2197
|
|
|
2141
2198
|
## Entity Page Dynamic Badges
|
|
@@ -2168,7 +2225,7 @@ When implementing badges for entity pages, understand these key points:
|
|
|
2168
2225
|
1. **Badges are CUSTOM COMPONENT OVERRIDES** - NOT direct configuration
|
|
2169
2226
|
2. **Badge function returns an ARRAY of badge objects** - NOT JSX components
|
|
2170
2227
|
3. **Each badge object has properties** like `text`, `skin`, `prefixIcon`, etc.
|
|
2171
|
-
4. **Must be registered in
|
|
2228
|
+
4. **Must be registered in AutoPatternsOverridesProvider** under `entityPageHeaderBadges`
|
|
2172
2229
|
|
|
2173
2230
|
### Complete Implementation Guide
|
|
2174
2231
|
|
|
@@ -2223,7 +2280,7 @@ const Index: FC = () => {
|
|
|
2223
2280
|
const entityPageHeaderBadges = useEntityPageHeaderBadges();
|
|
2224
2281
|
|
|
2225
2282
|
return (
|
|
2226
|
-
<
|
|
2283
|
+
<AutoPatternsOverridesProvider
|
|
2227
2284
|
value={{
|
|
2228
2285
|
// ... other overrides
|
|
2229
2286
|
entityPageHeaderSubtitle: {
|
|
@@ -2235,7 +2292,7 @@ const Index: FC = () => {
|
|
|
2235
2292
|
}}
|
|
2236
2293
|
>
|
|
2237
2294
|
<WixPetsPage />
|
|
2238
|
-
</
|
|
2295
|
+
</AutoPatternsOverridesProvider>
|
|
2239
2296
|
);
|
|
2240
2297
|
};
|
|
2241
2298
|
```
|
|
@@ -2277,7 +2334,7 @@ src/dashboard/
|
|
|
2277
2334
|
|
|
2278
2335
|
1. **❌ DON'T return JSX components** - Return badge objects instead
|
|
2279
2336
|
2. **❌ DON'T use direct configuration** - Use custom component overrides
|
|
2280
|
-
3. **❌ DON'T forget to register in
|
|
2337
|
+
3. **❌ DON'T forget to register in AutoPatternsOverridesProvider**
|
|
2281
2338
|
5. **❌ DON'T forget to export from index.ts** - Must export the function
|
|
2282
2339
|
|
|
2283
2340
|
|
|
@@ -2433,18 +2490,21 @@ Entity pages in **edit mode** support not only built-in actions (such as "Save"
|
|
|
2433
2490
|
{
|
|
2434
2491
|
"id": "sendEmail",
|
|
2435
2492
|
"type": "custom",
|
|
2436
|
-
"label": "Send Email"
|
|
2493
|
+
"label": "Send Email",
|
|
2494
|
+
"biName": "send-email-action"
|
|
2437
2495
|
},
|
|
2438
2496
|
{
|
|
2439
2497
|
"id": "exportData",
|
|
2440
2498
|
"type": "custom",
|
|
2441
|
-
"label": "Export Data"
|
|
2499
|
+
"label": "Export Data",
|
|
2500
|
+
"biName": "export-data-action"
|
|
2442
2501
|
},
|
|
2443
2502
|
{ "type": "divider" },
|
|
2444
2503
|
{
|
|
2445
2504
|
"id": "archiveEntity",
|
|
2446
2505
|
"type": "custom",
|
|
2447
|
-
"label": "Archive"
|
|
2506
|
+
"label": "Archive",
|
|
2507
|
+
"biName": "archive-entity-action"
|
|
2448
2508
|
}
|
|
2449
2509
|
]
|
|
2450
2510
|
}
|
|
@@ -2471,6 +2531,7 @@ export const myMoreAction: CustomEntityPageActionResolver = (params) => {
|
|
|
2471
2531
|
onClick: () => {
|
|
2472
2532
|
// Your custom logic here
|
|
2473
2533
|
},
|
|
2534
|
+
biName: 'my-more-action' // MANDATORY: For analytics tracking
|
|
2474
2535
|
};
|
|
2475
2536
|
};
|
|
2476
2537
|
```
|
|
@@ -2496,9 +2557,12 @@ export const myMoreAction: CustomEntityPageActionResolver = (params) => {
|
|
|
2496
2557
|
✓ Each action in `moreActions` has a unique `id` and correct `type` value
|
|
2497
2558
|
✓ Each action type only includes its required field(s)
|
|
2498
2559
|
✓ Custom actions match implementations in overrides
|
|
2499
|
-
✓ The resolver is exported and registered in the `actions` property of your `
|
|
2560
|
+
✓ The resolver is exported and registered in the `actions` property of your `AutoPatternsOverridesProvider`
|
|
2500
2561
|
✓ The function signature matches `CustomEntityPageActionResolver`
|
|
2501
2562
|
✓ The returned object is a `ResolvedAction` (see [ResolvedAction Reference](./resolved_action.md))
|
|
2563
|
+
✓ **MANDATORY**: Every action configuration MUST include a `biName` property for analytics tracking
|
|
2564
|
+
✓ **MANDATORY**: `biName` must use descriptive, kebab-case naming (e.g., "send-email-action")
|
|
2565
|
+
✓ **MANDATORY**: `biName` must be unique across the application and follow the pattern `{action-purpose}-action`
|
|
2502
2566
|
|
|
2503
2567
|
---
|
|
2504
2568
|
|
|
@@ -2668,6 +2732,7 @@ export interface ResolvedAction {
|
|
|
2668
2732
|
hidden?: boolean;
|
|
2669
2733
|
tooltip?: string;
|
|
2670
2734
|
skin?: string;
|
|
2735
|
+
biName?: string;
|
|
2671
2736
|
}
|
|
2672
2737
|
```
|
|
2673
2738
|
|
|
@@ -2678,6 +2743,7 @@ export interface ResolvedAction {
|
|
|
2678
2743
|
- **`label`** (string): Text displayed in the button or menu item.
|
|
2679
2744
|
- **`icon`** (IconElement): An icon component, typically from `@wix/wix-ui-icons-common`. Example: `icon: <Delete />`.
|
|
2680
2745
|
- **`onClick`** (function): Handler function invoked when the user triggers the action. Can be async.
|
|
2746
|
+
- **`biName`** (string): Business intelligence name for analytics tracking. Used to identify the action in analytics and reporting systems. The value should match the `biName` specified in your action configuration.
|
|
2681
2747
|
|
|
2682
2748
|
### Optional Fields
|
|
2683
2749
|
|
|
@@ -2701,7 +2767,8 @@ return {
|
|
|
2701
2767
|
icon: <Add />,
|
|
2702
2768
|
onClick: () => {
|
|
2703
2769
|
// Your action logic here
|
|
2704
|
-
}
|
|
2770
|
+
},
|
|
2771
|
+
biName: 'create-action' // MANDATORY: For analytics tracking
|
|
2705
2772
|
};
|
|
2706
2773
|
```
|
|
2707
2774
|
|
|
@@ -2724,7 +2791,8 @@ return {
|
|
|
2724
2791
|
disabled: total === 0,
|
|
2725
2792
|
tooltip: total === 0 ? 'Select at least one item to export' : undefined,
|
|
2726
2793
|
hidden: !userHasExportPermission,
|
|
2727
|
-
skin: 'premium'
|
|
2794
|
+
skin: 'premium',
|
|
2795
|
+
biName: 'export_selected_items' // MANDATORY: For analytics tracking
|
|
2728
2796
|
};
|
|
2729
2797
|
```
|
|
2730
2798
|
|
|
@@ -2814,7 +2882,7 @@ import React, { type FC } from 'react';
|
|
|
2814
2882
|
import { WixDesignSystemProvider } from '@wix/design-system';
|
|
2815
2883
|
import '@wix/design-system/styles.global.css';
|
|
2816
2884
|
import { WixPatternsProvider } from '@wix/patterns/provider';
|
|
2817
|
-
import {
|
|
2885
|
+
import { AutoPatternsOverridesProvider, AutoPatternsApp } from '@wix/auto-patterns';
|
|
2818
2886
|
import { withDashboard } from '@wix/patterns';
|
|
2819
2887
|
|
|
2820
2888
|
import { config } from './MyCollectionConfig.patterns';
|
|
@@ -2823,9 +2891,9 @@ const Index: FC = () => {
|
|
|
2823
2891
|
return (
|
|
2824
2892
|
<WixDesignSystemProvider features={{ newColorsBranding: true }}>
|
|
2825
2893
|
<WixPatternsProvider>
|
|
2826
|
-
<
|
|
2894
|
+
<AutoPatternsOverridesProvider value={{ }}>
|
|
2827
2895
|
<AutoPatternsApp configuration={config} />
|
|
2828
|
-
</
|
|
2896
|
+
</AutoPatternsOverridesProvider>
|
|
2829
2897
|
</WixPatternsProvider>
|
|
2830
2898
|
</WixDesignSystemProvider>
|
|
2831
2899
|
);
|
|
@@ -2836,15 +2904,63 @@ export default withDashboard(Index);
|
|
|
2836
2904
|
|
|
2837
2905
|
---
|
|
2838
2906
|
|
|
2907
|
+
# AppContext
|
|
2908
|
+
|
|
2909
|
+
The AppContext feature allows you to add components outside the main AutoPatternsApp flow while still accessing the collection data.
|
|
2910
|
+
|
|
2911
|
+
## 1. Adding Components as Children
|
|
2912
|
+
|
|
2913
|
+
Components that need to be rendered outside the main AutoPatternsApp interface (such as modals or side panels) should be passed as children:
|
|
2914
|
+
|
|
2915
|
+
```tsx
|
|
2916
|
+
import { AutoPatternsApp } from '@wix/auto-patterns';
|
|
2917
|
+
import { MyModal } from './MyModal';
|
|
2918
|
+
import { MySidePanel } from './MySidePanel';
|
|
2919
|
+
|
|
2920
|
+
<AutoPatternsApp configuration={config}>
|
|
2921
|
+
<MyModal />
|
|
2922
|
+
<MySidePanel />
|
|
2923
|
+
</AutoPatternsApp>
|
|
2924
|
+
```
|
|
2925
|
+
|
|
2926
|
+
These children components are typically:
|
|
2927
|
+
- **Modals** - for custom actions, forms, or dialogs
|
|
2928
|
+
- **Side Panels** - for additional information or controls
|
|
2929
|
+
- **Overlay Components** - that need to appear on top of the main interface
|
|
2930
|
+
|
|
2931
|
+
## 2. Accessing Collection Data
|
|
2932
|
+
|
|
2933
|
+
Use the `useAppContext` hook to access the current collection items from within your child components:
|
|
2934
|
+
|
|
2935
|
+
```tsx
|
|
2936
|
+
import React from 'react';
|
|
2937
|
+
import { useAppContext } from '@wix/auto-patterns';
|
|
2938
|
+
|
|
2939
|
+
export const MyModal: React.FC = () => {
|
|
2940
|
+
const { items } = useAppContext();
|
|
2941
|
+
|
|
2942
|
+
return (
|
|
2943
|
+
<div>
|
|
2944
|
+
<p>Current collection has {items.length} items</p>
|
|
2945
|
+
{/* Your modal content */}
|
|
2946
|
+
</div>
|
|
2947
|
+
);
|
|
2948
|
+
};
|
|
2949
|
+
```
|
|
2950
|
+
|
|
2951
|
+
The `items` array contains the current filtered and paginated collection data that matches what's displayed in the table/grid.
|
|
2952
|
+
|
|
2953
|
+
---
|
|
2954
|
+
|
|
2839
2955
|
# Custom Overrides
|
|
2840
2956
|
|
|
2841
2957
|
## Override Rules
|
|
2842
2958
|
|
|
2843
2959
|
- **Custom overrides are restricted to the defined areas only** - attempting to override or modify any other aspect of `AutoPatternsApp` is prohibited and can cause unexpected behavior
|
|
2844
|
-
- **Always verify override implementation** - when implementing custom overrides, you MUST ensure they are correctly imported and passed to the `
|
|
2960
|
+
- **Always verify override implementation** - when implementing custom overrides, you MUST ensure they are correctly imported and passed to the `AutoPatternsOverridesProvider`
|
|
2845
2961
|
- **CRITICAL: Error handling for custom actions** - Custom actions that make external API calls (using `fetch()`, `axios`, etc.) should NOT use `errorHandler.withErrorHandler`. Only Wix HTTP requests (httpClient from @wix/essentials, Wix APIs like wix/data and wix/stores, and httpClient.fetchWithAuth()) require errorHandler wrapping. See the "Error Handling for HTTP Requests" section for details.
|
|
2846
2962
|
|
|
2847
|
-
The `
|
|
2963
|
+
The `AutoPatternsOverridesProvider` allows you to inject custom code to override default behaviors or add additional functionality. Below are the areas where overrides can be applied:
|
|
2848
2964
|
|
|
2849
2965
|
> **Note:** These are the only areas where overrides are supported. Avoid attempting to override or modify other parts of the system, as this is not supported and may lead to unexpected behavior.
|
|
2850
2966
|
|
|
@@ -2919,9 +3035,9 @@ export default function YourPage() {
|
|
|
2919
3035
|
const entityPageHeaderBadges = useEntityPageHeaderBadges();
|
|
2920
3036
|
|
|
2921
3037
|
return (
|
|
2922
|
-
<
|
|
3038
|
+
<AutoPatternsOverridesProvider value={{ actions, columns, slots, sections, components, modals, customDataSources, entityPageHeaderSubtitle, entityPageHeaderBadges }}>
|
|
2923
3039
|
<AutoPatternsApp configuration={config} />
|
|
2924
|
-
</
|
|
3040
|
+
</AutoPatternsOverridesProvider>
|
|
2925
3041
|
);
|
|
2926
3042
|
}
|
|
2927
3043
|
```
|
|
@@ -2941,7 +3057,7 @@ For example:
|
|
|
2941
3057
|
- Adding a new subtitle override → Update `../components/entityPageHeaderSubtitle/index.tsx` to include the new subtitle in the `useEntityPageHeaderSubtitle` hook
|
|
2942
3058
|
- Adding a new badges override → Update `../components/entityPageHeaderBadges/index.tsx` to include the new badges in the `useEntityPageHeaderBadges` hook
|
|
2943
3059
|
|
|
2944
|
-
Without updating the hook index files, your implementations won't be available to the `
|
|
3060
|
+
Without updating the hook index files, your implementations won't be available to the `AutoPatternsOverridesProvider`.
|
|
2945
3061
|
|
|
2946
3062
|
## Common Override Mistakes to Avoid
|
|
2947
3063
|
|
|
@@ -3186,9 +3302,9 @@ export default function YourPage() {
|
|
|
3186
3302
|
const columns = useColumns();
|
|
3187
3303
|
|
|
3188
3304
|
return (
|
|
3189
|
-
<
|
|
3305
|
+
<AutoPatternsOverridesProvider value={{ columns }}>
|
|
3190
3306
|
<AutoPatternsApp configuration={config} />
|
|
3191
|
-
</
|
|
3307
|
+
</AutoPatternsOverridesProvider>
|
|
3192
3308
|
);
|
|
3193
3309
|
}
|
|
3194
3310
|
```
|
|
@@ -3206,7 +3322,7 @@ your-page/
|
|
|
3206
3322
|
├── fullName.tsx // Calculated column
|
|
3207
3323
|
└── date.tsx // Enhanced formatting with row context
|
|
3208
3324
|
|
|
3209
|
-
|
|
3325
|
+
AutoPatternsOverridesProvider
|
|
3210
3326
|
└── value.columns (from useColumns hook)
|
|
3211
3327
|
├── name
|
|
3212
3328
|
├── petInfo
|
|
@@ -3363,9 +3479,9 @@ export default function YourPage() {
|
|
|
3363
3479
|
const components = useComponents();
|
|
3364
3480
|
|
|
3365
3481
|
return (
|
|
3366
|
-
<
|
|
3482
|
+
<AutoPatternsOverridesProvider value={{ components }}>
|
|
3367
3483
|
<AutoPatternsApp configuration={config} />
|
|
3368
|
-
</
|
|
3484
|
+
</AutoPatternsOverridesProvider>
|
|
3369
3485
|
);
|
|
3370
3486
|
}
|
|
3371
3487
|
```
|
|
@@ -3494,7 +3610,7 @@ your-page/
|
|
|
3494
3610
|
│ ├── combinedNameFields.tsx // Multiple fields override
|
|
3495
3611
|
│ └── infoCard.tsx // Standalone component
|
|
3496
3612
|
|
|
3497
|
-
|
|
3613
|
+
AutoPatternsOverridesProvider
|
|
3498
3614
|
└── value.components (from useComponents hook)
|
|
3499
3615
|
├── customNameField
|
|
3500
3616
|
├── combinedNameFields
|
|
@@ -3564,7 +3680,7 @@ To enable sections, add the `sections` configuration to your table configuration
|
|
|
3564
3680
|
|
|
3565
3681
|
### Custom Data Source Hook Structure
|
|
3566
3682
|
|
|
3567
|
-
Custom data sources are implemented through the `useCustomDataSources` hook in your `
|
|
3683
|
+
Custom data sources are implemented through the `useCustomDataSources` hook in your `AutoPatternsOverridesProvider`:
|
|
3568
3684
|
|
|
3569
3685
|
```tsx
|
|
3570
3686
|
import { useCustomDataSources } from '../components/customDataSources';
|
|
@@ -3573,9 +3689,9 @@ export default function YourPage() {
|
|
|
3573
3689
|
const customDataSources = useCustomDataSources();
|
|
3574
3690
|
|
|
3575
3691
|
return (
|
|
3576
|
-
<
|
|
3692
|
+
<AutoPatternsOverridesProvider value={{ customDataSources }}>
|
|
3577
3693
|
<AutoPatternsApp configuration={config} />
|
|
3578
|
-
</
|
|
3694
|
+
</AutoPatternsOverridesProvider>
|
|
3579
3695
|
);
|
|
3580
3696
|
}
|
|
3581
3697
|
```
|
|
@@ -3691,9 +3807,9 @@ export default function YourPage() {
|
|
|
3691
3807
|
const customDataSources = useCustomDataSources();
|
|
3692
3808
|
|
|
3693
3809
|
return (
|
|
3694
|
-
<
|
|
3810
|
+
<AutoPatternsOverridesProvider value={{ customDataSources }}>
|
|
3695
3811
|
<AutoPatternsApp configuration={config} />
|
|
3696
|
-
</
|
|
3812
|
+
</AutoPatternsOverridesProvider>
|
|
3697
3813
|
);
|
|
3698
3814
|
}
|
|
3699
3815
|
```
|
|
@@ -3702,7 +3818,7 @@ export default function YourPage() {
|
|
|
3702
3818
|
|
|
3703
3819
|
### Creating Section Renderers
|
|
3704
3820
|
|
|
3705
|
-
Section renderers are functions that determine how to group items and what information to display in section headers. They must be provided through the `
|
|
3821
|
+
Section renderers are functions that determine how to group items and what information to display in section headers. They must be provided through the `AutoPatternsOverridesProvider`.
|
|
3706
3822
|
|
|
3707
3823
|
#### Function Signature
|
|
3708
3824
|
|
|
@@ -3828,9 +3944,9 @@ import * as sections from './components/sections';
|
|
|
3828
3944
|
import * as columns from './components/columns';
|
|
3829
3945
|
import * as actions from './components/actions';
|
|
3830
3946
|
|
|
3831
|
-
<
|
|
3947
|
+
<AutoPatternsOverridesProvider value={{ sections, columns, actions }}>
|
|
3832
3948
|
<AutoPatternsApp configuration={config} />
|
|
3833
|
-
</
|
|
3949
|
+
</AutoPatternsOverridesProvider>
|
|
3834
3950
|
```
|
|
3835
3951
|
|
|
3836
3952
|
### Important Notes
|
|
@@ -3976,9 +4092,9 @@ export default function YourPage() {
|
|
|
3976
4092
|
const slots = useSlots();
|
|
3977
4093
|
|
|
3978
4094
|
return (
|
|
3979
|
-
<
|
|
4095
|
+
<AutoPatternsOverridesProvider value={{ slots }}>
|
|
3980
4096
|
<AutoPatternsApp configuration={config} />
|
|
3981
|
-
</
|
|
4097
|
+
</AutoPatternsOverridesProvider>
|
|
3982
4098
|
);
|
|
3983
4099
|
}
|
|
3984
4100
|
```
|