@pega/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +111 -0
- package/SECURITY.md +10 -0
- package/dist/index.js +753 -0
- package/package.json +41 -0
- package/templates/angular-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/angular-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/angular-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/angular-sdk-reference/angular.json +34 -0
- package/templates/angular-sdk-reference/package.json +31 -0
- package/templates/angular-sdk-reference/sdk-config.json +26 -0
- package/templates/angular-sdk-reference/src/app/app.component.ts +54 -0
- package/templates/angular-sdk-reference/src/index.html +12 -0
- package/templates/angular-sdk-reference/src/main.ts +4 -0
- package/templates/angular-sdk-reference/src/styles.css +19 -0
- package/templates/angular-sdk-reference/tsconfig.json +32 -0
- package/templates/react-native-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/react-native-sdk-reference/App.tsx +51 -0
- package/templates/react-native-sdk-reference/app.json +11 -0
- package/templates/react-native-sdk-reference/package.json +22 -0
- package/templates/react-native-sdk-reference/sdk-config.json +14 -0
- package/templates/react-native-sdk-reference/tsconfig.json +12 -0
- package/templates/react-sdk-reference/.github/copilot-instructions.md +185 -0
- package/templates/react-sdk-reference/.github/instructions/component-map.instructions.md +40 -0
- package/templates/react-sdk-reference/.github/instructions/dse-component.instructions.md +77 -0
- package/templates/react-sdk-reference/.github/instructions/field-component.instructions.md +73 -0
- package/templates/react-sdk-reference/.github/instructions/template-component.instructions.md +94 -0
- package/templates/react-sdk-reference/.github/instructions/widget-component.instructions.md +89 -0
- package/templates/react-sdk-reference/.github/prompts/add-component.prompt.md +21 -0
- package/templates/react-sdk-reference/.github/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.github/prompts/identify-components.prompt.md +110 -0
- package/templates/react-sdk-reference/.github/prompts/replace-all-fields.prompt.md +48 -0
- package/templates/react-sdk-reference/.github/prompts/replace-component.prompt.md +81 -0
- package/templates/react-sdk-reference/.github/prompts/replace-design-system.prompt.md +524 -0
- package/templates/react-sdk-reference/.github/prompts/replace-field.prompt.md +41 -0
- package/templates/react-sdk-reference/.github/prompts/swap-design-system.prompt.md +49 -0
- package/templates/react-sdk-reference/.github/skills/component-contracts.md +140 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/AlertBanner.md +135 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Banner.md +149 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/CaseSummaryFields.md +154 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/DetailsFields.md +144 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroup.md +131 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroupList.md +111 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldValueList.md +115 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Operator.md +149 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Pulse.md +83 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/RichTextEditor.md +206 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/WssQuickCreate.md +135 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension.md +249 -0
- package/templates/react-sdk-reference/.github/skills/field-components.md +262 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/AutoComplete.md +112 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/CancelAlert.md +203 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Checkbox.md +158 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Currency.md +106 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Date.md +99 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/DateTime.md +103 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Decimal.md +98 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Dropdown.md +114 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Email.md +107 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Group.md +90 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Integer.md +87 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Location.md +136 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Multiselect.md +164 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/ObjectReference.md +164 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Percentage.md +92 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Phone.md +110 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/RadioButtons.md +146 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/RichText.md +138 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/ScalarList.md +124 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/SelectableCard.md +216 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/SemanticLink.md +148 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextArea.md +96 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextContent.md +101 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextInput.md +104 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Time.md +88 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/URL.md +85 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/UserReference.md +180 -0
- package/templates/react-sdk-reference/.github/skills/run-and-verify.md +68 -0
- package/templates/react-sdk-reference/.github/skills/swap-design-system.md +105 -0
- package/templates/react-sdk-reference/.github/skills/template-components.md +285 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/AdvancedSearch.md +144 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/AppShell.md +122 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/BannerPage.md +83 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseSummary.md +100 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseView.md +131 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseViewActionsMenu.md +126 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/Confirmation.md +107 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DataReference.md +120 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultForm.md +102 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultPage.md +110 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/Details.md +88 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsSubTabs.md +95 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsThreeColumn.md +78 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsTwoColumn.md +78 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DynamicTabs.md +101 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/FieldGroupTemplate.md +109 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/HierarchicalForm.md +113 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboard.md +104 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboardPage.md +85 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/ListPage.md +68 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/ListView.md +139 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/MultiReferenceReadOnly.md +80 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/NarrowWide.md +141 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/OneColumn.md +109 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/PromotedFilters.md +124 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SelfServiceCaseView.md +135 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SimpleTable.md +127 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SingleReferenceReadOnly.md +103 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SubTabs.md +79 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/TwoColumn.md +131 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/WideNarrow.md +150 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/WssNavBar.md +135 -0
- package/templates/react-sdk-reference/.github/skills/widget-components.md +234 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/AppAnnouncement.md +82 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/Attachment.md +146 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/CaseHistory.md +107 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/FileUtility.md +200 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/Followers.md +99 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/QuickCreate.md +114 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/SummaryItem.md +167 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/ToDo.md +190 -0
- package/templates/react-sdk-reference/AGENTS.md +59 -0
- package/templates/react-sdk-reference/assets/icons/analytics-good-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/cart-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/headset.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/mobile-phone-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/money-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/multi-device-solid.svg +3 -0
- package/templates/react-sdk-reference/index.html +36 -0
- package/templates/react-sdk-reference/package.json +52 -0
- package/templates/react-sdk-reference/sdk-config.json +26 -0
- package/templates/react-sdk-reference/src/AppSelector.tsx +18 -0
- package/templates/react-sdk-reference/src/FallbackComponent.tsx +40 -0
- package/templates/react-sdk-reference/src/MashupApp.styles.ts +105 -0
- package/templates/react-sdk-reference/src/MashupApp.tsx +254 -0
- package/templates/react-sdk-reference/src/PortalApp.tsx +175 -0
- package/templates/react-sdk-reference/src/components/component-map.ts +255 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/AlertBanner.tsx +91 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/Banner.css +39 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/Banner.tsx +53 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +16 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +270 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/DetailsFields/DetailsFields.tsx +164 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/DetailsFields/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/FieldGroup.tsx +79 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/FieldGroupList.tsx +58 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/FieldValueList.tsx +84 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Operator/Operator.tsx +220 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Operator/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Pulse/Pulse.tsx +33 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Pulse/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/RichTextEditor/RichTextEditor.tsx +201 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.css +33 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +48 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +218 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/config-ext.json +10 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.css +24 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.tsx +148 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +263 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Currency/Currency.tsx +111 -0
- package/templates/react-sdk-reference/src/components/field/Currency/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Currency/currency-utils.ts +67 -0
- package/templates/react-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-sdk-reference/src/components/field/Date/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/DateTime.tsx +101 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/Decimal.tsx +122 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +238 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Email/Email.tsx +96 -0
- package/templates/react-sdk-reference/src/components/field/Email/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Group/Group.tsx +41 -0
- package/templates/react-sdk-reference/src/components/field/Group/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Integer/Integer.tsx +100 -0
- package/templates/react-sdk-reference/src/components/field/Integer/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Location/Location.css +4 -0
- package/templates/react-sdk-reference/src/components/field/Location/Location.tsx +258 -0
- package/templates/react-sdk-reference/src/components/field/Location/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Location/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/Multiselect.tsx +238 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/utils.ts +230 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/ObjectReference.tsx +235 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/utils.ts +111 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/Percentage.tsx +112 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Phone/Phone.tsx +113 -0
- package/templates/react-sdk-reference/src/components/field/Phone/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Phone/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +158 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/RichText/RichText.css +79 -0
- package/templates/react-sdk-reference/src/components/field/RichText/RichText.tsx +98 -0
- package/templates/react-sdk-reference/src/components/field/RichText/config-ext.json +10 -0
- package/templates/react-sdk-reference/src/components/field/RichText/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/ScalarList.tsx +63 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/SelectableCard.tsx +189 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/utils.tsx +223 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/SemanticLink.tsx +208 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/utils.ts +49 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/TextArea.tsx +94 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/TextContent.tsx +46 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/TextInput.tsx +92 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Time/Time.tsx +79 -0
- package/templates/react-sdk-reference/src/components/field/Time/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Time/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/URL/URL.tsx +89 -0
- package/templates/react-sdk-reference/src/components/field/URL/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReference.tsx +198 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReferenceUtils.ts +13 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/helpers/attachmentShared.ts +6 -0
- package/templates/react-sdk-reference/src/components/helpers/case-utils.tsx +99 -0
- package/templates/react-sdk-reference/src/components/helpers/common-utils.ts +26 -0
- package/templates/react-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-sdk-reference/src/components/helpers/date-format-utils.ts +76 -0
- package/templates/react-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-sdk-reference/src/components/helpers/field-group-utils.ts +63 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Boolean.ts +21 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Currency.ts +77 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/CurrencyMap.ts +913 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Date.ts +71 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/common.ts +14 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +130 -0
- package/templates/react-sdk-reference/src/components/helpers/instructions-utils.ts +38 -0
- package/templates/react-sdk-reference/src/components/helpers/object-utils.ts +10 -0
- package/templates/react-sdk-reference/src/components/helpers/reactContextHelpers.ts +3 -0
- package/templates/react-sdk-reference/src/components/helpers/simpleTableHelpers.ts +452 -0
- package/templates/react-sdk-reference/src/components/helpers/state-utils.tsx +43 -0
- package/templates/react-sdk-reference/src/components/helpers/template-utils.ts +76 -0
- package/templates/react-sdk-reference/src/components/helpers/utils.ts +349 -0
- package/templates/react-sdk-reference/src/components/helpers/versionHelpers.ts +14 -0
- package/templates/react-sdk-reference/src/components/index.ts +8 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +329 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/TemplateContext.ts +11 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/AppShell.css +35 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/AppShell.tsx +259 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/BannerPage.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/CaseSummary.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/CaseView.tsx +261 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +117 -0
- package/templates/react-sdk-reference/src/components/template/CaseViewActionsMenu/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/Confirmation.tsx +102 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/config-ext.json +11 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReference.tsx +590 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/SearchForm.tsx +213 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/utils.ts +90 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/DefaultForm.css +34 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +74 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/utils/index.ts +26 -0
- package/templates/react-sdk-reference/src/components/template/DefaultPage/DefaultPage.tsx +108 -0
- package/templates/react-sdk-reference/src/components/template/DefaultPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/Details/Details.tsx +74 -0
- package/templates/react-sdk-reference/src/components/template/Details/Details/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +58 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/config.json +36 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx +116 -0
- package/templates/react-sdk-reference/src/components/template/FieldGroupTemplate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/hooks.ts +293 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx +72 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/InlineDashboardPage.tsx +39 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/ListPage.tsx +16 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListView/DefaultViewMeta.ts +220 -0
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.css +10 -0
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.tsx +1391 -0
- package/templates/react-sdk-reference/src/components/template/ListView/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/ListView/hooks.ts +93 -0
- package/templates/react-sdk-reference/src/components/template/ListView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListView/utils.ts +781 -0
- package/templates/react-sdk-reference/src/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +52 -0
- package/templates/react-sdk-reference/src/components/template/MultiReferenceReadOnly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/NarrowWide.css +19 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/NarrowWide.tsx +37 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +85 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +19 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +22 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +28 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ObjectPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/OneColumn.tsx +32 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/OneColumnPage.tsx +17 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/OneColumnTab.tsx +11 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/PromotedFilters.css +7 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/PromotedFilters.tsx +204 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
- package/templates/react-sdk-reference/src/components/template/SelfServiceCaseView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/SimpleTable.tsx +126 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +985 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +122 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +207 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +71 -0
- package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/SubTabs.tsx +46 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/tabUtils.ts +185 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/TwoColumn.css +12 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/TwoColumn.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +17 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.css +12 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/WideNarrow.css +19 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/WideNarrow.tsx +37 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +96 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +19 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +22 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +28 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/WssNavBar.css +11 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/WssNavBar.tsx +160 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/utils.tsx +58 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/AppAnnouncement.tsx +60 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.css +95 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.tsx +541 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.types.ts +96 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/AttachmentUtils.ts +316 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/CaseHistory.tsx +171 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +13 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +32 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.css +118 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.tsx +653 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/Followers.tsx +43 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/QuickCreate.tsx +88 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/SummaryItem.css +76 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/SummaryItem.tsx +89 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryList/SummaryList.tsx +23 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.css +81 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.tsx +507 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/index.tsx +1 -0
- package/templates/react-sdk-reference/src/main.tsx +13 -0
- package/templates/react-sdk-reference/src/mui-theme-augmentation.d.ts +6 -0
- package/templates/react-sdk-reference/tsconfig.json +24 -0
- package/templates/react-sdk-reference/vite.config.ts +65 -0
- package/templates/wc-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/wc-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/wc-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/wc-sdk-reference/index.html +21 -0
- package/templates/wc-sdk-reference/package.json +19 -0
- package/templates/wc-sdk-reference/sdk-config.json +19 -0
- package/templates/wc-sdk-reference/src/index.ts +98 -0
- package/templates/wc-sdk-reference/tsconfig.json +21 -0
- package/templates/wc-sdk-reference/vite.config.ts +8 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Skill: Attachment
|
|
2
|
+
|
|
3
|
+
File upload/download widget for case attachments. Behaves like a form field — binds to a case attachment property, supports multiple files, validates extensions and size, tracks upload progress, and blocks form submission during active uploads.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Renders a file attachment control within a Pega form. Users can upload one or multiple files, download existing attachments, and delete attachments. The widget validates file extensions and enforces a maximum size from environment config. Upload progress is shown per-file. Form submission is blocked while uploads are in progress via the action sequencer.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Registration key:** `Attachment` (in `component-map.ts`)
|
|
16
|
+
- **Category:** Widget — form field (file input)
|
|
17
|
+
- **Extends:** `Omit<PConnFieldProps, 'value'>` (uses `value: any` instead of the standard string value)
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
|------|------|----------|-------------|
|
|
23
|
+
| `value` | `any` | Yes | Attachment list or single attachment object (from Pega property) |
|
|
24
|
+
| `allowMultiple` | `boolean \| string` | No | Whether multiple files can be attached. Default `false` |
|
|
25
|
+
| `extensions` | `string` | No | Comma-separated list of allowed file extensions (e.g., `".pdf,.doc,.jpg"`) |
|
|
26
|
+
| `editMode` | `string` | No | `"tableRows"` for inline table edit mode (special multi-attachment handling) |
|
|
27
|
+
| `isTableFormatter` | `boolean` | No | Whether this widget is used inside a table formatter |
|
|
28
|
+
| `label` | `string` | Yes (from PConnFieldProps) | Field label |
|
|
29
|
+
| `required` | `boolean` | No | Whether a file is required |
|
|
30
|
+
| `disabled` | `boolean` | No | Whether the control is disabled |
|
|
31
|
+
| `displayMode` | `string` | No | `"DISPLAY_ONLY"` for read-only rendering |
|
|
32
|
+
| `validatemessage` | `string` | No | Validation error message to display |
|
|
33
|
+
| `helperText` | `string` | No | Helper text shown below the control |
|
|
34
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
35
|
+
|
|
36
|
+
## Behavioral Contract
|
|
37
|
+
|
|
38
|
+
### Attachment Format Detection
|
|
39
|
+
|
|
40
|
+
Pega has two attachment data formats — detect which one is in use:
|
|
41
|
+
|
|
42
|
+
**Old format (annotation-based):**
|
|
43
|
+
```typescript
|
|
44
|
+
value = { pxResults: [...], pyAttachCount: N }
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**New standard format:**
|
|
48
|
+
```typescript
|
|
49
|
+
value = [{ ID, name, mimeType, category, ... }] // array
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Call `PCore.getAttachmentUtils().prepareAttachmentData(value)` to normalize both formats into a unified `FileObject[]` array.
|
|
53
|
+
|
|
54
|
+
### File Validation
|
|
55
|
+
|
|
56
|
+
On file selection (via `<input type='file'>`):
|
|
57
|
+
1. **Extension check:** Compare selected file's extension against `extensions` prop (split by comma). If not allowed, add an error to the file and do not upload.
|
|
58
|
+
2. **Size check:** Compare file size against `PCore.getEnvironmentInfo().getMaxAttachmentSize()` (in bytes). If too large, add a size error.
|
|
59
|
+
3. Valid files proceed to upload.
|
|
60
|
+
|
|
61
|
+
### Upload Flow
|
|
62
|
+
|
|
63
|
+
1. Call `PCore.getActionsSequencer().addAction('attachment_upload_' + fileId)` — blocks form submission.
|
|
64
|
+
2. Call `PCore.getAttachmentUtils().uploadAttachment(file, onProgress, onError, context)`.
|
|
65
|
+
3. On progress: update per-file `progress` value (0–100) in state.
|
|
66
|
+
4. On success: add the returned attachment metadata to the local file list; update the Pega property via `pConn.setReferenceList(newAttachmentList)`.
|
|
67
|
+
5. Call `PCore.getActionsSequencer().removeAction('attachment_upload_' + fileId)` — unblocks form submission.
|
|
68
|
+
6. On error: set file error state; call `PCore.getMessageManager().addMessages([errorMessage])`.
|
|
69
|
+
|
|
70
|
+
### Download
|
|
71
|
+
|
|
72
|
+
Call `PCore.getAttachmentUtils().downloadAttachment(attachmentID, context)` — triggers browser file download.
|
|
73
|
+
|
|
74
|
+
### Delete
|
|
75
|
+
|
|
76
|
+
Remove the attachment from the local list and update `pConn.setReferenceList(updatedList)`. Do not call a separate delete API in the reference implementation — deletion is committed on form save.
|
|
77
|
+
|
|
78
|
+
### Pub-Sub: Assignment Submission
|
|
79
|
+
|
|
80
|
+
Subscribe to `PCore.getPubSubUtils().subscribe(BEFORE_ASSIGNMENT_SUBMIT, handleBeforeSubmit, 'Attachment')`. In `handleBeforeSubmit`, validate that no uploads are still in progress.
|
|
81
|
+
|
|
82
|
+
### Read-Only Mode (`displayMode === 'DISPLAY_ONLY'`)
|
|
83
|
+
|
|
84
|
+
Render a list of existing attachments as download links. No upload controls shown.
|
|
85
|
+
|
|
86
|
+
### Inline Table Edit Mode (`editMode === 'tableRows'`)
|
|
87
|
+
|
|
88
|
+
Compressed display for use inside a table cell. Show attachment count and a small upload button. Clicking opens a minimal upload dialog.
|
|
89
|
+
|
|
90
|
+
## Visual Specifications
|
|
91
|
+
|
|
92
|
+
| Element | Description |
|
|
93
|
+
|---------|-------------|
|
|
94
|
+
| Label | Standard field label above the control |
|
|
95
|
+
| Drop zone / Upload button | Clickable area to select files; optionally supports drag-and-drop |
|
|
96
|
+
| File list | Each uploaded file: icon + name + size + progress bar (during upload) + delete button |
|
|
97
|
+
| Error state | Red error text below the control for invalid files or upload failures |
|
|
98
|
+
| Helper text | Secondary text below the control |
|
|
99
|
+
|
|
100
|
+
**CSS-only implementation notes:**
|
|
101
|
+
- Drop zone: `border: 2px dashed var(--border-color); border-radius: 4px; padding: 1rem; text-align: center; cursor: pointer`.
|
|
102
|
+
- Drop zone hover: `border-color: var(--app-primary-color); background: var(--hover-bg)`.
|
|
103
|
+
- File row: `display: flex; align-items: center; gap: 0.5rem; padding: 4px 0`.
|
|
104
|
+
- Progress bar: `height: 4px; background: var(--app-primary-color); border-radius: 2px; transition: width 0.2s`.
|
|
105
|
+
- Error text: `color: var(--error-color); font-size: 0.75rem; margin-top: 4px`.
|
|
106
|
+
- Delete button: `color: var(--error-color)`.
|
|
107
|
+
|
|
108
|
+
## Edge Cases & Special Logic
|
|
109
|
+
|
|
110
|
+
- `allowMultiple` may be a string `"true"` / `"false"` or a boolean — always coerce: `allowMultiple === true || allowMultiple === 'true'`.
|
|
111
|
+
- Upload progress: track per-file progress in a `Map<fileId, number>` state object.
|
|
112
|
+
- `isTableFormatter`: when `true`, hide the label and reduce padding for compact table display.
|
|
113
|
+
- Concurrent uploads: multiple files may upload simultaneously — the sequencer action must be keyed per-file.
|
|
114
|
+
- Max size: call `PCore.getEnvironmentInfo().getMaxAttachmentSize()` at validation time (not at mount) — size config may be dynamic.
|
|
115
|
+
- `extensions` may be empty string — if empty, allow all file types.
|
|
116
|
+
|
|
117
|
+
## Dependencies
|
|
118
|
+
|
|
119
|
+
- `AttachmentUtils.ts` — `validateExtension`, `validateSize`, `getFileTypeIcon`, `buildDownloadURL`, error handling helpers
|
|
120
|
+
- `Attachment.types.ts` — `FileObject`, `AttachmentLinks`, `PageInstructionOptions` type definitions
|
|
121
|
+
- `PCore.getAttachmentUtils()` — upload, download, prepareAttachmentData
|
|
122
|
+
- `PCore.getActionsSequencer()` — block/unblock form submission during upload
|
|
123
|
+
- `PCore.getEnvironmentInfo()` — max attachment size
|
|
124
|
+
- `PCore.getMessageManager()` — error message display
|
|
125
|
+
- `PCore.getPubSubUtils()` — before-submit subscription
|
|
126
|
+
- `downloadjs` library — browser file download trigger
|
|
127
|
+
|
|
128
|
+
## Design System Mapping
|
|
129
|
+
|
|
130
|
+
**UI control type:** File upload form field with progress tracking, validation, and attachment list.
|
|
131
|
+
|
|
132
|
+
Listed design systems are examples only.
|
|
133
|
+
|
|
134
|
+
| Design System | File Input | Progress | File List |
|
|
135
|
+
|---|---|---|---|
|
|
136
|
+
| Default (CSS only) | `<input type='file'>` + custom styled drop zone | `<progress>` element or CSS bar | `<ul>/<li>` rows |
|
|
137
|
+
| MUI | Custom styled `<Box>` drop zone + hidden `<input>` | `<LinearProgress>` | `<List>/<ListItem>` |
|
|
138
|
+
| Ant Design | `<Upload dragger>` | `<Progress>` | Built-in upload file list |
|
|
139
|
+
| Chakra UI | Custom `<Box>` with `useDropzone` | `<Progress>` | `<VStack>` rows |
|
|
140
|
+
| Shadcn/ui | Custom drop zone | Custom CSS progress bar | `<ul>/<li>` rows |
|
|
141
|
+
|
|
142
|
+
When implementing in a specific design system:
|
|
143
|
+
- Action sequencer blocking (`addAction`/`removeAction`) is mandatory — do not skip it; form submission must be blocked during uploads
|
|
144
|
+
- Detect and normalize both old and new attachment formats via `prepareAttachmentData`
|
|
145
|
+
- `allowMultiple` coercion (string vs boolean) is required
|
|
146
|
+
- Extension and size validation must happen client-side before calling the upload API
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Skill: CaseHistory
|
|
2
|
+
|
|
3
|
+
Case history widget. Fetches and displays the full audit trail for the current case in a table with Date, Description, and Performer columns.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Renders a table of case events sourced from the `D_pyWorkHistory` data page. Shows when each event happened (`pyUpdatedDateTime`), what happened (`pyMessageKey`), and who performed it (`pyPerformer`). Uses `fast-deep-equal` to skip unnecessary re-renders when data has not changed.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Registration key:** `CaseHistory` (in `component-map.ts`)
|
|
16
|
+
- **Category:** Widget — case data display
|
|
17
|
+
- **Extends:** `PConnProps`
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
|------|------|----------|-------------|
|
|
23
|
+
| `getPConnect` | `function` | Yes | PConnect getter — used to resolve case ID and context |
|
|
24
|
+
|
|
25
|
+
No additional custom props. All data is fetched internally.
|
|
26
|
+
|
|
27
|
+
## Behavioral Contract
|
|
28
|
+
|
|
29
|
+
### Data Fetch
|
|
30
|
+
|
|
31
|
+
On mount, fetch history from the `D_pyWorkHistory` data page:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
PCore.getDataApiUtils().getData(
|
|
35
|
+
'D_pyWorkHistory',
|
|
36
|
+
{ pyCaseInsKey: caseKey },
|
|
37
|
+
context
|
|
38
|
+
)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- `caseKey` = `pConn.getCaseInfo().getKey()` (the fully-qualified case key).
|
|
42
|
+
- `context` = `pConn.getContextName()`.
|
|
43
|
+
- Store result in `historyData` state array.
|
|
44
|
+
- On error or empty response, `historyData` stays as `[]`.
|
|
45
|
+
|
|
46
|
+
### Re-render Optimization
|
|
47
|
+
|
|
48
|
+
Use `fast-deep-equal/react` to compare new `historyData` with previous value — only call `setHistoryData` if the data has actually changed. This prevents unnecessary re-renders caused by reference inequality.
|
|
49
|
+
|
|
50
|
+
### Data Transformation
|
|
51
|
+
|
|
52
|
+
For each history row, map:
|
|
53
|
+
- **Date column:** Format `pyUpdatedDateTime` using the SDK date formatter (e.g., `formatDateTime(row.pyUpdatedDateTime)`) or display as-is.
|
|
54
|
+
- **Description column:** `row.pyMessageKey` — the localized event description string.
|
|
55
|
+
- **Performer column:** `row.pyPerformer` — the operator who performed the action.
|
|
56
|
+
- Missing values: display `"---"` for any undefined/null field.
|
|
57
|
+
|
|
58
|
+
## Visual Specifications
|
|
59
|
+
|
|
60
|
+
### Table Layout
|
|
61
|
+
|
|
62
|
+
| Column | Field | Width |
|
|
63
|
+
|--------|-------|-------|
|
|
64
|
+
| Date | `pyUpdatedDateTime` (formatted) | ~25% |
|
|
65
|
+
| Description | `pyMessageKey` | ~50% |
|
|
66
|
+
| Performer | `pyPerformer` | ~25% |
|
|
67
|
+
|
|
68
|
+
**CSS-only implementation notes:**
|
|
69
|
+
- Table container: `width: 100%; overflow-x: auto`.
|
|
70
|
+
- Table: `border-collapse: collapse; width: 100%`.
|
|
71
|
+
- Header cells: `background: var(--table-header-bg); font-weight: 600; padding: 8px 12px; border-bottom: 2px solid var(--divider-color)`.
|
|
72
|
+
- Body cells: `padding: 8px 12px; border-bottom: 1px solid var(--divider-color)`.
|
|
73
|
+
- Missing value placeholder `"---"`: `color: var(--secondary-text-color)`.
|
|
74
|
+
- No pagination in the reference implementation — all rows shown.
|
|
75
|
+
|
|
76
|
+
## Edge Cases & Special Logic
|
|
77
|
+
|
|
78
|
+
- `D_pyWorkHistory` may return an empty array for cases with no history events — render an empty table body (or an empty-state message like `"No history available"`).
|
|
79
|
+
- `pyUpdatedDateTime` format varies — always run it through the SDK date formatter before display.
|
|
80
|
+
- `pyMessageKey` may be a locale key — resolve it via `PCore.getLocaleUtils().getLocaleValue()` if a localized string is required.
|
|
81
|
+
- The widget has no pagination — for cases with very long history, the table may become very tall. Consider adding pagination if needed.
|
|
82
|
+
|
|
83
|
+
## Dependencies
|
|
84
|
+
|
|
85
|
+
- `PCore.getDataApiUtils().getData()` — fetches `D_pyWorkHistory` data page
|
|
86
|
+
- `fast-deep-equal/react` — prevents unnecessary re-renders
|
|
87
|
+
- `PCore.getConstants().CASE_INFO.CASE_INFO_ID` — resolves case ID constant
|
|
88
|
+
- MUI: `<Table>`, `<TableBody>`, `<TableCell>`, `<TableContainer>`, `<TableHead>`, `<TableRow>`
|
|
89
|
+
|
|
90
|
+
## Design System Mapping
|
|
91
|
+
|
|
92
|
+
**UI control type:** Read-only case audit table with 3 columns.
|
|
93
|
+
|
|
94
|
+
Listed design systems are examples only.
|
|
95
|
+
|
|
96
|
+
| Design System | Table |
|
|
97
|
+
|---|---|
|
|
98
|
+
| Default (CSS only) | `<table>/<thead>/<tbody>/<tr>/<td>` |
|
|
99
|
+
| MUI | `<TableContainer>` + `<Table>` + `<TableHead>/<TableBody>/<TableRow>/<TableCell>` |
|
|
100
|
+
| Ant Design | `<Table dataSource={historyData} columns={...}>` |
|
|
101
|
+
| Chakra UI | `<Table>` + `<Thead>/<Tbody>/<Tr>/<Th>/<Td>` |
|
|
102
|
+
| Shadcn/ui | `<Table>` + `<TableHeader>/<TableBody>/<TableRow>/<TableHead>/<TableCell>` |
|
|
103
|
+
|
|
104
|
+
When implementing in a specific design system:
|
|
105
|
+
- `fast-deep-equal` comparison is a performance optimization — include it to avoid redundant renders on re-subscription
|
|
106
|
+
- Data page name `D_pyWorkHistory` is fixed — do not make it configurable
|
|
107
|
+
- Missing field fallback `"---"` should be consistent across all three columns
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Skill: FileUtility
|
|
2
|
+
|
|
3
|
+
File and URL management utility widget. Displays case attachments and links, supports upload/download/delete, and provides modals for adding new files or URLs. Also covers `ActionButtonsForFileUtil` sub-component.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
The primary attachments management panel in the case utilities column. Shows up to 3 attachments/links in the main view with a "View all" option that opens a modal with the full list. Users can upload files, attach URLs, download, and delete items. Attachment state is kept fresh via debounced pub-sub subscriptions.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Registration key:** `FileUtility` (in `component-map.ts`)
|
|
16
|
+
- **Category:** Widget — file management
|
|
17
|
+
- **Extends:** `PConnProps`
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
|------|------|----------|-------------|
|
|
23
|
+
| `caseId` | `string` | No | Optional case ID override. If absent, resolved from `pConn.getCaseInfo().getID()` |
|
|
24
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
25
|
+
|
|
26
|
+
## Behavioral Contract
|
|
27
|
+
|
|
28
|
+
### Attachment Fetch
|
|
29
|
+
|
|
30
|
+
On mount and on attachment change events:
|
|
31
|
+
```
|
|
32
|
+
PCore.getAttachmentUtils().getCaseAttachments(caseKey, context)
|
|
33
|
+
```
|
|
34
|
+
Returns array of attachment/link objects. Store in `attachments` state.
|
|
35
|
+
|
|
36
|
+
Debounced auto-refresh: on `CASE_ATTACHMENTS_UPDATED` pub-sub event, wait 1000ms (debounced) then re-fetch. This prevents rapid re-fetches when multiple files are uploaded simultaneously.
|
|
37
|
+
|
|
38
|
+
### Main View — Top 3 Display
|
|
39
|
+
|
|
40
|
+
Show only the first 3 items from `attachments`. If `attachments.length > 3`, show a `"View all (N)"` button that opens the full-list modal.
|
|
41
|
+
|
|
42
|
+
### SummaryList Integration
|
|
43
|
+
|
|
44
|
+
Map each attachment/link to a `SummaryItem`-compatible object:
|
|
45
|
+
```typescript
|
|
46
|
+
{
|
|
47
|
+
id: attachment.ID,
|
|
48
|
+
visual: { icon: getFileIcon(attachment.mimeType) },
|
|
49
|
+
primary: {
|
|
50
|
+
type: attachment.category === 'FILE' ? 'FILE' : 'URL',
|
|
51
|
+
name: attachment.name,
|
|
52
|
+
click: () => handleDownloadOrOpen(attachment)
|
|
53
|
+
},
|
|
54
|
+
secondary: { text: attachment.createdBy + ' · ' + formatDate(attachment.createTime) }
|
|
55
|
+
actions: [
|
|
56
|
+
{ id: 'delete', text: 'Delete', icon: 'trash', onClick: () => handleDelete(attachment.ID) }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Pass to `<SummaryList arItems$={summaryItems} />`.
|
|
62
|
+
|
|
63
|
+
### File Upload
|
|
64
|
+
|
|
65
|
+
1. User clicks "Add file" from the `<Menu>`.
|
|
66
|
+
2. Opens an add-file modal (dialog).
|
|
67
|
+
3. User selects a file via `<input type='file'>`.
|
|
68
|
+
4. On confirm: call `PCore.getAttachmentUtils().uploadAttachment(file, onProgress, onError, context)`.
|
|
69
|
+
5. On success: call `PCore.getAttachmentUtils().linkAttachmentsToCase(caseKey, [newAttachment], context)`.
|
|
70
|
+
6. Refresh attachment list.
|
|
71
|
+
|
|
72
|
+
### URL Attachment
|
|
73
|
+
|
|
74
|
+
1. User clicks "Add link" from the `<Menu>`.
|
|
75
|
+
2. Opens add-link modal with two fields: `Title` (required) and `URL` (required).
|
|
76
|
+
3. The "Attach" button is enabled only when both `title` and `url` are non-empty.
|
|
77
|
+
4. On confirm: call `PCore.getAttachmentUtils().linkAttachmentsToCase(caseKey, [{ name: title, url, category: 'URL' }], context)`.
|
|
78
|
+
5. Refresh attachment list.
|
|
79
|
+
|
|
80
|
+
### Download / Open
|
|
81
|
+
|
|
82
|
+
- **FILE type:** Call `PCore.getAttachmentUtils().downloadAttachment(attachmentID, context)` then trigger browser download via `downloadjs`.
|
|
83
|
+
- **URL type:** Open `attachment.url` in a new browser tab (`window.open(url, '_blank')`).
|
|
84
|
+
|
|
85
|
+
### Delete
|
|
86
|
+
|
|
87
|
+
Call `PCore.getAttachmentUtils().deleteAttachment(attachmentID, context)`. Refresh attachment list after success.
|
|
88
|
+
|
|
89
|
+
### Actions Menu
|
|
90
|
+
|
|
91
|
+
Render a `<MoreVertIcon>` `<IconButton>` that opens a `<Menu>` with:
|
|
92
|
+
- `"Add file"` — opens add-file modal
|
|
93
|
+
- `"Add link"` — opens add-link modal
|
|
94
|
+
|
|
95
|
+
## Visual Specifications
|
|
96
|
+
|
|
97
|
+
### Main Card
|
|
98
|
+
|
|
99
|
+
| Element | Description |
|
|
100
|
+
|---------|-------------|
|
|
101
|
+
| Card header | `"Attachments"` (or localized) + count badge |
|
|
102
|
+
| Actions icon | `<MoreVertIcon>` button top-right |
|
|
103
|
+
| Attachment rows | Up to 3 `SummaryItem` cards |
|
|
104
|
+
| "View all" button | Text button, shown when > 3 attachments |
|
|
105
|
+
|
|
106
|
+
### "View all" Modal
|
|
107
|
+
|
|
108
|
+
| Element | Description |
|
|
109
|
+
|---------|-------------|
|
|
110
|
+
| Modal header | `"All attachments (N)"` |
|
|
111
|
+
| Attachment rows | All items in `SummaryList` |
|
|
112
|
+
| Close button | `X` in modal header |
|
|
113
|
+
|
|
114
|
+
### Add File Modal
|
|
115
|
+
|
|
116
|
+
| Element | Description |
|
|
117
|
+
|---------|-------------|
|
|
118
|
+
| File picker | `<input type='file'>` |
|
|
119
|
+
| Progress bar | Per-file upload progress |
|
|
120
|
+
| Action buttons | `ActionButtonsForFileUtil` (Cancel + Attach) |
|
|
121
|
+
|
|
122
|
+
### Add Link Modal
|
|
123
|
+
|
|
124
|
+
| Element | Description |
|
|
125
|
+
|---------|-------------|
|
|
126
|
+
| Title field | `<TextField label='Title'>` — required |
|
|
127
|
+
| URL field | `<TextField label='URL'>` — required |
|
|
128
|
+
| Attach button | Enabled only when both fields are filled |
|
|
129
|
+
| Action buttons | `ActionButtonsForFileUtil` (Cancel + Attach) |
|
|
130
|
+
|
|
131
|
+
**CSS-only implementation notes:**
|
|
132
|
+
- Main card: standard card styles.
|
|
133
|
+
- Modal: `position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.2); min-width: 480px; padding: 1.5rem`.
|
|
134
|
+
- "View all" button: text style, `color: var(--app-primary-color); cursor: pointer`.
|
|
135
|
+
- Progress bar: `height: 4px; background: var(--app-primary-color); transition: width 0.3s`.
|
|
136
|
+
|
|
137
|
+
## Sub-Component: ActionButtonsForFileUtil
|
|
138
|
+
|
|
139
|
+
**Registration key:** `ActionButtonsForFileUtil`
|
|
140
|
+
|
|
141
|
+
A simple button row component used inside the FileUtility modals to render Cancel + primary action buttons.
|
|
142
|
+
|
|
143
|
+
### Props
|
|
144
|
+
|
|
145
|
+
| Prop | Type | Required | Description |
|
|
146
|
+
|------|------|----------|-------------|
|
|
147
|
+
| `arMainButtons` | `any[]` | Yes | Primary button definitions `[{ actionID, name }]` |
|
|
148
|
+
| `arSecondaryButtons` | `any[]` | Yes | Secondary (cancel) button definitions `[{ actionID, name }]` |
|
|
149
|
+
| `primaryAction` | `function` | Yes | Callback invoked when the primary button is clicked |
|
|
150
|
+
| `secondaryAction` | `function` | Yes | Callback invoked when the secondary/cancel button is clicked |
|
|
151
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
152
|
+
|
|
153
|
+
### Layout
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
[Secondary buttons (left)] [Primary buttons (right)]
|
|
157
|
+
Cancel Attach
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
- Secondary buttons: outlined/text style.
|
|
161
|
+
- Primary buttons: contained/filled style with theme primary color.
|
|
162
|
+
- Render using `arSecondaryButtons.map(...)` and `arMainButtons.map(...)`.
|
|
163
|
+
|
|
164
|
+
## Edge Cases & Special Logic
|
|
165
|
+
|
|
166
|
+
- **Debounce (1000ms):** Prevents excessive re-fetches when multiple attachment events fire in quick succession.
|
|
167
|
+
- **Add link "Attach" button disabled state:** Title and URL validation must happen on every keystroke — use controlled inputs with `!title || !url` to derive disabled state.
|
|
168
|
+
- **`linkAttachmentsToCase`:** After upload, the file must be explicitly linked to the case. Uploading alone does not associate the file with the case.
|
|
169
|
+
- **Pub-sub cleanup:** Unsubscribe from `CASE_ATTACHMENTS_UPDATED` on unmount to prevent stale callbacks.
|
|
170
|
+
- **Error display:** Use `PCore.getMessageManager()` or inline error state in the modal — do not silently fail on upload/link errors.
|
|
171
|
+
|
|
172
|
+
## Dependencies
|
|
173
|
+
|
|
174
|
+
- `PCore.getAttachmentUtils()` — getCaseAttachments, uploadAttachment, downloadAttachment, deleteAttachment, linkAttachmentsToCase
|
|
175
|
+
- `PCore.getMessagingServiceManager()` — subscribe to attachment change events
|
|
176
|
+
- `PCore.getConstants()` — case info ID, summary refresh timing
|
|
177
|
+
- `getComponentFromRegistry('SummaryList')` — renders the attachment item list
|
|
178
|
+
- `getComponentFromRegistry('ActionButtonsForFileUtil')` — renders modal action buttons
|
|
179
|
+
- `downloadjs` — browser file download trigger
|
|
180
|
+
- MUI: `<Card>`, `<CardHeader>`, `<CardContent>`, `<IconButton>`, `<Menu>`, `<MenuItem>`, `<Button>`, `<TextField>`, `<Dialog>`, `<CircularProgress>`
|
|
181
|
+
- MUI Icons: `<MoreVertIcon>`
|
|
182
|
+
|
|
183
|
+
## Design System Mapping
|
|
184
|
+
|
|
185
|
+
**UI control type:** File management widget — attachment list with upload/download/delete and add modals.
|
|
186
|
+
|
|
187
|
+
Listed design systems are examples only.
|
|
188
|
+
|
|
189
|
+
| Design System | Card | Action Menu | Modal | Progress |
|
|
190
|
+
|---|---|---|---|---|
|
|
191
|
+
| Default (CSS only) | `<div>` card | `<button>` + custom dropdown | `<dialog>` | CSS progress bar |
|
|
192
|
+
| MUI | `<Card>` | `<IconButton>` + `<Menu>/<MenuItem>` | `<Dialog>` | `<CircularProgress>` or `<LinearProgress>` |
|
|
193
|
+
| Ant Design | `<Card>` | `<Dropdown menu={{ items }}>` | `<Modal>` | `<Progress>` |
|
|
194
|
+
| Chakra UI | `<Card>` | `<Menu>/<MenuButton>/<MenuList>` | `<Modal>` | `<Progress>` |
|
|
195
|
+
| Shadcn/ui | `<Card>` | `<DropdownMenu>` | `<Dialog>` | Custom progress bar |
|
|
196
|
+
|
|
197
|
+
When implementing in a specific design system:
|
|
198
|
+
- Debounced refresh (1000ms) after pub-sub attachment events is required — prevents excessive API calls
|
|
199
|
+
- `linkAttachmentsToCase` must be called after upload — uploading alone does not attach to the case
|
|
200
|
+
- `ActionButtonsForFileUtil` receives button definition arrays — render them generically from `arMainButtons`/`arSecondaryButtons`
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Skill: Followers
|
|
2
|
+
|
|
3
|
+
Followers widget. Displays the list of users following the current case. Currently a stub/placeholder in the reference implementation — renders an "unsupported" message.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Intended to display the list of operators following a case, allowing users to follow/unfollow a case and see who else is following it. The reference implementation is a **stub** — it renders a `"Followers - unsupported"` message inside a card. A full implementation would fetch follower data from the Pega data layer and provide follow/unfollow actions.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Registration key:** `Followers` (in `component-map.ts`)
|
|
16
|
+
- **Category:** Widget — social / collaboration
|
|
17
|
+
- **Extends:** `PConnProps`
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
|------|------|----------|-------------|
|
|
23
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
24
|
+
|
|
25
|
+
No additional custom props in the current stub implementation. A full implementation would likely include:
|
|
26
|
+
- `datasource` — data page name for follower list
|
|
27
|
+
- `headerText` — widget title (e.g., `"Followers"`)
|
|
28
|
+
|
|
29
|
+
## Behavioral Contract
|
|
30
|
+
|
|
31
|
+
### Current (Stub) Implementation
|
|
32
|
+
|
|
33
|
+
1. Render a `<Card>` with title `"Followers"`.
|
|
34
|
+
2. Show `"Followers - unsupported"` body text.
|
|
35
|
+
3. No data fetching, no actions.
|
|
36
|
+
|
|
37
|
+
### Expected Full Implementation
|
|
38
|
+
|
|
39
|
+
1. **Fetch followers:** Call `PCore.getDataPageUtils().getDataAsync('D_pyCaseFollowers', context, { caseKey })` on mount.
|
|
40
|
+
2. **Display follower list:** Render each follower's avatar (initials) and display name.
|
|
41
|
+
3. **Follow/unfollow toggle:** Button to follow or unfollow the current case:
|
|
42
|
+
- Follow: `PCore.getRestClient().invokeCustomRestApi('/api/v1/cases/{caseID}/followers', { method: 'POST', ... })`.
|
|
43
|
+
- Unfollow: same endpoint with `DELETE` method.
|
|
44
|
+
4. **Real-time update:** Subscribe to follower change events via pub-sub if available.
|
|
45
|
+
|
|
46
|
+
## Visual Specifications
|
|
47
|
+
|
|
48
|
+
### Stub Rendering
|
|
49
|
+
|
|
50
|
+
| Element | Value |
|
|
51
|
+
|---------|-------|
|
|
52
|
+
| Card title | `"Followers"` |
|
|
53
|
+
| Card body | `"Followers - unsupported"` plain text |
|
|
54
|
+
|
|
55
|
+
### Expected Full Rendering
|
|
56
|
+
|
|
57
|
+
| Element | Description |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| Card header | `"Followers"` + count badge |
|
|
60
|
+
| Follower avatars | Row of avatar initials circles |
|
|
61
|
+
| Follow button | Toggle button `"Follow"` / `"Unfollow"` |
|
|
62
|
+
|
|
63
|
+
**CSS-only implementation notes (stub):**
|
|
64
|
+
- Card: standard card layout — `border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.12); padding: 1rem`.
|
|
65
|
+
- Unsupported message: `color: var(--secondary-text-color); font-size: 0.875rem`.
|
|
66
|
+
|
|
67
|
+
**CSS-only implementation notes (full):**
|
|
68
|
+
- Avatar row: `display: flex; flex-wrap: wrap; gap: 4px`.
|
|
69
|
+
- Avatar circle: `width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600`.
|
|
70
|
+
|
|
71
|
+
## Edge Cases & Special Logic
|
|
72
|
+
|
|
73
|
+
- If the stub message `"Followers - unsupported"` is shown in production, it means this widget has not been fully implemented yet — that is expected behavior.
|
|
74
|
+
- When implementing: guard against empty follower arrays — show a `"No followers yet"` state.
|
|
75
|
+
- Follow/unfollow toggle must reflect the current user's follow status — fetch this as part of the initial data load.
|
|
76
|
+
|
|
77
|
+
## Dependencies
|
|
78
|
+
|
|
79
|
+
- MUI: `<Card>`, `<CardContent>`, `<CardHeader>`, `<Typography>` (current stub)
|
|
80
|
+
- Future full implementation would add: `<Avatar>`, `<Button>`, `<Badge>`, pub-sub subscriptions
|
|
81
|
+
|
|
82
|
+
## Design System Mapping
|
|
83
|
+
|
|
84
|
+
**UI control type:** Social widget — follower list with follow/unfollow action.
|
|
85
|
+
|
|
86
|
+
Listed design systems are examples only.
|
|
87
|
+
|
|
88
|
+
| Design System | Card | Avatar | Toggle Button |
|
|
89
|
+
|---|---|---|---|
|
|
90
|
+
| Default (CSS only) | `<div>` with border | CSS circle with initials | `<button>` |
|
|
91
|
+
| MUI | `<Card>` + `<Avatar>` | `<Avatar>` | `<Button>` variant toggle |
|
|
92
|
+
| Ant Design | `<Card>` | `<Avatar>` | `<Button>` |
|
|
93
|
+
| Chakra UI | `<Card>` | `<Avatar>` | `<Button>` |
|
|
94
|
+
| Shadcn/ui | `<Card>` | Custom avatar | `<Button>` |
|
|
95
|
+
|
|
96
|
+
When implementing in a specific design system:
|
|
97
|
+
- The current stub only needs a card with a message — implement the full behavior once the Pega backend supports it
|
|
98
|
+
- Follow/unfollow must be scoped to the current case (`caseKey` from `pConn.getCaseInfo().getKey()`)
|
|
99
|
+
- Follower count badge in the card header improves scannability
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Skill: QuickCreate
|
|
2
|
+
|
|
3
|
+
Quick case creation widget. Renders a set of buttons — one per available case type — allowing users to create cases directly from the widget without navigating to a separate form.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Provides a shortcut panel for creating new cases. Case types are sourced from the Pega environment info (or a fallback portal config for Launchpad). The list can be filtered by class name. Each button triggers case creation via `pConn.getActionsApi().createWork()`. Rendering is delegated to the `WssQuickCreate` design system extension component.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Registration key:** `QuickCreate` (in `component-map.ts`)
|
|
16
|
+
- **Category:** Widget — action / case creation
|
|
17
|
+
- **Extends:** `PConnProps`
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
|------|------|----------|-------------|
|
|
23
|
+
| `heading` | `string` | Yes | Widget title (e.g., `"Create"`) |
|
|
24
|
+
| `showCaseIcons` | `boolean` | No | Whether to show case type icons alongside labels. Default `false` |
|
|
25
|
+
| `classFilter` | `any[]` | No | Array of class names to filter available case types. Empty array = show all |
|
|
26
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
27
|
+
|
|
28
|
+
## Behavioral Contract
|
|
29
|
+
|
|
30
|
+
### Case Types Resolution
|
|
31
|
+
|
|
32
|
+
1. Read `PCore.getEnvironmentInfo().environmentInfoObject.pyCaseTypeList` — the primary source.
|
|
33
|
+
2. If the list is empty or unavailable (e.g., Launchpad mode), fall back to the app portal config:
|
|
34
|
+
```
|
|
35
|
+
PCore.getConfig().getApplicationName() // or portal config equivalent
|
|
36
|
+
```
|
|
37
|
+
3. Apply `classFilter`: if `classFilter` is non-empty, retain only case types whose class name is included in the array.
|
|
38
|
+
|
|
39
|
+
### Case Type Object Mapping
|
|
40
|
+
|
|
41
|
+
For each case type, build:
|
|
42
|
+
```typescript
|
|
43
|
+
{
|
|
44
|
+
classname: caseType.pyClassName,
|
|
45
|
+
label: caseType.pyLabel,
|
|
46
|
+
onClick: () => pConn.getActionsApi().createWork(caseType.pyClassName, {
|
|
47
|
+
openCaseViewAfterCreate: true,
|
|
48
|
+
containerName: PCore.getConstants().APP.APP
|
|
49
|
+
}),
|
|
50
|
+
icon: showCaseIcons ? getIconURL(caseType.pyClassName) : undefined
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Rendering Delegation
|
|
55
|
+
|
|
56
|
+
Pass the mapped case type array to `WssQuickCreate` (retrieved via `getComponentFromRegistry('WssQuickCreate')`):
|
|
57
|
+
```tsx
|
|
58
|
+
const WssQuickCreate = getComponentFromRegistry('WssQuickCreate');
|
|
59
|
+
return <WssQuickCreate heading={heading} caseTypes={caseTypeObjects} />;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This component handles all button rendering — `QuickCreate` is purely a data-preparation orchestrator.
|
|
63
|
+
|
|
64
|
+
## Visual Specifications
|
|
65
|
+
|
|
66
|
+
Visual rendering is owned by `WssQuickCreate` (a design system extension component). Typical layout:
|
|
67
|
+
|
|
68
|
+
| Element | Description |
|
|
69
|
+
|---------|-------------|
|
|
70
|
+
| Heading | Widget title at the top |
|
|
71
|
+
| Case type buttons | One button per case type; icon (optional) + label |
|
|
72
|
+
|
|
73
|
+
**CSS-only implementation notes (if implementing without `WssQuickCreate`):**
|
|
74
|
+
- Container: `display: flex; flex-direction: column; gap: 0.5rem`.
|
|
75
|
+
- Heading: `font-weight: 600; margin-bottom: 0.5rem`.
|
|
76
|
+
- Case type button: `display: flex; align-items: center; gap: 0.5rem; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 4px; cursor: pointer; background: white`.
|
|
77
|
+
- Icon: `width: 20px; height: 20px; object-fit: contain`.
|
|
78
|
+
|
|
79
|
+
## Edge Cases & Special Logic
|
|
80
|
+
|
|
81
|
+
- `classFilter` is an empty array by default — empty array means **no filtering** (show all case types).
|
|
82
|
+
- If `pyCaseTypeList` is empty and the fallback also produces no results, render the widget with a `"No case types available"` message or hide the widget.
|
|
83
|
+
- `showCaseIcons` requires a valid icon URL — `getIconURL(classname)` returns `undefined` if no icon is configured; guard against rendering a broken `<img>`.
|
|
84
|
+
- `createWork` opens the case creation form in the primary container. If the user already has an unsaved case open, behavior depends on container configuration (may replace or open in a new tab).
|
|
85
|
+
|
|
86
|
+
## Dependencies
|
|
87
|
+
|
|
88
|
+
- `getComponentFromRegistry('WssQuickCreate')` — design system extension for case type button rendering
|
|
89
|
+
- `pConn.getActionsApi().createWork()` — triggers case creation
|
|
90
|
+
- `PCore.getEnvironmentInfo()` — primary source for available case types
|
|
91
|
+
- `PCore.getConstants().APP.APP` — app context constant
|
|
92
|
+
|
|
93
|
+
## Design System Mapping
|
|
94
|
+
|
|
95
|
+
**UI control type:** Quick-action panel with one button per available case type.
|
|
96
|
+
|
|
97
|
+
Listed design systems are examples only.
|
|
98
|
+
|
|
99
|
+
Rendering is delegated to `WssQuickCreate` — implement that DSE component for your design system. `QuickCreate` itself has no direct UI output beyond the delegation.
|
|
100
|
+
|
|
101
|
+
If implementing without `WssQuickCreate`:
|
|
102
|
+
|
|
103
|
+
| Design System | Button List |
|
|
104
|
+
|---|---|
|
|
105
|
+
| Default (CSS only) | `<button>` list with optional `<img>` icon |
|
|
106
|
+
| MUI | `<List>` + `<ListItemButton>` or `<Button>` stack |
|
|
107
|
+
| Ant Design | `<Space direction='vertical'>` + `<Button>` per case type |
|
|
108
|
+
| Chakra UI | `<VStack>` + `<Button>` per case type |
|
|
109
|
+
| Shadcn/ui | `<div>` stack + `<Button variant='outline'>` |
|
|
110
|
+
|
|
111
|
+
When implementing in a specific design system:
|
|
112
|
+
- `classFilter` empty array = show ALL case types (not zero) — this is a common gotcha
|
|
113
|
+
- `createWork` must be called with the correct `containerName` constant (`APP.APP`)
|
|
114
|
+
- `showCaseIcons` is optional — only fetch/render icons when this prop is `true`
|