@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
|
@@ -12,13 +12,13 @@ Renders promoted filter controls above a list view. Filter fields are created dy
|
|
|
12
12
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
|
-
- **Registration key:** `PromotedFilters` (in
|
|
15
|
+
- **Registration key:** `PromotedFilters` (in the project's component map)
|
|
16
16
|
- **Category:** Search / Filter template
|
|
17
|
-
- **Extends:**
|
|
17
|
+
- **Extends:** the project's base component interface
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Inputs
|
|
20
20
|
|
|
21
|
-
|
|
|
21
|
+
| Input | Type | Required | Description |
|
|
22
22
|
| ----------------- | ---------- | -------- | ------------------------------------------------------------- |
|
|
23
23
|
| `viewName` | `string` | Yes | Name of the promoted filters view — used as transient item ID |
|
|
24
24
|
| `dataPageName` | `string` | Yes | Data page name passed to `ListView` |
|
|
@@ -27,97 +27,20 @@ Renders promoted filter controls above a list view. Filter fields are created dy
|
|
|
27
27
|
| `isSearchable` | `boolean` | No | Whether the ListView below shows a global search input |
|
|
28
28
|
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
29
29
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
// Sub-component: renders each filter field via PCore.createPConnect
|
|
45
|
-
function Filters({ filters, transientItemID, localeReference }) {
|
|
46
|
-
return filters.map((filter, index) => {
|
|
47
|
-
const filterClone = { ...filter };
|
|
48
|
-
if (!SUPPORTED_TYPES_IN_PROMOTED_FILTERS.includes(filterClone.type)) {
|
|
49
|
-
filterClone.type = 'TextInput';
|
|
50
|
-
delete filterClone.config.placeholder;
|
|
51
|
-
}
|
|
52
|
-
filterClone.config.contextName = transientItemID;
|
|
53
|
-
filterClone.config.readOnly = false;
|
|
54
|
-
filterClone.config.context = transientItemID;
|
|
55
|
-
filterClone.config.localeReference = localeReference;
|
|
56
|
-
const c11nEnv = PCore.createPConnect({
|
|
57
|
-
meta: filterClone,
|
|
58
|
-
options: { hasForm: true, contextName: transientItemID },
|
|
59
|
-
});
|
|
60
|
-
return <React.Fragment key={index}>{createElement(PConnectComponent, c11nEnv)}</React.Fragment>;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default function PromotedFilters(props: PromotedFilterProps) {
|
|
65
|
-
const ListView = getComponentFromRegistry('ListView');
|
|
66
|
-
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
67
|
-
const { getPConnect, viewName, filters, listViewProps, pageClass, parameters } = props;
|
|
68
|
-
const [initTable, setInitTable] = useState(false);
|
|
69
|
-
const [payload, setPayload] = useState({});
|
|
70
|
-
|
|
71
|
-
// 1. Build transient item on mount (useMemo)
|
|
72
|
-
const filtersProperties = {};
|
|
73
|
-
filters.forEach(f => { filtersProperties[PCore.getAnnotationUtils().getPropertyName(f.config.value)] = ''; });
|
|
74
|
-
const transientItemID = useMemo(() => {
|
|
75
|
-
return getPConnect().getContainerManager().addTransientItem({
|
|
76
|
-
id: viewName, data: { ...filtersProperties, classID: pageClass },
|
|
77
|
-
});
|
|
78
|
-
}, []);
|
|
79
|
-
|
|
80
|
-
// 2. Search handler: read form changes, format filters, set payload
|
|
81
|
-
const getFilterData = useCallback((e) => {
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
const changes = PCore.getFormUtils().getChanges(transientItemID);
|
|
84
|
-
const formValues = {};
|
|
85
|
-
Object.keys(changes).forEach(key => {
|
|
86
|
-
if (!['context_data','pageInstructions'].includes(key)) formValues[key] = changes[key];
|
|
87
|
-
});
|
|
88
|
-
const promotedFilters = formatPromotedFilters(formValues);
|
|
89
|
-
if (PCore.getFormUtils().isFormValid(transientItemID) && isValidInput(formValues)) {
|
|
90
|
-
setInitTable(true);
|
|
91
|
-
const Query: any = { dataViewParameters: parameters };
|
|
92
|
-
if (!isEmptyObject(promotedFilters)) Query.query = { filter: { filterConditions: promotedFilters } };
|
|
93
|
-
setPayload(Query);
|
|
94
|
-
}
|
|
95
|
-
}, [transientItemID]);
|
|
96
|
-
|
|
97
|
-
// 3. Clear handler
|
|
98
|
-
const clearFilterData = useCallback(() => {
|
|
99
|
-
PCore.getContainerUtils().clearTransientData(transientItemID);
|
|
100
|
-
setInitTable(false);
|
|
101
|
-
getPConnect()?.getListActions?.()?.setSelectedRows([]);
|
|
102
|
-
}, [transientItemID]);
|
|
103
|
-
|
|
104
|
-
// 4. Render: title + filter fields + Clear/Search buttons + conditional ListView
|
|
105
|
-
return (
|
|
106
|
-
<>
|
|
107
|
-
<div>{listViewProps.title}</div>
|
|
108
|
-
<div className="psdk-grid-filter">
|
|
109
|
-
<Filters filters={filters} transientItemID={transientItemID}
|
|
110
|
-
localeReference={listViewProps.localeReference} />
|
|
111
|
-
</div>
|
|
112
|
-
<div>
|
|
113
|
-
<ClearButton onClick={clearFilterData}>Clear</ClearButton>
|
|
114
|
-
<SearchButton onClick={getFilterData}>Search</SearchButton>
|
|
115
|
-
</div>
|
|
116
|
-
{initTable && <ListView {...listViewProps} title="" payload={payload} isSearchable />}
|
|
117
|
-
</>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
```
|
|
30
|
+
## Implementation Structure
|
|
31
|
+
|
|
32
|
+
**Constants:** Define a `SUPPORTED_TYPES_IN_PROMOTED_FILTERS` list containing field types that can be rendered as filters directly: `TextInput`, `Percentage`, `Email`, `Integer`, `Decimal`, `Checkbox`, `DateTime`, `Date`, `Time`, `Text`, `TextArea`, `Currency`, `URL`, `RichText`.
|
|
33
|
+
|
|
34
|
+
**Filters Sub-Component** — accepts `filters`, `transientItemID`, and `localeReference`. For each filter: clone the filter object; if its `type` is not in the supported types list, coerce it to `'TextInput'` and remove its `config.placeholder`; set `config.contextName`, `config.readOnly = false`, `config.context`, and `config.localeReference` on the clone; create a PConnect environment via `PCore.createPConnect({ meta: filterClone, options: { hasForm: true, contextName: transientItemID } })`; and render the resulting component via the project's component registry bridge component.
|
|
35
|
+
|
|
36
|
+
**Main Component Logic** — steps in order:
|
|
37
|
+
|
|
38
|
+
1. Retrieve the `ListView` component from the project's component registry; bind `localizedVal` to `PCore.getLocaleUtils().getLocaleValue`.
|
|
39
|
+
2. Receive inputs: `getPConnect`, `viewName`, `filters`, `listViewProps`, `pageClass`, and `parameters`. Initialize local state for `initTable` (boolean, default `false`) and `payload` (object, default `{}`).
|
|
40
|
+
3. Build a transient item on mount (memoized computation, empty dependency list): construct a `filtersProperties` object mapping each filter's resolved property name (via `PCore.getAnnotationUtils().getPropertyName(f.config.value)`) to an empty string, then call `getPConnect().getContainerManager().addTransientItem({ id: viewName, data: { ...filtersProperties, classID: pageClass } })` and store the resulting `transientItemID`.
|
|
41
|
+
4. Define a cached callback search handler (keyed on `transientItemID`) that: prevents the default event; reads form changes via `PCore.getFormUtils().getChanges(transientItemID)`; builds a `formValues` object from those changes, excluding the `context_data` and `pageInstructions` keys; formats the values into `promotedFilters` via a `formatPromotedFilters` helper; and, if the form is valid (`PCore.getFormUtils().isFormValid(transientItemID)`) and the input passes `isValidInput(formValues)`, sets `initTable` to `true` and builds a query object (`{ dataViewParameters: parameters }`, adding a `query.filter.filterConditions` when `promotedFilters` is non-empty) and stores it in the payload local state.
|
|
42
|
+
5. Define a cached callback clear handler (keyed on `transientItemID`) that clears the transient data via `PCore.getContainerUtils().clearTransientData(transientItemID)`, resets `initTable` to `false`, and clears any selected rows via `getPConnect()?.getListActions?.()?.setSelectedRows([])`.
|
|
43
|
+
6. Render: the `listViewProps.title` in a heading element; the Filters sub-component (passed `filters`, `transientItemID`, and `listViewProps.localeReference`); a container with a Clear button (wired to the clear handler) and a Search button (wired to the search handler); and, when `initTable` is true, a `ListView` spread with `listViewProps`, an empty `title`, the computed `payload`, and `isSearchable` set.
|
|
121
44
|
|
|
122
45
|
## Behavioral Contract
|
|
123
46
|
|
|
@@ -125,51 +48,42 @@ export default function PromotedFilters(props: PromotedFilterProps) {
|
|
|
125
48
|
|
|
126
49
|
On mount:
|
|
127
50
|
|
|
128
|
-
1. Build `filtersWithClassID`:
|
|
129
|
-
2. Call `
|
|
130
|
-
3. This creates a transient data context for the filter fields
|
|
51
|
+
1. Build `filtersWithClassID`: map each filter's property name (via `PCore.getAnnotationUtils().getPropertyName(filter.config.value)`) to an empty string, then add `classID` from `pageClass`.
|
|
52
|
+
2. Call `getPConnect().getContainerManager().addTransientItem({ id: viewName, data: filtersWithClassID })`.
|
|
53
|
+
3. This creates a transient data context for the filter fields and returns a `transientItemID`.
|
|
131
54
|
|
|
132
55
|
### Filters Sub-Component
|
|
133
56
|
|
|
134
|
-
The
|
|
57
|
+
The Filters sub-component:
|
|
135
58
|
|
|
136
|
-
1. Creates each filter field via `PCore.createPConnect({
|
|
137
|
-
2.
|
|
59
|
+
1. Creates each filter field via `PCore.createPConnect({ meta: filterClone, options: { hasForm: true, contextName: transientItemID } })`.
|
|
60
|
+
2. If the filter type is not in `SUPPORTED_TYPES_IN_PROMOTED_FILTERS`, coerces it to `TextInput` and removes the placeholder.
|
|
61
|
+
3. Renders each created PConnect as a field component via the project's component registry bridge.
|
|
138
62
|
|
|
139
63
|
### Search
|
|
140
64
|
|
|
141
65
|
On Search button click:
|
|
142
66
|
|
|
143
|
-
1.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
67
|
+
1. Prevent default form submission.
|
|
68
|
+
2. Read form changes via `PCore.getFormUtils().getChanges(transientItemID)`.
|
|
69
|
+
3. Build `formValues` from the changes, excluding `context_data` and `pageInstructions` keys.
|
|
70
|
+
4. Format filter values via `formatPromotedFilters`: for each non-empty field, build `{ lhs: { field }, comparator: 'EQ', rhs: { value } }`.
|
|
71
|
+
5. Validate with `PCore.getFormUtils().isFormValid(transientItemID)` and `isValidInput(formValues)`.
|
|
72
|
+
6. If valid, set `initTable` to true and build a query object with `dataViewParameters` and, if filters are non-empty, `query.filter.filterConditions`.
|
|
73
|
+
7. Store the query in payload local state — `ListView` re-fetches with the filter payload.
|
|
149
74
|
|
|
150
75
|
### Clear
|
|
151
76
|
|
|
152
77
|
On Clear button click:
|
|
153
78
|
|
|
154
|
-
1. Call `
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
79
|
+
1. Call `PCore.getContainerUtils().clearTransientData(transientItemID)`.
|
|
80
|
+
2. Reset `initTable` to `false`.
|
|
81
|
+
3. Clear any selected rows via `getPConnect()?.getListActions?.()?.setSelectedRows([])`.
|
|
82
|
+
4. `ListView` re-fetches without filters.
|
|
158
83
|
|
|
159
84
|
### Render Structure
|
|
160
85
|
|
|
161
|
-
|
|
162
|
-
<div className="psdk-promoted-filters">
|
|
163
|
-
<div className="psdk-promoted-filters-fields">
|
|
164
|
-
<Filters /> {/* filter fields */}
|
|
165
|
-
</div>
|
|
166
|
-
<div className="psdk-promoted-filters-actions">
|
|
167
|
-
<Button onClick={handleClear}>Clear</Button>
|
|
168
|
-
<Button onClick={handleSearch}>Search</Button>
|
|
169
|
-
</div>
|
|
170
|
-
<ListView bInForm={true} isSearchable={isSearchable} dataPageName={dataPageName} payload={activePayload} />
|
|
171
|
-
</div>
|
|
172
|
-
```
|
|
86
|
+
An outer container holding: a title heading element; a fields container with the Filters sub-component; an actions container with Clear and Search buttons (localized via `PCore.getLocaleUtils().getLocaleValue('Clear', 'SimpleTable')` and `PCore.getLocaleUtils().getLocaleValue('Search', 'SimpleTable')`); and a `ListView` below (shown only when `initTable` is true), receiving `listViewProps`, an empty `title`, the active `payload`, and `isSearchable` set.
|
|
173
87
|
|
|
174
88
|
## Visual Specifications
|
|
175
89
|
|
|
@@ -179,44 +93,40 @@ On Clear button click:
|
|
|
179
93
|
| Action buttons | Clear + Search buttons, right-aligned |
|
|
180
94
|
| ListView | Below the filter row, full width |
|
|
181
95
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
-
|
|
185
|
-
- Filter fields row: `display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end`.
|
|
186
|
-
- Action buttons row: `display: flex; gap: 0.5rem; justify-content: flex-end`.
|
|
96
|
+
- Outer container: vertical flex layout with 1rem gap.
|
|
97
|
+
- Filter fields row: horizontal flex layout, wrapping enabled, 0.5rem gap, items aligned to bottom.
|
|
98
|
+
- Action buttons row: horizontal flex layout, 0.5rem gap, justified to end.
|
|
187
99
|
|
|
188
100
|
## Edge Cases & Special Logic
|
|
189
101
|
|
|
190
|
-
- Transient item must be cleaned up on unmount: call `PCore.
|
|
191
|
-
-
|
|
102
|
+
- Transient item must be cleaned up on unmount: call `PCore.getContainerUtils().clearTransientData(transientItemID)` or equivalent lifecycle cleanup.
|
|
103
|
+
- The search handler skips empty values — a filter with no input is not sent to the query.
|
|
192
104
|
- If all filters are empty, the Search returns unfiltered results.
|
|
193
|
-
- `PCore.createPConnect` creates new
|
|
105
|
+
- `PCore.createPConnect` creates new PConnect instances for each filter — these must be properly keyed and managed.
|
|
106
|
+
- `isValidInput` returns true only if at least one filter value is truthy.
|
|
194
107
|
|
|
195
108
|
## Dependencies
|
|
196
109
|
|
|
197
|
-
- `
|
|
198
|
-
- `
|
|
199
|
-
- `PCore.
|
|
200
|
-
- `
|
|
201
|
-
- `
|
|
202
|
-
-
|
|
110
|
+
- `formatPromotedFilters` — builds EQ filter condition objects from form values
|
|
111
|
+
- `isValidInput` — validates that at least one filter field has a value
|
|
112
|
+
- `PCore.getContainerManager().addTransientItem()` — transient context setup
|
|
113
|
+
- `PCore.getContainerUtils().clearTransientData()` — transient context teardown
|
|
114
|
+
- `PCore.getFormUtils().getChanges()` — reads transient form state
|
|
115
|
+
- `PCore.getFormUtils().isFormValid()` — validates transient form
|
|
116
|
+
- `PCore.getAnnotationUtils().getPropertyName()` — resolves property names from value references
|
|
117
|
+
- `PCore.createPConnect()` — creates PConnect instances for filter fields
|
|
118
|
+
- `PCore.getLocaleUtils().getLocaleValue()` — localizes button labels
|
|
119
|
+
- `ListView` — the list below the filters (from the project's component registry)
|
|
203
120
|
|
|
204
121
|
## Design System Mapping
|
|
205
122
|
|
|
206
123
|
**UI control type:** Filter bar above a list view — transient field inputs + Clear/Search actions.
|
|
207
124
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
| Design System | Filter Row | Action Buttons |
|
|
211
|
-
| ------------------ | ---------------------------------------------- | ------------------------------------ |
|
|
212
|
-
| Default (CSS only) | `display: flex; flex-wrap: wrap` inputs | `<button>` for Clear/Search |
|
|
213
|
-
| MUI | `<Box display='flex' flexWrap='wrap' gap={1}>` | `<Button>` variants |
|
|
214
|
-
| Ant Design | `<Space wrap>` | `<Button type='primary'>` for Search |
|
|
215
|
-
| Chakra UI | `<HStack wrap='wrap'>` | `<Button colorScheme='blue'>` |
|
|
216
|
-
| Shadcn/ui | Tailwind `flex flex-wrap gap-2` | `<Button>` variants |
|
|
125
|
+
When implementing in a specific design system, use the appropriate button component for Clear and Search actions, and a horizontal flex/wrap layout for the filter fields row. The filter fields themselves are rendered dynamically via PConnect and will use whatever field components are registered in the project's component registry. Each design system will have its own equivalents for the action buttons and layout containers.
|
|
217
126
|
|
|
218
|
-
|
|
127
|
+
Design considerations:
|
|
219
128
|
|
|
220
129
|
- Transient data pattern is critical — each filter field must read/write to `PCore`'s transient store
|
|
221
|
-
- `
|
|
130
|
+
- The `formatPromotedFilters` helper builds the query filter payload — use it unchanged
|
|
222
131
|
- Transient item cleanup on unmount is required to avoid stale data
|
|
132
|
+
- Button labels must be localized via `PCore.getLocaleUtils().getLocaleValue`
|
package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md
CHANGED
|
@@ -12,78 +12,56 @@ A case view variant designed for self-service portal channels. Uses a horizontal
|
|
|
12
12
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
|
-
- **Registration key:** `SelfServiceCaseView` (in
|
|
15
|
+
- **Registration key:** `SelfServiceCaseView` (in the project's component map)
|
|
16
16
|
- **Category:** Page template — self-service case workspace
|
|
17
|
-
- **Extends:**
|
|
18
|
-
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| `children`
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// 3. Region assignment by child index
|
|
55
|
-
const renderedRegions = isObjectType
|
|
56
|
-
? { caseSummary: children[0], utilities: filterUtilities(children[2]) }
|
|
57
|
-
: { caseSummary: children[0], stages: children[1], todo: children[2], utilities: filterUtilities(children[4]) };
|
|
58
|
-
|
|
59
|
-
// 4. Filter summary fields for self-service channel
|
|
60
|
-
const { primarySummaryFields, secondarySummaryFields } = prepareCaseSummaryData(
|
|
61
|
-
renderedRegions.caseSummary,
|
|
62
|
-
(config) => config?.availableInChannel?.selfService === true
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
// 5. Utilities visibility check
|
|
66
|
-
const showUtilities = bShowUtilitiesRegion && isUtilitiesRegionNotEmpty();
|
|
67
|
-
const showSummary = bShowSummaryRegion && (primarySummaryFields.length > 0 || secondarySummaryFields.length > 0);
|
|
68
|
-
|
|
69
|
-
// 6. Render: header bar + flex row (summary 25% | main flex:1 | utilities 25%)
|
|
70
|
-
return (
|
|
71
|
-
<div>
|
|
72
|
-
<HeaderBar>{header} {bShowCaseActions && <CaseViewActionsMenu ... />}</HeaderBar>
|
|
73
|
-
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
|
74
|
-
{showSummary && <div style={{ flex: '0 0 25%' }}><CaseSummary ... /></div>}
|
|
75
|
-
<div style={{ flex: 1 }}>{bShowCaseLifecycle && renderedRegions.stages}{renderedRegions.todo}</div>
|
|
76
|
-
{showUtilities && <div style={{ flex: '0 0 25%' }}>{renderedRegions.utilities}</div>}
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
```
|
|
17
|
+
- **Extends:** the project's base component interface
|
|
18
|
+
|
|
19
|
+
## Inputs
|
|
20
|
+
|
|
21
|
+
| Name | Type | Required | Description |
|
|
22
|
+
| --------------------- | ------------------- | -------- | ---------------------------------------------------------------------------------------- |
|
|
23
|
+
| `children` | renderable content | Yes | Region children (variable count based on `isObjectType`) |
|
|
24
|
+
| `icon` | `string` | No | Icon identifier for the case type avatar |
|
|
25
|
+
| `header` | `string` | Yes | Case type display name / header text |
|
|
26
|
+
| `subheader` | `string` | No | Secondary header text (typically case ID) |
|
|
27
|
+
| `showCaseLifecycle` | `boolean \| string` | No | Whether to show the lifecycle/stages region (default `true`) |
|
|
28
|
+
| `showSummaryRegion` | `boolean \| string` | No | Whether to show the summary column (default `true`) |
|
|
29
|
+
| `showUtilitiesRegion` | `boolean \| string` | No | Whether to show the utilities column (default `true`) |
|
|
30
|
+
| `showCaseActions` | `boolean \| string` | No | Whether to show the actions menu (default `true`) |
|
|
31
|
+
| `caseClass` | `string` | No | Case class used to determine object-type behavior |
|
|
32
|
+
| `caseInfo` | `object` | No | Object containing `availableActions`, `availableProcesses`, `caseTypeID`, `caseTypeName` |
|
|
33
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
34
|
+
|
|
35
|
+
## Implementation Structure
|
|
36
|
+
|
|
37
|
+
**Module Setup:** The component needs the project's component registry (to retrieve `CaseViewActionsMenu` and `CaseSummary` at runtime), a `prepareCaseSummaryData` utility for filtering summary fields, a `filterUtilities` utility for filtering non-self-service utilities, a `Utils` helper for resolving image sources, and companion styles for the layout and header.
|
|
38
|
+
|
|
39
|
+
**Main Component Logic** — steps in order:
|
|
40
|
+
|
|
41
|
+
1. Retrieve `CaseViewActionsMenu` and `CaseSummary` from the project's component registry.
|
|
42
|
+
2. Receive inputs: `icon` (default `''`), `getPConnect`, `header`, `subheader`, `showCaseLifecycle`/`showSummaryRegion`/`showUtilitiesRegion`/`showCaseActions` (each defaulting to `true`), `children`, `caseClass`, and `caseInfo` fields (`availableActions`, `availableProcesses`, `caseTypeID`, `caseTypeName`, each with sensible defaults); call `getPConnect()` once and reuse the result.
|
|
43
|
+
3. Coerce the four `show*` boolean-ish inputs (which may arrive as strings) to real booleans by checking `p === true || p === 'true'` for each.
|
|
44
|
+
4. Determine `isObjectType` via `PCore.getCaseUtils().isObjectCaseType(caseClass)` — this affects how children are indexed.
|
|
45
|
+
5. Get the locale key via `pConnect.getCaseLocaleReference()`.
|
|
46
|
+
6. Resolve the case icon image source via `Utils.getImageSrc(icon, Utils.getSDKStaticConentUrl())`.
|
|
47
|
+
7. **Assign regions using TWO parallel arrays:** rendered children (for display) and PConnect child envs (for metadata access). Get `renderChildren` from the framework's content projection input (as a renderable array). Get `pConnChildren` from `pConnect.getChildren()` (PConnect child envs that DO have `getPConnect` methods). Index both by the same positions. For rendering: `stagesElement = renderChildren[1]`, `todoElement = renderChildren[2]`, `utilitiesElement = renderChildren[4]` (non-object) or `mainElement = renderChildren[1]`, `utilitiesElement = renderChildren[2]` (object). For metadata: `summaryEnv = pConnChildren[0]`, `utilitiesEnv = pConnChildren[4]` (non-object) or `pConnChildren[2]` (object). **Do NOT call `.getPConnect()` on rendered children** — they are rendered elements without a direct `getPConnect` method.
|
|
48
|
+
8. Filter summary fields for the self-service channel: call `prepareCaseSummaryData(summaryEnv, filterFn)` where `summaryEnv` is from `pConnChildren` (not from rendered children). The helper calls `summaryEnv.getPConnect().getChildren()` which works because PConnect child envs have `getPConnect` methods.
|
|
49
|
+
9. Compute utilities visibility: `isUtilitiesRegionNotEmpty(utilitiesEnv)` uses the PConnect child env (from `pConnChildren`) to check whether utilities have visible children.
|
|
50
|
+
10. Compute visibility flags: `showUtilities` is true when `bShowUtilitiesRegion` and `isUtilitiesRegionNotEmpty()`; `showSummary` is true when `bShowSummaryRegion` and either summary field list is non-empty.
|
|
51
|
+
11. Render a self-service header bar (class `selfServiceCaseViewHeader`) showing the localized `header` text and (when `bShowCaseActions`) the `CaseViewActionsMenu` component with the action inputs passed through.
|
|
52
|
+
12. Below the header, render a horizontal flex row with three sections: the summary region at `flex: 0 0 25%` (rendered only when `showSummary`, containing a card with the case icon avatar, localized header, subheader, dividers, and the `CaseSummary` component with `arPrimaryFields` and `arSecondaryFields`); the main content area at `flex: 1` (containing the stages element directly when `bShowCaseLifecycle`, followed by the todo/main element directly); and the utilities region at `flex: 0 0 25%` (rendered only when `showUtilities`, rendering the utilities element directly). **Render children directly in the template** — do NOT pass them through the PConnect bridge component.
|
|
82
53
|
|
|
83
54
|
## Behavioral Contract
|
|
84
55
|
|
|
85
56
|
### Region Assignment by Child Index
|
|
86
57
|
|
|
58
|
+
> ⚠️ **CRITICAL:** Use TWO parallel arrays for child access:
|
|
59
|
+
>
|
|
60
|
+
> - `renderChildren` (from the framework's content projection input) — for RENDERING regions directly in the template
|
|
61
|
+
> - `pConnChildren` (from `pConnect.getChildren()`) — for METADATA access (filtering, field extraction)
|
|
62
|
+
>
|
|
63
|
+
> **Do NOT call `.getPConnect()` on rendered children** — they are rendered elements without a direct `getPConnect` method. Only PConnect child envs (from `pConnect.getChildren()`) have `getPConnect`.
|
|
64
|
+
|
|
87
65
|
Child indexing depends on `isObjectType`:
|
|
88
66
|
|
|
89
67
|
**`isObjectType === false` (5 children):**
|
|
@@ -106,45 +84,34 @@ Child indexing depends on `isObjectType`:
|
|
|
106
84
|
|
|
107
85
|
Show/hide individual regions based on:
|
|
108
86
|
|
|
109
|
-
- `showSummary`:
|
|
87
|
+
- `showSummary`: show summary only when the region has filtered content.
|
|
110
88
|
- `showMain`: always show main content region.
|
|
111
|
-
- `showUtilities`: show utilities only if the region has
|
|
89
|
+
- `showUtilities`: show utilities only if the region has visible children.
|
|
112
90
|
|
|
113
|
-
###
|
|
91
|
+
### Self-Service Case View Header
|
|
114
92
|
|
|
115
93
|
Renders a slim header bar above the main flex layout showing:
|
|
116
94
|
|
|
117
|
-
-
|
|
118
|
-
-
|
|
95
|
+
- Localized header text via `PCore.getLocaleUtils().getLocaleValue(header, '', localeKey)`
|
|
96
|
+
- The `CaseViewActionsMenu` component (when `bShowCaseActions` is true)
|
|
119
97
|
|
|
120
98
|
### Case Summary Data
|
|
121
99
|
|
|
122
|
-
Call `prepareCaseSummaryData(
|
|
100
|
+
Call `prepareCaseSummaryData(summaryEnv, filterFn)` where `summaryEnv` is a PConnect child env (from `pConnect.getChildren()`, NOT from rendered children). The helper accesses `summaryEnv.getPConnect().getChildren()` to iterate region children.
|
|
123
101
|
|
|
124
102
|
- Only include fields where `availableInChannel.selfService === true`.
|
|
125
103
|
|
|
126
104
|
### Utilities Filter
|
|
127
105
|
|
|
128
|
-
|
|
106
|
+
The `isUtilitiesRegionNotEmpty` function uses the PConnect child env (from `pConnect.getChildren()`) to access `utilitiesEnv.getPConnect().getChildren()` and check visibility.
|
|
107
|
+
|
|
108
|
+
### Utilities Visibility Check
|
|
109
|
+
|
|
110
|
+
Uses the PConnect child env — NOT the rendered element — to access children metadata via `getPConnect().getChildren()` and verify at least one child has `getConfigProps().visibility !== false`.
|
|
129
111
|
|
|
130
112
|
### Render Structure
|
|
131
113
|
|
|
132
|
-
|
|
133
|
-
<div className="psdk-ss-case-view">
|
|
134
|
-
<selfServiceCaseViewHeader />
|
|
135
|
-
<div className="psdk-ss-case-view-body" style="display:flex; flex-direction:row">
|
|
136
|
-
<div style="flex: 0 0 25%"> {/* Summary */}
|
|
137
|
-
{showSummary && summaryRegion}
|
|
138
|
-
</div>
|
|
139
|
-
<div style="flex: 1"> {/* Main content */}
|
|
140
|
-
{showMain && mainRegion}
|
|
141
|
-
</div>
|
|
142
|
-
<div style="flex: 0 0 25%"> {/* Utilities */}
|
|
143
|
-
{showUtilities && utilitiesRegion}
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
```
|
|
114
|
+
An outer container holding the self-service header (`psdk-ss-case-view-header` or equivalent class), followed by a flex row body (`display: flex; flex-direction: row`) with three children: a `flex: 0 0 25%` box showing the summary card when `showSummary` is true; a `flex: 1` box showing the main region; and a `flex: 0 0 25%` box showing the utilities region when `showUtilities` is true.
|
|
148
115
|
|
|
149
116
|
## Visual Specifications
|
|
150
117
|
|
|
@@ -154,45 +121,53 @@ Call `filterUtilities(utilitiesChildren, getPConnect)` to remove utilities not a
|
|
|
154
121
|
| Main | flex: 1 | Main case content / assignment form |
|
|
155
122
|
| Utilities | 25% (fixed) | Filtered utilities |
|
|
156
123
|
|
|
157
|
-
**
|
|
124
|
+
**Companion styles:**
|
|
158
125
|
|
|
159
126
|
- Body layout: `display: flex; flex-direction: row; gap: 1rem`.
|
|
160
127
|
- Summary column: `flex: 0 0 25%; min-width: 0`.
|
|
161
128
|
- Main column: `flex: 1 1 auto; min-width: 0`.
|
|
162
129
|
- Utilities column: `flex: 0 0 25%; min-width: 0`.
|
|
163
|
-
- Header bar: `display: flex;
|
|
130
|
+
- Header bar: `margin: 10px 8px 0 8px; height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 0 8px`. Background uses the primary light color with contrasting text.
|
|
131
|
+
- Summary card root: padding and margin of one spacing unit on all sides.
|
|
132
|
+
- Summary card header: uses the info light background with contrasting text, rounded corners.
|
|
133
|
+
- Case icon box: info dark background, fixed size (e.g. 64x64), with padding.
|
|
164
134
|
- Responsive: collapse to single column on mobile.
|
|
165
135
|
|
|
166
136
|
## Edge Cases & Special Logic
|
|
167
137
|
|
|
168
138
|
- `isObjectType` changes the number of `children` — always derive regions by index based on this flag.
|
|
169
|
-
- `filterUtilities` may return empty array — `showUtilities` should be `false` in that case (hide the column entirely).
|
|
170
|
-
- Summary fields filtered by `availableInChannel.selfService` — if all fields are filtered out, the summary column
|
|
139
|
+
- `filterUtilities` may return an empty array — `showUtilities` should be `false` in that case (hide the column entirely).
|
|
140
|
+
- Summary fields filtered by `availableInChannel.selfService` — if all fields are filtered out, the summary column is hidden.
|
|
171
141
|
- The self-service header differs from the standard case header — it is a separate sub-component, not the full `CaseView` header.
|
|
142
|
+
- The four `show*` inputs may arrive as string `"true"`/`"false"` — coerce to boolean before use.
|
|
172
143
|
|
|
173
144
|
## Dependencies
|
|
174
145
|
|
|
175
|
-
- `prepareCaseSummaryData` from
|
|
176
|
-
- `filterUtilities` from
|
|
177
|
-
- `
|
|
178
|
-
- `
|
|
146
|
+
- `prepareCaseSummaryData` from the template utilities — with self-service channel filter applied
|
|
147
|
+
- `filterUtilities` from the template utilities — removes non-self-service utilities
|
|
148
|
+
- `Utils.getImageSrc` / `Utils.getSDKStaticConentUrl` — resolves case icon image paths
|
|
149
|
+
- `PCore.getCaseUtils().isObjectCaseType()` — determines child region indexing
|
|
150
|
+
- `PCore.getLocaleUtils().getLocaleValue()` — header localization
|
|
151
|
+
- `pConnect.getCaseLocaleReference()` — locale key for the case
|
|
152
|
+
- The project's component registry — to retrieve `CaseViewActionsMenu` and `CaseSummary`
|
|
153
|
+
- The project's base component interface
|
|
179
154
|
|
|
180
155
|
## Design System Mapping
|
|
181
156
|
|
|
182
|
-
**UI control type:** Self-service portal case workspace — horizontal 3-panel flex layout.
|
|
157
|
+
**UI control type:** Self-service portal case workspace — horizontal 3-panel flex layout with card-based summary.
|
|
183
158
|
|
|
184
|
-
|
|
159
|
+
When implementing in a specific design system, map the following:
|
|
185
160
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
| Shadcn/ui | Tailwind `flex flex-row` | Custom header |
|
|
161
|
+
- **Layout container:** Use the design system's flex/grid primitives for the 3-column row. The key constraint is 25%/flex-1/25% proportions.
|
|
162
|
+
- **Summary card:** Use the design system's card component with a header section (avatar + title + subtitle) and dividers between sections. The header should use the theme's info/primary color.
|
|
163
|
+
- **Avatar/Icon:** Use the design system's avatar component (square variant) with the resolved case icon image.
|
|
164
|
+
- **Header bar:** Use the design system's flex container with space-between alignment. Background should be the theme's primary-light color with contrasting text.
|
|
165
|
+
- **Dividers:** Use the design system's divider/separator component between card sections.
|
|
166
|
+
- **Typography:** Use the design system's heading (h6) for the case name and body text for the case ID.
|
|
193
167
|
|
|
194
|
-
|
|
168
|
+
Key constraints regardless of design system:
|
|
195
169
|
|
|
196
170
|
- `isObjectType` determines child count — do not assume fixed child order without checking this flag
|
|
197
171
|
- Self-service channel filter on summary data is mandatory — `availableInChannel.selfService === true`
|
|
198
172
|
- `filterUtilities` result controls utilities column visibility
|
|
173
|
+
- Utilities visibility requires checking child `getConfigProps().visibility !== false`
|