@pega/sdk 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/dist/index.js +764 -165
- package/package.json +1 -1
- package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
- package/templates/react-native-sdk-reference/.prettierignore +17 -0
- package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
- package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
- package/templates/react-native-sdk-reference/AGENTS.md +3 -0
- package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
- package/templates/react-native-sdk-reference/README.md +56 -0
- package/templates/react-native-sdk-reference/app.json +40 -5
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
- package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
- package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
- package/templates/react-native-sdk-reference/package.json +59 -14
- package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/sdk-config.json +31 -9
- package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
- package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
- package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
- package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
- package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
- package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
- package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
- package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
- package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
- package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
- package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
- package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
- package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
- package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
- package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
- package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
- package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
- package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
- package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
- package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
- package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
- package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
- package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
- package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
- package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
- package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
- package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
- package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
- package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
- package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
- package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
- package/templates/react-native-sdk-reference/tsconfig.json +9 -8
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
- package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
- package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
- package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
- package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
- package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
- package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
- package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
- package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
- package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
- package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
- package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
- package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
- package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
- package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
- package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
- package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
- package/templates/react-sdk-reference/package.json +1 -1
- package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
- package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
- package/templates/react-native-sdk-reference/App.tsx +0 -49
- package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
- package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md
CHANGED
|
@@ -6,21 +6,21 @@ Inline dashboard page template. Builds filter components from promoted filters m
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
> ⚠️ **CRITICAL — Must use
|
|
9
|
+
> ⚠️ **CRITICAL — Must use the project's filter-component builder utility**
|
|
10
10
|
>
|
|
11
|
-
> This component MUST use
|
|
11
|
+
> This component MUST use the project's filter-component builder utility (invoked with `getPConnect` and the filters array) to generate proper filter UI components. Without this, dashboard filters will not render correctly.
|
|
12
12
|
>
|
|
13
13
|
> **Mandatory implementation details:**
|
|
14
14
|
>
|
|
15
|
-
> 1.
|
|
15
|
+
> 1. Obtain the filter-component builder utility from the project's SDK bridge layer
|
|
16
16
|
> 2. `getPConnect().getRawMetadata().children[1]` — extract filter metadata
|
|
17
|
-
> 3.
|
|
18
|
-
> 4. Assemble
|
|
17
|
+
> 3. Local state for `filterComponents` populated via a lifecycle effect on mount
|
|
18
|
+
> 4. Assemble forwarded children so index 1 contains the built filter components
|
|
19
19
|
>
|
|
20
20
|
> **Minimum Implementation Checklist:**
|
|
21
21
|
>
|
|
22
|
-
> - [ ]
|
|
23
|
-
> - [ ] `filterComponents` state populated via
|
|
22
|
+
> - [ ] Filter-component builder utility obtained from the project's SDK bridge
|
|
23
|
+
> - [ ] `filterComponents` local state populated via lifecycle effect
|
|
24
24
|
> - [ ] Filter metadata extracted from `getRawMetadata().children[1]`
|
|
25
25
|
> - [ ] InlineDashboard receives filter components as children
|
|
26
26
|
|
|
@@ -28,84 +28,53 @@ Inline dashboard page template. Builds filter components from promoted filters m
|
|
|
28
28
|
|
|
29
29
|
## Component Purpose
|
|
30
30
|
|
|
31
|
-
Page-level wrapper for the inline dashboard. Extracts promoted filter definitions from the PConnect metadata, builds
|
|
31
|
+
Page-level wrapper for the inline dashboard. Extracts promoted filter definitions from the PConnect metadata, builds filter components from them, and passes them to `InlineDashboard` as the second child (filter panel). The first child (main content) is passed through unchanged.
|
|
32
32
|
|
|
33
33
|
> See `InlineDashboard.md` for the layout and rendering behavior. This component only handles filter component construction.
|
|
34
34
|
|
|
35
35
|
## Pega Metadata
|
|
36
36
|
|
|
37
|
-
- **Registration key:** `InlineDashboardPage` (in
|
|
37
|
+
- **Registration key:** `InlineDashboardPage` (in the project's component map)
|
|
38
38
|
- **Category:** Page template — dashboard page
|
|
39
|
-
- **Extends:**
|
|
40
|
-
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
|
|
|
44
|
-
| ---------------- |
|
|
45
|
-
| `children` |
|
|
46
|
-
| `title` | `string`
|
|
47
|
-
| `filterPosition` | `string`
|
|
48
|
-
| `getPConnect` | `function`
|
|
49
|
-
|
|
50
|
-
##
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
export default function InlineDashboardPage(props: PropsWithChildren<InlineDashboardPageProps>) {
|
|
64
|
-
const InlineDashboard = getComponentFromRegistry('InlineDashboard');
|
|
65
|
-
const { children, getPConnect, filterPosition = 'block-start' } = props;
|
|
66
|
-
const [filterComponents, setFilterComponents] = useState([]);
|
|
67
|
-
const childArray = useMemo(() => Children.toArray(children), [children]);
|
|
68
|
-
|
|
69
|
-
// 1. Build filter components from metadata on mount
|
|
70
|
-
const allFilters = (getPConnect().getRawMetadata() as any).children[1];
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
setFilterComponents(buildFilterComponents(getPConnect, allFilters));
|
|
73
|
-
}, []);
|
|
74
|
-
|
|
75
|
-
// 2. Assemble props for InlineDashboard
|
|
76
|
-
const inlineProps = { ...props };
|
|
77
|
-
inlineProps.children = [];
|
|
78
|
-
inlineProps.children[0] = childArray[0]; // main content
|
|
79
|
-
inlineProps.children[1] = filterComponents; // built filters
|
|
80
|
-
|
|
81
|
-
// 3. Delegate to InlineDashboard
|
|
82
|
-
return <InlineDashboard {...inlineProps} />;
|
|
83
|
-
}
|
|
84
|
-
```
|
|
39
|
+
- **Extends:** The project's base component interface
|
|
40
|
+
|
|
41
|
+
## Inputs
|
|
42
|
+
|
|
43
|
+
| Input | Type | Required | Description |
|
|
44
|
+
| ---------------- | ------------------ | -------- | ----------------------------------------------- |
|
|
45
|
+
| `children` | child element list | Yes | Main content children passed to InlineDashboard |
|
|
46
|
+
| `title` | `string` | No | Dashboard title |
|
|
47
|
+
| `filterPosition` | `string` | No | Filter position: `'block-start'` or side |
|
|
48
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
49
|
+
|
|
50
|
+
## Implementation Structure
|
|
51
|
+
|
|
52
|
+
**Module Setup:** Obtain the project's filter-component builder utility from the SDK bridge layer and the `InlineDashboard` component from the project's component registry. The component requires local state management and a lifecycle effect for initialization.
|
|
53
|
+
|
|
54
|
+
The component's interface extends the project's base component interface with `title: string`, optional `icon?: string`, and optional `filterPosition?: string`.
|
|
55
|
+
|
|
56
|
+
**Main Component Logic** — steps in order:
|
|
57
|
+
|
|
58
|
+
1. Retrieve `InlineDashboard` from the project's component registry. Receive inputs: `children`, `getPConnect`, and `filterPosition` (default `'block-start'`). Declare local state `filterComponents` (array, initially empty). Create a memoized computation that converts children into a flat array.
|
|
59
|
+
2. Build filter components from metadata on mount: read `allFilters = getPConnect().getRawMetadata().children[1]`, then inside a lifecycle effect that runs once on initialization, invoke the project's filter-component builder utility with `getPConnect` and `allFilters`, and store the result in `filterComponents` local state.
|
|
60
|
+
3. Assemble the inputs to forward to `InlineDashboard`: shallow-copy the received inputs into a forwarding object, then set its children to a new array whose index 0 is the first child element (the main content) and whose index 1 is `filterComponents` (the built filters).
|
|
61
|
+
4. Delegate rendering entirely to `InlineDashboard`, spreading all assembled inputs.
|
|
85
62
|
|
|
86
63
|
## Behavioral Contract
|
|
87
64
|
|
|
88
65
|
### Filter Component Construction
|
|
89
66
|
|
|
90
|
-
In
|
|
67
|
+
In a lifecycle effect (on mount, runs once):
|
|
91
68
|
|
|
92
|
-
1. Get promoted filters: `allFilters = getPConnect().getRawMetadata().
|
|
93
|
-
2.
|
|
69
|
+
1. Get promoted filters: `allFilters = getPConnect().getRawMetadata().children[1]`.
|
|
70
|
+
2. Invoke the project's filter-component builder utility with `getPConnect` and `allFilters`:
|
|
94
71
|
- For each filter in `allFilters`, creates a PConnect-based filter field component.
|
|
95
|
-
- Returns an array of
|
|
96
|
-
3. Store result in `filterComponents` state.
|
|
72
|
+
- Returns an array of rendered filter elements ready to display.
|
|
73
|
+
3. Store result in `filterComponents` local state.
|
|
97
74
|
|
|
98
75
|
### Render
|
|
99
76
|
|
|
100
|
-
|
|
101
|
-
<InlineDashboard title={title} filterPosition={filterPosition} getPConnect={getPConnect}>
|
|
102
|
-
{children[0]} {/* main content */}
|
|
103
|
-
{filterComponents} {/* built filter components */}
|
|
104
|
-
</InlineDashboard>
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
- `children[0]` = main content region.
|
|
108
|
-
- `filterComponents` = built filter elements (replaces raw `children[1]`).
|
|
77
|
+
Delegate to `InlineDashboard`, forwarding `title`, `filterPosition`, and `getPConnect`, with two children: children index 0 (the main content region) and `filterComponents` (the built filter elements, replacing the raw children index 1).
|
|
109
78
|
|
|
110
79
|
## Visual Specifications
|
|
111
80
|
|
|
@@ -114,25 +83,23 @@ Identical to `InlineDashboard` — see `InlineDashboard.md`. The only difference
|
|
|
114
83
|
## Edge Cases & Special Logic
|
|
115
84
|
|
|
116
85
|
- `allFilters` may be empty — if no promoted filters exist, `filterComponents` is an empty array, and `InlineDashboard` renders without a filter panel.
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
- `filterComponents` replaces
|
|
86
|
+
- The filter-component builder utility may be async in some implementations — show a loading state if needed until filters are ready.
|
|
87
|
+
- Children index 0 is always the main content — index is stable.
|
|
88
|
+
- `filterComponents` replaces children index 1 entirely — do not render both.
|
|
120
89
|
|
|
121
90
|
## Dependencies
|
|
122
91
|
|
|
123
|
-
-
|
|
124
|
-
- `InlineDashboard` — the layout template this component wraps
|
|
92
|
+
- The project's filter-component builder utility — constructs filter field components from promoted filter config; accepts `getPConnect` and a filters array and returns rendered filter components
|
|
93
|
+
- `InlineDashboard` — the layout template this component wraps (resolved via the project's component registry)
|
|
125
94
|
|
|
126
95
|
## Design System Mapping
|
|
127
96
|
|
|
128
97
|
**UI control type:** Dashboard page — programmatic filter construction + InlineDashboard delegation.
|
|
129
98
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
This component is a thin orchestration layer. All visual implementation is in `InlineDashboard`. The only implementation detail is `buildFilterComponents` — which creates filter field components from metadata definitions.
|
|
99
|
+
This component is a thin orchestration layer. All visual implementation is in `InlineDashboard`. The only implementation detail is the filter-component builder utility — which creates filter field components from metadata definitions.
|
|
133
100
|
|
|
134
|
-
When implementing in a specific design system:
|
|
101
|
+
When implementing in a specific design system, map the following:
|
|
135
102
|
|
|
136
|
-
-
|
|
137
|
-
- If
|
|
103
|
+
- The filter-component builder utility must create proper PConnect-backed filter field components
|
|
104
|
+
- If promoted filters metadata is empty, skip the filter panel entirely
|
|
138
105
|
- All layout and styling is delegated to `InlineDashboard`
|
|
@@ -8,21 +8,21 @@ List page template. Thin wrapper that renders `ListView` in standalone page mode
|
|
|
8
8
|
|
|
9
9
|
## Component Purpose
|
|
10
10
|
|
|
11
|
-
Renders a full-page list view by forwarding all
|
|
11
|
+
Renders a full-page list view by forwarding all inputs to `ListView` with `bInForm: false`. There is no additional logic — this component exists solely to provide a registration key that signals "this is a page, not an inline table."
|
|
12
12
|
|
|
13
13
|
> See `ListView.md` for full documentation of all capabilities.
|
|
14
14
|
|
|
15
15
|
## Pega Metadata
|
|
16
16
|
|
|
17
|
-
- **Registration key:** `ListPage` (in
|
|
17
|
+
- **Registration key:** `ListPage` (in the project's component map)
|
|
18
18
|
- **Category:** Page template — list page
|
|
19
|
-
- **Extends:**
|
|
19
|
+
- **Extends:** The project's base component interface
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Inputs
|
|
22
22
|
|
|
23
|
-
All
|
|
23
|
+
All inputs are forwarded to `ListView`. Key inputs:
|
|
24
24
|
|
|
25
|
-
|
|
|
25
|
+
| Input | Type | Required | Description |
|
|
26
26
|
| -------------- | ---------- | -------- | ------------------------------ |
|
|
27
27
|
| `dataPageName` | `string` | Yes | Data page to load records from |
|
|
28
28
|
| `columns` | `array` | No | Column definitions |
|
|
@@ -30,31 +30,20 @@ All props are forwarded to `ListView`. Key props:
|
|
|
30
30
|
| `payload` | `object` | No | Query payload |
|
|
31
31
|
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Implementation Structure
|
|
34
34
|
|
|
35
|
-
Simplest possible template — pure pass-through to `ListView` with one
|
|
35
|
+
Simplest possible template — pure pass-through to `ListView` with one input override.
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
39
|
-
import type { PConnProps } from '@pega/sdk-react';
|
|
37
|
+
**Module Setup:** Obtain `ListView` from the project's component registry. The component's interface extends the project's base component interface with `parameters: object`.
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
parameters: object;
|
|
43
|
-
}
|
|
39
|
+
**Main Component Logic** — steps in order:
|
|
44
40
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return <ListView {...props} bInForm={false} />;
|
|
48
|
-
}
|
|
49
|
-
```
|
|
41
|
+
1. Retrieve `ListView` from the project's component registry.
|
|
42
|
+
2. Render `ListView` forwarding all received inputs and overriding `bInForm` to `false`.
|
|
50
43
|
|
|
51
44
|
## Behavioral Contract
|
|
52
45
|
|
|
53
|
-
|
|
54
|
-
<ListView {...props} bInForm={false} />
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
That is the complete implementation. `bInForm: false` ensures ListView renders with full page chrome (outer padding, page-level toolbar layout).
|
|
46
|
+
The complete implementation renders `ListView` forwarding all inputs with `bInForm` overridden to `false`. `bInForm: false` ensures ListView renders with full page chrome (outer padding, page-level toolbar layout).
|
|
58
47
|
|
|
59
48
|
## Visual Specifications
|
|
60
49
|
|
|
@@ -72,17 +61,15 @@ None beyond `ListView`. The only constraint is that `bInForm` is always `false`
|
|
|
72
61
|
|
|
73
62
|
## Dependencies
|
|
74
63
|
|
|
75
|
-
- `ListView` — the primary list template component
|
|
64
|
+
- `ListView` — the primary list template component (resolved via the project's component registry)
|
|
76
65
|
|
|
77
66
|
## Design System Mapping
|
|
78
67
|
|
|
79
68
|
**UI control type:** Full-page data list — pass-through to `ListView` with page-mode flag.
|
|
80
69
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Implement identically to `ListView` — `ListPage` adds no new UI. The distinction is purely in the `bInForm` prop which controls spacing/chrome.
|
|
70
|
+
Implement identically to `ListView` — `ListPage` adds no new UI. The distinction is purely in the `bInForm` input which controls spacing/chrome.
|
|
84
71
|
|
|
85
|
-
When implementing in a specific design system:
|
|
72
|
+
When implementing in a specific design system, map the following:
|
|
86
73
|
|
|
87
74
|
- `bInForm: false` signals that the list should have page-level layout (more padding, full-width toolbar)
|
|
88
75
|
- No additional logic beyond `ListView` is required
|
|
@@ -12,29 +12,10 @@ Full-featured list view template. Renders a data table with sorting, pagination,
|
|
|
12
12
|
>
|
|
13
13
|
> 1. Check `typeof referenceList === 'string'` before using it
|
|
14
14
|
> 2. Call `PCore.getDataApiUtils().getData(referenceList, payload)` to fetch actual row data
|
|
15
|
-
> 3. Initialize row state as empty array
|
|
15
|
+
> 3. Initialize row state as empty array
|
|
16
16
|
> 4. NEVER put `referenceList` directly into state or call `.filter()` on it
|
|
17
17
|
>
|
|
18
|
-
>
|
|
19
|
-
> // ❌ WRONG — will crash with "rows.filter is not a function"
|
|
20
|
-
> const [rows, setRows] = useState(referenceList);
|
|
21
|
-
>
|
|
22
|
-
> // ✅ CORRECT — fetch data from the reference string
|
|
23
|
-
> const [rows, setRows] = useState<any[]>([]);
|
|
24
|
-
> useEffect(() => {
|
|
25
|
-
> if (Array.isArray(referenceList)) {
|
|
26
|
-
> setRows(referenceList);
|
|
27
|
-
> return;
|
|
28
|
-
> }
|
|
29
|
-
> const dataRef = typeof referenceList === 'string' ? referenceList : dataPageName;
|
|
30
|
-
> if (dataRef) {
|
|
31
|
-
> PCore.getDataApiUtils()
|
|
32
|
-
> .getData(dataRef, payload ?? {})
|
|
33
|
-
> .then((response) => setRows(response?.data?.data ?? response?.data?.pxResults ?? []))
|
|
34
|
-
> .catch(() => setRows([]));
|
|
35
|
-
> }
|
|
36
|
-
> }, [referenceList]);
|
|
37
|
-
> ```
|
|
18
|
+
> Do NOT initialize row state directly from `referenceList` (e.g. as the initial state value) — this crashes later with "rows.filter is not a function" because `referenceList` is a string, not an array. Instead, initialize rows as an empty array and populate them inside a lifecycle effect keyed on `referenceList`: if `referenceList` happens to already be an array, use it directly; otherwise resolve a `dataRef` from `referenceList` (falling back to `dataPageName`) and, when present, call `PCore.getDataApiUtils().getData(dataRef, payload ?? {})`, storing the resolved rows from `response?.data?.data ?? response?.data?.pxResults ?? []` on success, or an empty array on failure.
|
|
38
19
|
|
|
39
20
|
---
|
|
40
21
|
|
|
@@ -48,31 +29,7 @@ Full-featured list view template. Renders a data table with sorting, pagination,
|
|
|
48
29
|
> 2. Get field definitions (labels, types) from metadata: `PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false)`
|
|
49
30
|
> 3. Map each preset column to its field definition to build `{id, label, type, displayAsLink}` headers
|
|
50
31
|
>
|
|
51
|
-
>
|
|
52
|
-
> // ❌ WRONG — shows ALL raw data keys as columns (pzInsKey, pxRefObjectClass, etc.)
|
|
53
|
-
> const fields = Object.keys(rows[0]).map((key) => ({ id: key, label: key }));
|
|
54
|
-
>
|
|
55
|
-
> // ✅ CORRECT — extract configured columns from PConnect presets + metadata
|
|
56
|
-
> const componentConfig = getPConnect().getComponentConfig();
|
|
57
|
-
> const columnFields = componentConfig.presets[0].children[0].children;
|
|
58
|
-
> const metaResponse = await PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false);
|
|
59
|
-
> const fieldDefs = metaResponse?.data?.fields ?? [];
|
|
60
|
-
>
|
|
61
|
-
> const columns = columnFields.map((field, index) => {
|
|
62
|
-
> let fieldId = field.config.value.substring(field.config.value.indexOf(' ') + 1);
|
|
63
|
-
> if (fieldId.startsWith('.')) fieldId = fieldId.substring(1);
|
|
64
|
-
> const { additionalDetails = {} } = field.config;
|
|
65
|
-
> const displayAsLink =
|
|
66
|
-
> additionalDetails.type === 'DISPLAY_LINK' || ('displayAsLink' in field.config && field.config.displayAsLink);
|
|
67
|
-
> return {
|
|
68
|
-
> id: fieldId,
|
|
69
|
-
> label: fieldDefs[index]?.label ?? field.config.label ?? fieldId,
|
|
70
|
-
> type: field.type,
|
|
71
|
-
> displayAsLink,
|
|
72
|
-
> classID: fieldDefs.find((f) => f.name === fieldId)?.classID,
|
|
73
|
-
> };
|
|
74
|
-
> });
|
|
75
|
-
> ```
|
|
32
|
+
> Do NOT derive columns by taking `Object.keys(rows[0])` and mapping each key to `{ id: key, label: key }` — that shows every raw data key, including internal fields like `pzInsKey` and `pxRefObjectClass`. Instead, extract the configured columns from PConnect presets plus the analytics metadata: read `componentConfig = getPConnect().getComponentConfig()`; read `columnFields = componentConfig.presets[0].children[0].children`; await `metaResponse = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false)` and take `fieldDefs = metaResponse?.data?.fields ?? []`; then map each entry in `columnFields` (with its index) to a column definition: strip the annotation prefix from `field.config.value` (format `"@P .pyID"`, take the substring after the first space, then strip a leading `.` if present) to get `fieldId`; read `additionalDetails` from `field.config` (default `{}`) and compute `displayAsLink` as true when `additionalDetails.type === 'DISPLAY_LINK'` or when `field.config.displayAsLink` is set; build `{ id: fieldId, label: fieldDefs[index]?.label ?? field.config.label ?? fieldId, type: field.type, displayAsLink, classID: fieldDefs.find(f => f.name === fieldId)?.classID }`.
|
|
76
33
|
>
|
|
77
34
|
> **Key points:**
|
|
78
35
|
>
|
|
@@ -85,18 +42,7 @@ Full-featured list view template. Renders a data table with sorting, pagination,
|
|
|
85
42
|
|
|
86
43
|
> ⚠️ **CRITICAL — Data fetching differs by `bInForm`**
|
|
87
44
|
>
|
|
88
|
-
> The data API to call depends on whether the ListView is inside a form or on a standalone page:
|
|
89
|
-
>
|
|
90
|
-
> ```typescript
|
|
91
|
-
> // Page-level (bInForm = false) — e.g., worklist landing page
|
|
92
|
-
> const result = await PCore.getDataApiUtils().getData(referenceList, payload ?? {});
|
|
93
|
-
> const rows = result?.data?.data ?? [];
|
|
94
|
-
>
|
|
95
|
-
> // Form-level (bInForm = true) — e.g., embedded list in a case form
|
|
96
|
-
> const context = getPConnect().getContextName();
|
|
97
|
-
> const result = await PCore.getDataPageUtils().getDataAsync(referenceList, context, parameters, null, query);
|
|
98
|
-
> const rows = result?.data ?? [];
|
|
99
|
-
> ```
|
|
45
|
+
> The data API to call depends on whether the ListView is inside a form or on a standalone page: for page-level use (`bInForm = false`, e.g. a worklist landing page), await `PCore.getDataApiUtils().getData(referenceList, payload ?? {})` and read rows from `result?.data?.data ?? []`; for form-level use (`bInForm = true`, e.g. an embedded list in a case form), resolve `context = getPConnect().getContextName()`, await `PCore.getDataPageUtils().getDataAsync(referenceList, context, parameters, null, query)`, and read rows from `result?.data ?? []`.
|
|
100
46
|
>
|
|
101
47
|
> Using the wrong API will return empty data or fail silently.
|
|
102
48
|
|
|
@@ -108,11 +54,11 @@ The primary data table component. Renders a sortable, paginated, filterable, and
|
|
|
108
54
|
|
|
109
55
|
## Pega Metadata
|
|
110
56
|
|
|
111
|
-
- **Registration key:** `ListView` (in
|
|
57
|
+
- **Registration key:** `ListView` (in the project's component map)
|
|
112
58
|
- **Category:** Data display template
|
|
113
|
-
- **Extends:**
|
|
59
|
+
- **Extends:** The project's base component interface
|
|
114
60
|
|
|
115
|
-
##
|
|
61
|
+
## Inputs
|
|
116
62
|
|
|
117
63
|
| Prop | Type | Required | Description |
|
|
118
64
|
| ----------------------- | ---------- | -------- | ----------------------------------------------------------------------------- |
|
|
@@ -127,160 +73,43 @@ The primary data table component. Renders a sortable, paginated, filterable, and
|
|
|
127
73
|
| `payload` | `object` | No | Query payload for data page requests |
|
|
128
74
|
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
129
75
|
|
|
130
|
-
##
|
|
76
|
+
## Implementation Structure
|
|
131
77
|
|
|
132
78
|
> ⚠️ **CRITICAL — USE THE PROJECT'S DESIGN SYSTEM FOR TABLE RENDERING**
|
|
133
79
|
>
|
|
134
80
|
> This component MUST use the **installed design system's table components** — NOT plain HTML `<table>/<thead>/<tbody>`.
|
|
135
|
-
> Check
|
|
136
|
-
>
|
|
137
|
-
> | If installed DS is... | Import from... | Table components |
|
|
138
|
-
> | --------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
139
|
-
> | `@carbon/react` | `@carbon/react` | `Table, TableHead, TableRow, TableHeader, TableBody, TableCell, TableContainer, TableToolbar, TableToolbarSearch, Pagination, Link` |
|
|
140
|
-
> | `@mui/material` | `@mui/material` | `Table, TableHead, TableRow, TableCell, TableBody, TableContainer, TablePagination, TableSortLabel, Link` |
|
|
141
|
-
> | `antd` | `antd` | `Table` (with `columns` + `dataSource` props, built-in pagination) |
|
|
142
|
-
> | `@chakra-ui/react` | `@chakra-ui/react` | `Table, Thead, Tbody, Tr, Th, Td, Link` + custom pagination |
|
|
143
|
-
> | None / CSS-only | N/A | Plain `<table>/<thead>/<tbody>` with CSS classes |
|
|
144
|
-
>
|
|
145
|
-
> **The table MUST look like a proper data grid** with:
|
|
81
|
+
> Check the project's dependencies for the installed design system and use its table primitives. The table MUST look like a proper data grid with:
|
|
146
82
|
>
|
|
147
83
|
> - Column headers with field labels (from PConnect presets metadata)
|
|
148
84
|
> - Paginated rows (not all rows at once)
|
|
149
85
|
> - Clickable link cells for navigation
|
|
150
86
|
> - Search toolbar (when `globalSearch !== false`)
|
|
151
87
|
>
|
|
152
|
-
>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
compositeKeys?: any;
|
|
172
|
-
localeReference?: string;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export default function ListView(props: ListViewProps) {
|
|
176
|
-
const { getPConnect, bInForm = true, globalSearch, referenceList, payload, parameters, localeReference } = props;
|
|
177
|
-
|
|
178
|
-
const [arRows, setRows] = useState<any[]>([]);
|
|
179
|
-
const [arColumns, setColumns] = useState<any[]>([]);
|
|
180
|
-
const [page, setPage] = useState(1);
|
|
181
|
-
const [pageSize, setPageSize] = useState(10);
|
|
182
|
-
const [searchValue, setSearchValue] = useState('');
|
|
183
|
-
const [title, setTitle] = useState('');
|
|
184
|
-
|
|
185
|
-
const thePConn = getPConnect();
|
|
186
|
-
const componentConfig = thePConn.getComponentConfig();
|
|
187
|
-
const resolvedConfigProps: any = thePConn.getConfigProps();
|
|
188
|
-
|
|
189
|
-
// ═══════════════════════════════════════════════════════════════
|
|
190
|
-
// CRITICAL: Extract column definitions from PConnect presets
|
|
191
|
-
// ═══════════════════════════════════════════════════════════════
|
|
192
|
-
const getHeaderCells = useCallback((columnFields: any[], fieldDefs: any[]) => {
|
|
193
|
-
return columnFields.map((field: any, index: number) => {
|
|
194
|
-
let theField = field.config.value.substring(field.config.value.indexOf(' ') + 1);
|
|
195
|
-
if (theField.startsWith('.')) theField = theField.substring(1);
|
|
196
|
-
const colIndex = fieldDefs.findIndex((ele) => ele.name === theField);
|
|
197
|
-
const { additionalDetails = {} } = field.config;
|
|
198
|
-
let displayAsLink = additionalDetails.type === 'DISPLAY_LINK';
|
|
199
|
-
if (!displayAsLink) displayAsLink = 'displayAsLink' in field.config && field.config.displayAsLink;
|
|
200
|
-
return {
|
|
201
|
-
id: theField,
|
|
202
|
-
type: field.type,
|
|
203
|
-
displayAsLink,
|
|
204
|
-
label: fieldDefs[index]?.label ?? field.config.label ?? theField,
|
|
205
|
-
classID: colIndex > -1 ? fieldDefs[colIndex].classID : undefined,
|
|
206
|
-
isAssignmentLink: displayAsLink && AssignDashObjects.includes(fieldDefs[colIndex]?.classID),
|
|
207
|
-
};
|
|
208
|
-
});
|
|
209
|
-
}, []);
|
|
210
|
-
|
|
211
|
-
// ═══════════════════════════════════════════════════════════════
|
|
212
|
-
// CRITICAL: Fetch metadata + data in useEffect
|
|
213
|
-
// ═══════════════════════════════════════════════════════════════
|
|
214
|
-
useEffect(() => {
|
|
215
|
-
let isActive = true;
|
|
216
|
-
async function fetchData() {
|
|
217
|
-
// Step 1: Get field definitions from metadata API
|
|
218
|
-
const metaResponse: any = await PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false);
|
|
219
|
-
const fieldDefs = metaResponse?.data?.fields ?? [];
|
|
220
|
-
|
|
221
|
-
// Step 2: Get configured columns from presets
|
|
222
|
-
const columnFields = componentConfig?.presets?.[0]?.children?.[0]?.children ?? [];
|
|
223
|
-
if (columnFields.length) {
|
|
224
|
-
const myColumns = getHeaderCells(columnFields, fieldDefs);
|
|
225
|
-
myColumns.forEach((col) => {
|
|
226
|
-
if (localeReference) col.label = PCore.getLocaleUtils().getLocaleValue(col.label, localeReference);
|
|
227
|
-
});
|
|
228
|
-
if (isActive) setColumns(myColumns);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// Step 3: Fetch data — API differs by bInForm
|
|
232
|
-
let dataResult: any;
|
|
233
|
-
if (!bInForm) {
|
|
234
|
-
dataResult = await PCore.getDataApiUtils().getData(referenceList, payload ?? {});
|
|
235
|
-
} else {
|
|
236
|
-
const context = thePConn.getContextName();
|
|
237
|
-
dataResult = await (PCore.getDataPageUtils() as any).getDataAsync(
|
|
238
|
-
referenceList,
|
|
239
|
-
context,
|
|
240
|
-
parameters,
|
|
241
|
-
null,
|
|
242
|
-
null,
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
const tableData = !bInForm ? (dataResult?.data?.data ?? []) : (dataResult?.data ?? []);
|
|
246
|
-
if (isActive) setRows(Array.isArray(tableData) ? tableData : []);
|
|
247
|
-
}
|
|
248
|
-
fetchData();
|
|
249
|
-
return () => {
|
|
250
|
-
isActive = false;
|
|
251
|
-
};
|
|
252
|
-
}, [referenceList, bInForm, payload, parameters]);
|
|
253
|
-
|
|
254
|
-
// ═══════════════════════════════════════════════════════════════
|
|
255
|
-
// CRITICAL: Link click handlers for navigation
|
|
256
|
-
// ═══════════════════════════════════════════════════════════════
|
|
257
|
-
function handleLinkClick(row: any, column: any) {
|
|
258
|
-
if (column.isAssignmentLink) {
|
|
259
|
-
const { pxRefObjectClass, pzInsKey } = row;
|
|
260
|
-
thePConn.getActionsApi().openAssignment(pzInsKey, pxRefObjectClass, {
|
|
261
|
-
containerName: thePConn.getContainerName(),
|
|
262
|
-
channelName: '',
|
|
263
|
-
});
|
|
264
|
-
} else {
|
|
265
|
-
const pxRefObjectKey = row.pxRefObjectKey ?? row.pzInsKey;
|
|
266
|
-
const pxRefObjectClass = row.pxRefObjectClass ?? row.pxObjClass;
|
|
267
|
-
if (pxRefObjectClass && pxRefObjectKey) {
|
|
268
|
-
thePConn.getActionsApi().openWorkByHandle(pxRefObjectKey, pxRefObjectClass);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// Search, pagination, sort, selection, render...
|
|
274
|
-
}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
> **Note:** This skeleton shows the MANDATORY patterns. Full implementations will also include sorting, selection, filter dialog, column menus, and PubSub subscriptions for dashboard filters. But the three critical sections above (column extraction, data fetching, link handling) MUST be present for the table to render correctly.
|
|
88
|
+
> Do NOT render raw `Object.values(row)` or dump all data keys as columns, and do NOT use plain HTML when a design system is installed.
|
|
89
|
+
|
|
90
|
+
This is the largest template component. The implementation MUST include these critical sections.
|
|
91
|
+
|
|
92
|
+
**Module Setup:** The component depends on local state management, lifecycle effects, and a cached callback. Declare a constant `AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket']` (classes whose links should open as assignments rather than plain work items). Define the input contract as an extension of the project's base component interface with optional `bInForm`, `globalSearch`, `referenceList`, `selectionMode`, `referenceType`, `payload`, `parameters`, `compositeKeys`, and `localeReference` fields.
|
|
93
|
+
|
|
94
|
+
**Main Component Logic** — steps in order:
|
|
95
|
+
|
|
96
|
+
1. Receive inputs: `getPConnect`, `bInForm` (default `true`), `globalSearch`, `referenceList`, `payload`, `parameters`, and `localeReference`. Declare local state: `arRows` (array, default `[]`), `arColumns` (array, default `[]`), `page` (default `1`), `pageSize` (default `10`), `searchValue` (default `''`), and `title` (default `''`).
|
|
97
|
+
2. Call `getPConnect()` once into `thePConn`; read `componentConfig = thePConn.getComponentConfig()` and `resolvedConfigProps = thePConn.getConfigProps()`.
|
|
98
|
+
3. **Extract column definitions from PConnect presets** — define a memoized/cached `getHeaderCells(columnFields, fieldDefs)` callback that maps each `columnFields` entry (with its index) to a header descriptor: strip the annotation prefix from `field.config.value` to get `theField` (take the substring after the first space, then strip a leading `.`); find the matching field definition's index in `fieldDefs` via `.findIndex(ele => ele.name === theField)` as `colIndex`; read `additionalDetails` from `field.config` (default `{}`) and compute `displayAsLink` as true when `additionalDetails.type === 'DISPLAY_LINK'` or when `field.config.displayAsLink` is set; return `{ id: theField, type: field.type, displayAsLink, label: fieldDefs[index]?.label ?? field.config.label ?? theField, classID: colIndex > -1 ? fieldDefs[colIndex].classID : undefined, isAssignmentLink: displayAsLink && AssignDashObjects.includes(fieldDefs[colIndex]?.classID) }`.
|
|
99
|
+
4. **Fetch metadata + data** in a lifecycle effect keyed on `[referenceList, bInForm, payload, parameters]`, using an `isActive` flag to guard against updates after unmount:
|
|
100
|
+
- Await field definitions via `PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, false)`, reading `fieldDefs` from `metaResponse?.data?.fields ?? []`.
|
|
101
|
+
- Read configured columns from `componentConfig?.presets?.[0]?.children?.[0]?.children ?? []`; when non-empty, build `myColumns` via `getHeaderCells(columnFields, fieldDefs)`, localize each column's `label` through `PCore.getLocaleUtils().getLocaleValue` when `localeReference` is set, and store the result via `setColumns`.
|
|
102
|
+
- Fetch the row data using the API appropriate to `bInForm` (see the CRITICAL note above): for `!bInForm`, await `PCore.getDataApiUtils().getData(referenceList, payload ?? {})`; for `bInForm`, resolve `context = thePConn.getContextName()` and await `PCore.getDataPageUtils().getDataAsync(referenceList, context, parameters, null, null)`. Extract `tableData` from `dataResult?.data?.data ?? []` (page mode) or `dataResult?.data ?? []` (form mode), and store it via `setRows` (defaulting to `[]` when not an array).
|
|
103
|
+
5. **Link click handling** — define `handleLinkClick(row, column)`: when `column.isAssignmentLink`, destructure `pxRefObjectClass` and `pzInsKey` from `row` and call `thePConn.getActionsApi().openAssignment(pzInsKey, pxRefObjectClass, { containerName: thePConn.getContainerName(), channelName: '' })`; otherwise, resolve `pxRefObjectKey` from `row.pxRefObjectKey ?? row.pzInsKey` and `pxRefObjectClass` from `row.pxRefObjectClass ?? row.pxObjClass`, and when both are present, call `thePConn.getActionsApi().openWorkByHandle(pxRefObjectKey, pxRefObjectClass)`.
|
|
104
|
+
6. Beyond these mandatory sections, a full implementation also needs search, pagination, sort, selection, and rendering logic (see the Behavioral Contract below for each).
|
|
105
|
+
|
|
106
|
+
> **Note:** The sections above show the MANDATORY patterns. Full implementations will also include sorting, selection, filter dialog, column menus, and PubSub subscriptions for dashboard filters. But the three critical sections above (column extraction, data fetching, link handling) MUST be present for the table to render correctly.
|
|
278
107
|
|
|
279
108
|
## Behavioral Contract
|
|
280
109
|
|
|
281
110
|
### Initialization
|
|
282
111
|
|
|
283
|
-
`
|
|
112
|
+
The initialization utility (invoked with `getPConnect`, `columns`, `dataPageName`, and `payload`):
|
|
284
113
|
|
|
285
114
|
1. Calls `initializeColumns(getPConnect, columns)` to build `configFields`.
|
|
286
115
|
2. Calls `buildFieldsForTable(configFields)` to produce display column definitions.
|
|
@@ -336,15 +165,7 @@ Columns configured with `displayAsLink: true` (or `additionalDetails.type === 'D
|
|
|
336
165
|
|
|
337
166
|
**Detection logic:**
|
|
338
167
|
|
|
339
|
-
|
|
340
|
-
const AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket'];
|
|
341
|
-
|
|
342
|
-
// A column is a link if:
|
|
343
|
-
const isLink = column.displayAsLink;
|
|
344
|
-
|
|
345
|
-
// It's an assignment link if its classID is a worklist/workbasket class:
|
|
346
|
-
const isAssignmentLink = AssignDashObjects.includes(column.classID);
|
|
347
|
-
```
|
|
168
|
+
A column is a link when `column.displayAsLink` is true. It's specifically an assignment link when its `classID` is one of the worklist/workbasket classes in `AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket']` (i.e. `AssignDashObjects.includes(column.classID)`).
|
|
348
169
|
|
|
349
170
|
**Click handling:**
|
|
350
171
|
|
|
@@ -390,30 +211,24 @@ const isAssignmentLink = AssignDashObjects.includes(column.classID);
|
|
|
390
211
|
|
|
391
212
|
## Dependencies
|
|
392
213
|
|
|
393
|
-
-
|
|
394
|
-
- `PCore.getDataApiUtils().getDataAsync()` — data fetching
|
|
395
|
-
-
|
|
214
|
+
- Local utility helpers: an initialization utility, `filterData`, `buildFieldsForTable`, `getConfigFields`, `initializeColumns`.
|
|
215
|
+
- `PCore.getDataApiUtils().getData()` and `PCore.getDataPageUtils().getDataAsync()` — data fetching.
|
|
216
|
+
- `PCore.getAnalyticsUtils().getDataViewMetadata()` — column metadata.
|
|
217
|
+
- The design system's table, pagination, dialog, search, and link components.
|
|
396
218
|
|
|
397
219
|
## Design System Mapping
|
|
398
220
|
|
|
399
221
|
**UI control type:** Full-featured data table with sorting, pagination, search, selection, and filtering.
|
|
400
222
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
| Design System | Table | Pagination | Dialog | Search | Link |
|
|
404
|
-
| ------------------ | -------------------------------------------------------------------------------------- | -------------------------- | ------------------ | ---------------- | ------------------- |
|
|
405
|
-
| Default (CSS only) | `<table>/<thead>/<tbody>` | Custom pagination controls | `<dialog>` element | `<input>` | `<a>` |
|
|
406
|
-
| MUI | `<Table>` + sub-components | `<TablePagination>` | `<Dialog>` | `<TextField>` | `<Link>` |
|
|
407
|
-
| Carbon | `<DataTable>` + `<Table>/<TableHead>/<TableBody>/<TableRow>/<TableCell>/<TableHeader>` | `<Pagination>` | `<Modal>` | `<Search>` | `<Link>` |
|
|
408
|
-
| Ant Design | `<Table>` | Built-in pagination prop | `<Modal>` | `<Input.Search>` | `<Typography.Link>` |
|
|
409
|
-
| Chakra UI | `<Table>` | Custom or `react-table` | `<Modal>` | `<Input>` | `<Link>` |
|
|
410
|
-
| Shadcn/ui | `<Table>` + TanStack Table | Custom pagination | `<Dialog>` | `<Input>` | `<a>` |
|
|
411
|
-
|
|
412
|
-
When implementing in a specific design system:
|
|
223
|
+
When implementing in a specific design system, map the following:
|
|
413
224
|
|
|
414
|
-
- **
|
|
415
|
-
-
|
|
416
|
-
-
|
|
417
|
-
-
|
|
225
|
+
- **Table** → use the DS's data table component with header/body/row/cell sub-components
|
|
226
|
+
- **Pagination** → use the DS's pagination component (page size selector + page navigation)
|
|
227
|
+
- **Search toolbar** → use the DS's search/text-input component in a toolbar area above the table
|
|
228
|
+
- **Link cells** → use the DS's link component for `displayAsLink` columns
|
|
229
|
+
- **Selection** → use radio (single) or checkbox (multi) components per row
|
|
230
|
+
- **Dialog/Modal** → use the DS's dialog for filter dialogs and column menu
|
|
231
|
+
- **Sorting** → use the DS's sort indicator on column headers (e.g., up/down arrows)
|
|
232
|
+
- `bInForm` affects layout — tighten spacing and remove outer chrome when `true`
|
|
418
233
|
- Sorting, pagination, and search all trigger data re-fetches — do not filter client-side for server-paged data
|
|
419
234
|
- Selection mode (`single`/`multi`) requires different controls and callbacks
|