@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,189 @@
|
|
|
1
|
+
import { Radio, Checkbox, FormControlLabel, Card, CardContent, Typography } from '@mui/material';
|
|
2
|
+
import { resolveReferenceFields } from './utils';
|
|
3
|
+
|
|
4
|
+
export default function SelectableCard(props) {
|
|
5
|
+
const {
|
|
6
|
+
getPConnect,
|
|
7
|
+
type,
|
|
8
|
+
image: { imagePosition, imageSize, showImageDescription, imageField = '', imageDescription = '' },
|
|
9
|
+
dataSource,
|
|
10
|
+
recordKey = '',
|
|
11
|
+
className,
|
|
12
|
+
cardLabel,
|
|
13
|
+
hideFieldLabels = false,
|
|
14
|
+
readOnly,
|
|
15
|
+
disabled,
|
|
16
|
+
readOnlyList = [],
|
|
17
|
+
displayMode,
|
|
18
|
+
radioBtnValue,
|
|
19
|
+
onChange,
|
|
20
|
+
onBlur,
|
|
21
|
+
onClick,
|
|
22
|
+
onKeyDown,
|
|
23
|
+
additionalProps,
|
|
24
|
+
testId,
|
|
25
|
+
setIsRadioCardSelected,
|
|
26
|
+
showNoValue = false
|
|
27
|
+
} = props;
|
|
28
|
+
|
|
29
|
+
const pConn = getPConnect();
|
|
30
|
+
|
|
31
|
+
if (showNoValue) return <Typography>No Value</Typography>;
|
|
32
|
+
|
|
33
|
+
const cardDataSource = readOnly || displayMode === 'DISPLAY_ONLY' ? readOnlyList || [] : dataSource?.source;
|
|
34
|
+
const imageDescriptionKey = showImageDescription ? imageDescription : undefined;
|
|
35
|
+
|
|
36
|
+
const handleCardClick = event => {
|
|
37
|
+
if (disabled || readOnly) return;
|
|
38
|
+
// If the click landed on or inside a label/input, native behavior already handles it.
|
|
39
|
+
if (event.target.closest?.('label, input')) return;
|
|
40
|
+
// Find the radio/checkbox input inside this card and click it programmatically.
|
|
41
|
+
const input = event.currentTarget.querySelector('input[type="radio"], input[type="checkbox"]');
|
|
42
|
+
if (input) input.click();
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
let radioItemSelected = false;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<>
|
|
49
|
+
{(cardDataSource || []).map(item => {
|
|
50
|
+
const resolvedFields = resolveReferenceFields(item, hideFieldLabels, recordKey, pConn);
|
|
51
|
+
|
|
52
|
+
const commonProps = {
|
|
53
|
+
id: item[recordKey],
|
|
54
|
+
key: item[recordKey],
|
|
55
|
+
fields: resolvedFields,
|
|
56
|
+
label: item[cardLabel]
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const image = item[imageField]
|
|
60
|
+
? {
|
|
61
|
+
src: item[imageField],
|
|
62
|
+
alt: showImageDescription && imageDescriptionKey ? item[imageDescriptionKey] : '',
|
|
63
|
+
style: { width: imageSize, objectPosition: imagePosition }
|
|
64
|
+
}
|
|
65
|
+
: undefined;
|
|
66
|
+
|
|
67
|
+
const cardContent = (
|
|
68
|
+
<Card className={className} style={{ display: 'flex' }} data-testid={testId}>
|
|
69
|
+
{image && <img src={image.src} alt={image.alt} style={{ width: '100px' }} />}
|
|
70
|
+
<CardContent>
|
|
71
|
+
<Typography variant='body1'>{item[cardLabel]}</Typography>
|
|
72
|
+
{commonProps.fields.map((field, index) => (
|
|
73
|
+
<Typography key={index} variant='body2'>
|
|
74
|
+
{field.value}
|
|
75
|
+
</Typography>
|
|
76
|
+
))}
|
|
77
|
+
</CardContent>
|
|
78
|
+
</Card>
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
82
|
+
return cardContent;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const component = (
|
|
86
|
+
<div key={item[recordKey]} style={{ paddingTop: '15px' }}>
|
|
87
|
+
<Card
|
|
88
|
+
className={className}
|
|
89
|
+
style={{ display: 'flex', flexDirection: 'column', height: '100%', cursor: disabled || readOnly ? 'default' : 'pointer' }}
|
|
90
|
+
data-testid={testId}
|
|
91
|
+
onClick={handleCardClick}
|
|
92
|
+
>
|
|
93
|
+
<CardContent
|
|
94
|
+
style={{
|
|
95
|
+
...((imagePosition === 'inline-start' || imagePosition === 'inline-end') && { display: 'flex', height: '100%' }),
|
|
96
|
+
...(imagePosition === 'inline-end' && { flexDirection: 'row-reverse' })
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
<div
|
|
100
|
+
style={{
|
|
101
|
+
...((imagePosition === 'inline-start' || imagePosition === 'inline-end') && { width: '40%' })
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
{image && (
|
|
105
|
+
<img
|
|
106
|
+
src={image.src}
|
|
107
|
+
alt={image.alt}
|
|
108
|
+
style={{
|
|
109
|
+
width: '100%',
|
|
110
|
+
backgroundColor: 'transparent',
|
|
111
|
+
aspectRatio: '16 / 9',
|
|
112
|
+
maxHeight: '100%',
|
|
113
|
+
height: '100%',
|
|
114
|
+
objectFit: 'contain',
|
|
115
|
+
maxWidth: '100%'
|
|
116
|
+
}}
|
|
117
|
+
/>
|
|
118
|
+
)}
|
|
119
|
+
</div>
|
|
120
|
+
<div
|
|
121
|
+
style={{
|
|
122
|
+
...((imagePosition === 'inline-start' || imagePosition === 'inline-end') && { width: '60%' })
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
{type === 'radio' ? (
|
|
126
|
+
<FormControlLabel
|
|
127
|
+
control={
|
|
128
|
+
<Radio
|
|
129
|
+
value={item[recordKey]}
|
|
130
|
+
checked={radioBtnValue === item[recordKey]}
|
|
131
|
+
onChange={onChange}
|
|
132
|
+
onBlur={onBlur}
|
|
133
|
+
onClick={onClick}
|
|
134
|
+
onKeyDown={onKeyDown}
|
|
135
|
+
disabled={disabled || readOnly}
|
|
136
|
+
{...additionalProps}
|
|
137
|
+
/>
|
|
138
|
+
}
|
|
139
|
+
label={<Typography variant='body1'>{item[cardLabel]}</Typography>}
|
|
140
|
+
/>
|
|
141
|
+
) : (
|
|
142
|
+
<FormControlLabel
|
|
143
|
+
control={
|
|
144
|
+
<Checkbox
|
|
145
|
+
id={item[recordKey]}
|
|
146
|
+
getPConnect={getPConnect}
|
|
147
|
+
checked={readOnlyList.some(data => data[recordKey] === item[recordKey])}
|
|
148
|
+
onChange={onChange}
|
|
149
|
+
onBlur={onBlur}
|
|
150
|
+
onClick={onClick}
|
|
151
|
+
onKeyDown={onKeyDown}
|
|
152
|
+
disabled={disabled || readOnly}
|
|
153
|
+
{...additionalProps}
|
|
154
|
+
/>
|
|
155
|
+
}
|
|
156
|
+
label={<Typography variant='body1'>{item[cardLabel]}</Typography>}
|
|
157
|
+
/>
|
|
158
|
+
)}
|
|
159
|
+
|
|
160
|
+
{commonProps.fields.map((field, index) => (
|
|
161
|
+
<div
|
|
162
|
+
key={index}
|
|
163
|
+
style={{
|
|
164
|
+
fontSize: '0.875rem',
|
|
165
|
+
...(field.type !== 'TextArea' && { display: 'grid', gridTemplateColumns: '1fr 1fr' }),
|
|
166
|
+
margin: '5px'
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
{field.name && <div>{field.name}</div>}
|
|
170
|
+
<div>{field?.value?.props.value}</div>
|
|
171
|
+
</div>
|
|
172
|
+
))}
|
|
173
|
+
</div>
|
|
174
|
+
</CardContent>
|
|
175
|
+
</Card>
|
|
176
|
+
</div>
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
if (type === 'radio' && radioBtnValue === item[recordKey]) {
|
|
180
|
+
radioItemSelected = true;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return component;
|
|
184
|
+
})}
|
|
185
|
+
|
|
186
|
+
{type === 'radio' && setIsRadioCardSelected && setIsRadioCardSelected(radioItemSelected)}
|
|
187
|
+
</>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SelectableCard';
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { Link } from '@mui/material';
|
|
2
|
+
|
|
3
|
+
import { Utils } from '../../helpers/utils';
|
|
4
|
+
|
|
5
|
+
export const resolveReferencedPConnect = pConnect => {
|
|
6
|
+
if (!pConnect || !pConnect.meta) return undefined;
|
|
7
|
+
const type = pConnect?._type ?? undefined;
|
|
8
|
+
const referencedPConnect = type === 'reference' && pConnect.getReferencedViewPConnect().getPConnect();
|
|
9
|
+
return referencedPConnect || pConnect;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A helper function to create an object consisting react component as per the type.
|
|
14
|
+
* This is used by CaseSummary template.
|
|
15
|
+
* @param {object} pConnectMeta Object containing meta information for the particular field authored
|
|
16
|
+
* @param {Function} getPConnect PConnect function passed along to other components.
|
|
17
|
+
* @param {string} displayMode displayMode string contains information about the layout of component in review mode.
|
|
18
|
+
*/
|
|
19
|
+
export function prepareComponentInCaseSummary(pConnectMeta: any, getPConnect: Function) {
|
|
20
|
+
const { config, children } = pConnectMeta;
|
|
21
|
+
|
|
22
|
+
const noValueComponent = <div>No Value</div>;
|
|
23
|
+
const placeholder = '...';
|
|
24
|
+
const pConnect = getPConnect();
|
|
25
|
+
|
|
26
|
+
const caseSummaryComponentObject: any = {};
|
|
27
|
+
|
|
28
|
+
let { type } = pConnectMeta;
|
|
29
|
+
let showAddressLabel = true;
|
|
30
|
+
|
|
31
|
+
if (config && config.value === `@P .${Utils.getMappedKey('pyStatusWork')}`) {
|
|
32
|
+
config.displayAsStatus = true;
|
|
33
|
+
type = 'TextInput'; // force the type to be TextInput for status field.
|
|
34
|
+
// As TextInput is loaded forcefully sometimes, TextInput component might not be available in lazy map.
|
|
35
|
+
// Load TextInput if it is not available.
|
|
36
|
+
if (!PCore.getComponentsRegistry().getLazyComponent(type)) {
|
|
37
|
+
PCore.getAssetLoader().getLoader('component-loader')([type]);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
caseSummaryComponentObject.name = pConnect.resolveConfigProps({ label: config.label }).label;
|
|
42
|
+
|
|
43
|
+
if (config.inheritedProps) {
|
|
44
|
+
const labelInInheritedProp = config.inheritedProps.find(inheritedProp => inheritedProp.prop === 'label');
|
|
45
|
+
if (labelInInheritedProp) {
|
|
46
|
+
labelInInheritedProp.value = pConnect.resolveConfigProps({ label: labelInInheritedProp.value }).label;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
switch (type) {
|
|
51
|
+
case 'CaseOperator': {
|
|
52
|
+
if (config.label.includes('Create operator')) {
|
|
53
|
+
caseSummaryComponentObject.name = pConnect.resolveConfigProps({
|
|
54
|
+
createLabel: config.createLabel
|
|
55
|
+
}).createLabel;
|
|
56
|
+
} else if (config.label.includes('Update operator')) {
|
|
57
|
+
caseSummaryComponentObject.name = pConnect.resolveConfigProps({
|
|
58
|
+
updateLabel: config.updateLabel
|
|
59
|
+
}).updateLabel;
|
|
60
|
+
} else {
|
|
61
|
+
caseSummaryComponentObject.name = pConnect.resolveConfigProps({
|
|
62
|
+
resolveLabel: config.resolveLabel
|
|
63
|
+
}).resolveLabel;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
case 'Checkbox': {
|
|
69
|
+
caseSummaryComponentObject.name = pConnect.resolveConfigProps({
|
|
70
|
+
label: config.caption
|
|
71
|
+
}).label;
|
|
72
|
+
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
case 'Pega_UI_PercentageWidget': {
|
|
76
|
+
const rawValue = pConnect.resolveConfigProps({
|
|
77
|
+
value: config.value
|
|
78
|
+
}).value;
|
|
79
|
+
|
|
80
|
+
caseSummaryComponentObject.simpleValue = rawValue || rawValue === 0 ? `${rawValue}%` : noValueComponent;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case 'Address': {
|
|
84
|
+
showAddressLabel = false;
|
|
85
|
+
|
|
86
|
+
caseSummaryComponentObject.variant = 'stacked';
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
case 'Location':
|
|
90
|
+
case 'RichText': {
|
|
91
|
+
const rawValue = pConnect.resolveConfigProps({
|
|
92
|
+
value: config.value
|
|
93
|
+
}).value;
|
|
94
|
+
|
|
95
|
+
caseSummaryComponentObject.variant = 'stacked';
|
|
96
|
+
caseSummaryComponentObject.simpleValue = rawValue?.length ? rawValue : noValueComponent;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case 'TextArea': {
|
|
100
|
+
const rawValue = pConnect.resolveConfigProps({
|
|
101
|
+
value: config.value
|
|
102
|
+
}).value;
|
|
103
|
+
|
|
104
|
+
if (rawValue?.length > 22) {
|
|
105
|
+
caseSummaryComponentObject.variant = 'stacked';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
caseSummaryComponentObject.simpleValue = rawValue?.length ? rawValue : noValueComponent;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case 'URL': {
|
|
112
|
+
if (config.displayAs === 'Image') {
|
|
113
|
+
const rawValue = pConnect.resolveConfigProps({
|
|
114
|
+
value: config.value
|
|
115
|
+
}).value;
|
|
116
|
+
|
|
117
|
+
caseSummaryComponentObject.variant = 'stacked';
|
|
118
|
+
caseSummaryComponentObject.simpleValue = rawValue?.length ? <Link href={rawValue}>{rawValue}</Link> : noValueComponent;
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
case 'reference': {
|
|
123
|
+
const referencedPConnect = resolveReferencedPConnect(pConnect);
|
|
124
|
+
const viewType = referencedPConnect?.meta?.config.type;
|
|
125
|
+
const viewTemplate = referencedPConnect?.meta?.config.template;
|
|
126
|
+
const isTable = ['multirecordlist'].includes(viewType);
|
|
127
|
+
const isDataReference = viewTemplate === 'DataReference';
|
|
128
|
+
|
|
129
|
+
if (isTable || !isDataReference) {
|
|
130
|
+
caseSummaryComponentObject.variant = 'stacked';
|
|
131
|
+
caseSummaryComponentObject.simpleValue = placeholder;
|
|
132
|
+
}
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
case 'view': {
|
|
136
|
+
caseSummaryComponentObject.variant = 'stacked';
|
|
137
|
+
caseSummaryComponentObject.simpleValue = placeholder;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
default:
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const createdComponent = pConnect.createComponent({
|
|
145
|
+
type,
|
|
146
|
+
children: children ? [...children] : [],
|
|
147
|
+
showAddressLabel,
|
|
148
|
+
config: {
|
|
149
|
+
...config,
|
|
150
|
+
// Need a unique key for each summary component which helps in creating new component based on visibility
|
|
151
|
+
// Also a consistent key helps in rerendering summary components instead of remounting
|
|
152
|
+
key: config
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
createdComponent.props.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
157
|
+
createdComponent.props.getPConnect().setInheritedProp('readOnly', true);
|
|
158
|
+
|
|
159
|
+
if (type === 'Address') {
|
|
160
|
+
createdComponent.props.getPConnect().setInheritedProp('showAddressLabel', showAddressLabel);
|
|
161
|
+
}
|
|
162
|
+
// Add field label for reference summary item when not Embedded data
|
|
163
|
+
if (type === 'reference') {
|
|
164
|
+
const isEmbeddedData = config.context && config.displayAs === 'Form';
|
|
165
|
+
if (!isEmbeddedData) {
|
|
166
|
+
caseSummaryComponentObject.name = createdComponent.props.getPConnect().getInheritedProps().label;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
caseSummaryComponentObject.value = createdComponent;
|
|
171
|
+
|
|
172
|
+
return caseSummaryComponentObject;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function resolveReferenceFields(
|
|
176
|
+
item: {
|
|
177
|
+
[key: string]: unknown;
|
|
178
|
+
},
|
|
179
|
+
hideFieldLabels: boolean,
|
|
180
|
+
recordKey: string,
|
|
181
|
+
pConnect: typeof PConnect
|
|
182
|
+
) {
|
|
183
|
+
const presets: {
|
|
184
|
+
children?: {
|
|
185
|
+
children?: {
|
|
186
|
+
config;
|
|
187
|
+
type;
|
|
188
|
+
};
|
|
189
|
+
config?;
|
|
190
|
+
};
|
|
191
|
+
} = (pConnect.getRawMetadata()?.config as any).presets ?? [];
|
|
192
|
+
|
|
193
|
+
const presetChildren = presets[0]?.children?.[0]?.children ?? [];
|
|
194
|
+
|
|
195
|
+
const maxFields = 5;
|
|
196
|
+
return presetChildren.slice(0, maxFields).map((preset, index) => {
|
|
197
|
+
const fieldMeta = {
|
|
198
|
+
meta: {
|
|
199
|
+
...preset,
|
|
200
|
+
config: {
|
|
201
|
+
...preset.config,
|
|
202
|
+
displayMode: 'DISPLAY_ONLY',
|
|
203
|
+
contextName: pConnect.getContextName()
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
useCustomContext: item
|
|
207
|
+
};
|
|
208
|
+
const configObj = PCore.createPConnect(fieldMeta);
|
|
209
|
+
const meta = configObj.getPConnect().getMetadata();
|
|
210
|
+
const fieldInfo: {
|
|
211
|
+
name?: string;
|
|
212
|
+
value?: React.ReactNode;
|
|
213
|
+
} = meta ? prepareComponentInCaseSummary(meta, configObj.getPConnect) : {};
|
|
214
|
+
return hideFieldLabels
|
|
215
|
+
? { id: `${item[recordKey]} - ${index}`, value: fieldInfo.value }
|
|
216
|
+
: {
|
|
217
|
+
id: `${item[recordKey]} - ${index}`,
|
|
218
|
+
name: fieldInfo.name,
|
|
219
|
+
value: fieldInfo.value,
|
|
220
|
+
type: preset.type
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { Link } from '@mui/material';
|
|
2
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
3
|
+
|
|
4
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
5
|
+
|
|
6
|
+
import semanticUtils from './utils';
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line
|
|
9
|
+
const useStyles = makeStyles(theme => ({
|
|
10
|
+
root: {
|
|
11
|
+
paddingRight: theme.spacing(1),
|
|
12
|
+
paddingLeft: theme.spacing(1),
|
|
13
|
+
paddingTop: theme.spacing(1),
|
|
14
|
+
paddingBottom: theme.spacing(1),
|
|
15
|
+
marginRight: theme.spacing(1),
|
|
16
|
+
marginLeft: theme.spacing(1),
|
|
17
|
+
marginTop: theme.spacing(1),
|
|
18
|
+
marginBottom: theme.spacing(1)
|
|
19
|
+
},
|
|
20
|
+
fieldMargin: {
|
|
21
|
+
paddingRight: theme.spacing(1),
|
|
22
|
+
paddingLeft: theme.spacing(1),
|
|
23
|
+
paddingTop: theme.spacing(1),
|
|
24
|
+
paddingBottom: theme.spacing(1),
|
|
25
|
+
marginRight: theme.spacing(1),
|
|
26
|
+
marginLeft: theme.spacing(1),
|
|
27
|
+
marginTop: theme.spacing(1),
|
|
28
|
+
marginBottom: theme.spacing(1)
|
|
29
|
+
},
|
|
30
|
+
fieldLabel: {
|
|
31
|
+
fontWeight: 400,
|
|
32
|
+
color: theme.palette.text.secondary
|
|
33
|
+
},
|
|
34
|
+
fieldValue: {
|
|
35
|
+
fontWeight: 400,
|
|
36
|
+
color: theme.palette.text.primary
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
interface SemanticLinkProps extends PConnFieldProps {
|
|
41
|
+
// If any, enter additional props that only exist on SemanticLink here
|
|
42
|
+
text: string;
|
|
43
|
+
resourcePayload: any;
|
|
44
|
+
resourceParams: any;
|
|
45
|
+
previewKey: string | null;
|
|
46
|
+
onClick: (event: any) => void;
|
|
47
|
+
testId: string;
|
|
48
|
+
referenceType: string | null;
|
|
49
|
+
dataRelationshipContext: string | null;
|
|
50
|
+
contextPage: any;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default function SemanticLink(props: SemanticLinkProps) {
|
|
54
|
+
const {
|
|
55
|
+
text,
|
|
56
|
+
resourcePayload = {},
|
|
57
|
+
resourceParams = {},
|
|
58
|
+
getPConnect,
|
|
59
|
+
previewKey,
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
61
|
+
onClick,
|
|
62
|
+
testId = '',
|
|
63
|
+
referenceType,
|
|
64
|
+
dataRelationshipContext = null,
|
|
65
|
+
contextPage,
|
|
66
|
+
...restProps
|
|
67
|
+
} = props;
|
|
68
|
+
const { ACTION_OPENWORKBYHANDLE, ACTION_SHOWDATA }: any = PCore.getSemanticUrlUtils().getActions();
|
|
69
|
+
const pConnect = getPConnect();
|
|
70
|
+
const dataResourcePayLoad = resourcePayload?.resourceType === 'DATA' ? resourcePayload : null;
|
|
71
|
+
|
|
72
|
+
const {
|
|
73
|
+
RESOURCE_TYPES: { DATA },
|
|
74
|
+
WORKCLASS,
|
|
75
|
+
CASE_INFO: { CASE_INFO_CLASSID }
|
|
76
|
+
} = PCore.getConstants();
|
|
77
|
+
|
|
78
|
+
let linkURL = '';
|
|
79
|
+
let payload = {};
|
|
80
|
+
let dataViewName;
|
|
81
|
+
let linkComponentProps = {
|
|
82
|
+
href: linkURL
|
|
83
|
+
};
|
|
84
|
+
if (text) {
|
|
85
|
+
(linkComponentProps as any).href = linkURL;
|
|
86
|
+
}
|
|
87
|
+
let isData = false;
|
|
88
|
+
const shouldTreatAsDataReference = !previewKey && resourcePayload.caseClassName;
|
|
89
|
+
if (contextPage?.classID) {
|
|
90
|
+
resourcePayload.caseClassName = contextPage.classID;
|
|
91
|
+
}
|
|
92
|
+
/* TODO : In case of duplicate search case the classID is Work- need to set it to
|
|
93
|
+
the current case class ID */
|
|
94
|
+
if (resourcePayload.caseClassName === WORKCLASS) {
|
|
95
|
+
resourcePayload.caseClassName = pConnect.getValue(CASE_INFO_CLASSID);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function showDataAction() {
|
|
99
|
+
if (dataResourcePayLoad && dataResourcePayLoad.resourceType === 'DATA') {
|
|
100
|
+
const { content } = dataResourcePayLoad;
|
|
101
|
+
const lookUpDataPageInfo = PCore.getDataTypeUtils().getLookUpDataPageInfo(dataResourcePayLoad?.className);
|
|
102
|
+
const lookUpDataPage = PCore.getDataTypeUtils().getLookUpDataPage(dataResourcePayLoad?.className);
|
|
103
|
+
if (lookUpDataPageInfo) {
|
|
104
|
+
const { parameters }: any = lookUpDataPageInfo;
|
|
105
|
+
payload = Object.keys(parameters).reduce((acc, param) => {
|
|
106
|
+
const paramValue = parameters[param];
|
|
107
|
+
return {
|
|
108
|
+
...acc,
|
|
109
|
+
[param]: PCore.getAnnotationUtils().isProperty(paramValue) ? content[PCore.getAnnotationUtils().getPropertyName(paramValue)] : paramValue
|
|
110
|
+
};
|
|
111
|
+
}, {});
|
|
112
|
+
}
|
|
113
|
+
getPConnect()
|
|
114
|
+
.getActionsApi()
|
|
115
|
+
.showData('pyDetails', lookUpDataPage, {
|
|
116
|
+
...payload
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if ((referenceType && referenceType.toUpperCase() === DATA) || shouldTreatAsDataReference) {
|
|
120
|
+
getPConnect()
|
|
121
|
+
.getActionsApi()
|
|
122
|
+
.showData('pyDetails', dataViewName, {
|
|
123
|
+
...payload
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function openLinkClick(e) {
|
|
129
|
+
if (!e.metaKey && !e.ctrlKey) {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
if (
|
|
132
|
+
(dataResourcePayLoad && dataResourcePayLoad.resourceType === 'DATA') ||
|
|
133
|
+
(referenceType && referenceType.toUpperCase() === DATA) ||
|
|
134
|
+
shouldTreatAsDataReference
|
|
135
|
+
) {
|
|
136
|
+
showDataAction();
|
|
137
|
+
} else if (previewKey) {
|
|
138
|
+
getPConnect().getActionsApi().openWorkByHandle(previewKey, resourcePayload.caseClassName);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if ((referenceType && referenceType.toUpperCase() === DATA) || shouldTreatAsDataReference) {
|
|
144
|
+
try {
|
|
145
|
+
isData = true;
|
|
146
|
+
// @ts-expect-error
|
|
147
|
+
const dataRefContext = semanticUtils.getDataReferenceInfo(pConnect, dataRelationshipContext, contextPage);
|
|
148
|
+
dataViewName = dataRefContext.dataContext;
|
|
149
|
+
payload = dataRefContext.dataContextParameters as any;
|
|
150
|
+
} catch (error) {
|
|
151
|
+
console.log('Error in getting the data reference info', error);
|
|
152
|
+
}
|
|
153
|
+
} else if (resourcePayload && resourcePayload.resourceType === 'DATA') {
|
|
154
|
+
isData = true;
|
|
155
|
+
dataViewName = PCore.getDataTypeUtils().getLookUpDataPage(resourcePayload.className);
|
|
156
|
+
const lookUpDataPageInfo = PCore.getDataTypeUtils().getLookUpDataPageInfo(resourcePayload.className);
|
|
157
|
+
const { content } = resourcePayload;
|
|
158
|
+
if (lookUpDataPageInfo) {
|
|
159
|
+
const { parameters }: any = lookUpDataPageInfo;
|
|
160
|
+
payload = Object.keys(parameters).reduce((acc, param) => {
|
|
161
|
+
const paramValue = parameters[param];
|
|
162
|
+
return {
|
|
163
|
+
...acc,
|
|
164
|
+
[param]: PCore.getAnnotationUtils().isProperty(paramValue) ? content[PCore.getAnnotationUtils().getPropertyName(paramValue)] : paramValue
|
|
165
|
+
};
|
|
166
|
+
}, {});
|
|
167
|
+
} else {
|
|
168
|
+
const keysInfo = PCore.getDataTypeUtils().getDataPageKeys(dataViewName) ?? [];
|
|
169
|
+
payload = keysInfo.reduce((acc, curr) => {
|
|
170
|
+
return {
|
|
171
|
+
...acc,
|
|
172
|
+
[curr.keyName]: content[curr.isAlternateKeyStorage ? curr.linkedField : curr.keyName]
|
|
173
|
+
};
|
|
174
|
+
}, {});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (isData && dataViewName && payload) {
|
|
179
|
+
linkURL = PCore.getSemanticUrlUtils().getResolvedSemanticURL(
|
|
180
|
+
ACTION_SHOWDATA,
|
|
181
|
+
{ pageName: 'pyDetails', dataViewName },
|
|
182
|
+
{
|
|
183
|
+
...payload
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
} else {
|
|
187
|
+
// BUG-678282 fix to handle scenario when workID was not populated.
|
|
188
|
+
// Check renderParentLink in Caseview / CasePreview
|
|
189
|
+
resourceParams.objectID = resourceParams.workID === '' && typeof previewKey === 'string' ? previewKey.split(' ')[1] : resourceParams.workID;
|
|
190
|
+
if (previewKey) {
|
|
191
|
+
resourceParams.id = previewKey;
|
|
192
|
+
}
|
|
193
|
+
linkURL = PCore.getSemanticUrlUtils().getResolvedSemanticURL(ACTION_OPENWORKBYHANDLE, resourcePayload, resourceParams);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (text) {
|
|
197
|
+
linkComponentProps = {
|
|
198
|
+
...linkComponentProps,
|
|
199
|
+
href: linkURL
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<Link component='button' {...linkComponentProps} {...restProps} onClick={openLinkClick} data-testid={testId}>
|
|
205
|
+
{text || '--'}
|
|
206
|
+
</Link>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SemanticLink';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
function getDataReferenceInfo(pConnect, dataRelationshipContext) {
|
|
2
|
+
if (!pConnect) {
|
|
3
|
+
throw Error('PConnect parameter is required');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
let dataContext = '';
|
|
7
|
+
const payload = {};
|
|
8
|
+
const pageReference = pConnect.getPageReference();
|
|
9
|
+
const annotationUtils = PCore.getAnnotationUtils();
|
|
10
|
+
let fieldMetadata;
|
|
11
|
+
|
|
12
|
+
if (pageReference) {
|
|
13
|
+
/*
|
|
14
|
+
For page list the page refernce will be something like caseInfo.content.EmployeeRef[1].
|
|
15
|
+
Need to extract EmployeeRef from caseInfo.content.EmployeeRef[1]
|
|
16
|
+
*/
|
|
17
|
+
const propertySplit = pageReference.split('.');
|
|
18
|
+
|
|
19
|
+
// Regex to match if the property is list type. Eg: EmployeeRef[1]
|
|
20
|
+
const listPropertyRegex = /([a-z|A-Z]*[[][\d]*)[\]]$/gm;
|
|
21
|
+
// Regex to match [1] part of the property EmployeeRef[1]
|
|
22
|
+
const indexRegex = /([[][\d]*[\]])+/gm;
|
|
23
|
+
|
|
24
|
+
let contextProperty = dataRelationshipContext !== null ? dataRelationshipContext : propertySplit.pop();
|
|
25
|
+
const isListProperty = listPropertyRegex.test(contextProperty);
|
|
26
|
+
contextProperty = isListProperty ? contextProperty.replace(indexRegex, '') : contextProperty;
|
|
27
|
+
fieldMetadata = pConnect.getFieldMetadata(contextProperty);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (!!fieldMetadata && fieldMetadata.datasource) {
|
|
31
|
+
const { name, parameters } = fieldMetadata.datasource;
|
|
32
|
+
dataContext = name;
|
|
33
|
+
for (const [key, value] of Object.entries(parameters)) {
|
|
34
|
+
const property =
|
|
35
|
+
// @ts-expect-error - Property 'getLeafPropertyName' is private and only accessible within class 'AnnotationUtils'
|
|
36
|
+
dataRelationshipContext !== null ? annotationUtils.getPropertyName(value as string) : annotationUtils.getLeafPropertyName(value);
|
|
37
|
+
payload[key] = pConnect.getValue(`.${property}`);
|
|
38
|
+
}
|
|
39
|
+
return { dataContext, dataContextParameters: payload };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return {};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function isLinkTextEmpty(text) {
|
|
46
|
+
return text === '' || text === undefined || text === null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default { getDataReferenceInfo, isLinkTextEmpty };
|