@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,259 @@
|
|
|
1
|
+
import { type PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
3
|
+
import Avatar from '@mui/material/Avatar';
|
|
4
|
+
|
|
5
|
+
import { Utils } from '../../helpers/utils';
|
|
6
|
+
import { NavContext } from '../../helpers/reactContextHelpers';
|
|
7
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
8
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
9
|
+
|
|
10
|
+
import './AppShell.css';
|
|
11
|
+
|
|
12
|
+
interface AppShellProps extends PConnProps {
|
|
13
|
+
// If any, enter additional props that only exist on this component
|
|
14
|
+
showAppName: boolean;
|
|
15
|
+
pages: {
|
|
16
|
+
pxPageViewIcon: string;
|
|
17
|
+
pyClassName: string;
|
|
18
|
+
pyLabel: string;
|
|
19
|
+
pyRuleName: string;
|
|
20
|
+
pyURLContent: string;
|
|
21
|
+
}[];
|
|
22
|
+
caseTypes?: object[];
|
|
23
|
+
portalTemplate: string;
|
|
24
|
+
portalName: string;
|
|
25
|
+
portalLogo: string;
|
|
26
|
+
navDisplayOptions: { alignment: string; position: string };
|
|
27
|
+
httpMessages: string[];
|
|
28
|
+
pageMessages: string[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const useStyles = makeStyles(theme => ({
|
|
32
|
+
root: {},
|
|
33
|
+
content: {
|
|
34
|
+
flexGrow: 1,
|
|
35
|
+
height: '100vh',
|
|
36
|
+
overflow: 'auto',
|
|
37
|
+
marginLeft: theme.spacing(2),
|
|
38
|
+
marginRight: theme.spacing(2)
|
|
39
|
+
},
|
|
40
|
+
wsscontent: {
|
|
41
|
+
flexGrow: 1,
|
|
42
|
+
height: '100vh',
|
|
43
|
+
marginLeft: theme.spacing(1),
|
|
44
|
+
marginRight: theme.spacing(1)
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
export default function AppShell(props: PropsWithChildren<AppShellProps>) {
|
|
49
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
50
|
+
const NavBar = getComponentFromRegistry('NavBar');
|
|
51
|
+
const WssNavBar = getComponentFromRegistry('WssNavBar');
|
|
52
|
+
const AlertBanner = getComponentFromRegistry('AlertBanner');
|
|
53
|
+
|
|
54
|
+
const {
|
|
55
|
+
pages = [],
|
|
56
|
+
caseTypes = [],
|
|
57
|
+
showAppName,
|
|
58
|
+
children = [],
|
|
59
|
+
getPConnect,
|
|
60
|
+
httpMessages = [],
|
|
61
|
+
pageMessages = [],
|
|
62
|
+
portalTemplate,
|
|
63
|
+
portalName,
|
|
64
|
+
portalLogo,
|
|
65
|
+
navDisplayOptions
|
|
66
|
+
} = props;
|
|
67
|
+
|
|
68
|
+
const [open, setOpen] = useState(true);
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
70
|
+
const [activeTab, setActiveTab] = useState(!pages ? null : pages[0]?.pyRuleName);
|
|
71
|
+
const pConn = getPConnect();
|
|
72
|
+
const envInfo = PCore.getEnvironmentInfo();
|
|
73
|
+
const imageKey = envInfo.getOperatorImageInsKey();
|
|
74
|
+
const userName = envInfo.getOperatorName() || '';
|
|
75
|
+
const currentUserInitials = Utils.getInitials(userName);
|
|
76
|
+
const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : '';
|
|
77
|
+
const portalClass = pConn.getValue('.classID', ''); // 2nd arg empty string until typedef marked correctly
|
|
78
|
+
const envPortalName = envInfo.getPortalName();
|
|
79
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
80
|
+
|
|
81
|
+
const classes = useStyles();
|
|
82
|
+
const actionsAPI = pConn.getActionsApi();
|
|
83
|
+
const localeReference = pConn.getValue('.pyLocaleReference', ''); // 2nd arg empty string until typedef marked correctly
|
|
84
|
+
const [imageBlobUrl, setImageBlobUrl] = useState<string | Blob | null>(null);
|
|
85
|
+
// useState for appName and mapChildren - note these are ONLY updated once (on component mount!)
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
87
|
+
const [appName, setAppName] = useState('');
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
89
|
+
const [mapChildren, setMapChildren] = useState([]);
|
|
90
|
+
|
|
91
|
+
const messages = [...httpMessages, ...pageMessages];
|
|
92
|
+
|
|
93
|
+
const hasBanner = messages && messages.length ? messages.length > 0 : false;
|
|
94
|
+
let banners: any = null;
|
|
95
|
+
banners = hasBanner && (
|
|
96
|
+
<div style={{ display: 'flex', flexDirection: 'column', padding: '1em 0' }}>
|
|
97
|
+
<AlertBanner id='AppShell' variant='urgent' messages={messages} />
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
// Initial setting of appName and mapChildren
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
setAppName(PCore.getEnvironmentInfo().getApplicationName() || '');
|
|
103
|
+
|
|
104
|
+
const tempMap: any = (pConn.getChildren() as any)?.map((child: any, index) => {
|
|
105
|
+
const theChildComp = child.getPConnect().getComponentName();
|
|
106
|
+
const theKey = `.${index}`;
|
|
107
|
+
return (
|
|
108
|
+
<div id={theChildComp} key={theKey} style={{ border: 'solid 1px silver', margin: '1px' }}>
|
|
109
|
+
{theChildComp} will be here
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
setMapChildren(tempMap);
|
|
115
|
+
|
|
116
|
+
/* TODO: We're setting the `pyPortalTemplate` for now, this would be handled by the CoreJS in the future releases */
|
|
117
|
+
if (portalTemplate === 'wss') {
|
|
118
|
+
PCore.getEnvironmentInfo().setEnvironmentInfo({ ...PCore.getEnvironmentInfo().environmentInfoObject, pyPortalTemplate: 'wss' } as any);
|
|
119
|
+
}
|
|
120
|
+
}, []);
|
|
121
|
+
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
// @ts-expect-error
|
|
124
|
+
const caseTypesAvailableToCreateDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP;
|
|
125
|
+
if (caseTypesAvailableToCreateDP) {
|
|
126
|
+
const portalID = pConn.getValue('.pyOwner');
|
|
127
|
+
PCore.getDataPageUtils()
|
|
128
|
+
.getPageDataAsync(caseTypesAvailableToCreateDP, pConn.getContextName(), {
|
|
129
|
+
PortalName: portalID
|
|
130
|
+
})
|
|
131
|
+
.then((response: { pyCaseTypesAvailableToCreate?: any }) => {
|
|
132
|
+
if (response?.pyCaseTypesAvailableToCreate) {
|
|
133
|
+
pConn.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, {
|
|
134
|
+
skipDirtyValidation: true
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}, []);
|
|
140
|
+
|
|
141
|
+
const [iconURL, setIconURL] = useState<string | Blob>('');
|
|
142
|
+
const [fullIconURL, setFullIconURL] = useState<string | Blob>('');
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
// using the default icon then fetch it from the static folder (not auth involved)
|
|
145
|
+
if (
|
|
146
|
+
!portalLogo ||
|
|
147
|
+
portalLogo.toLowerCase().includes('pzpega-logo-mark') ||
|
|
148
|
+
portalLogo.toLowerCase().includes('py-logo') ||
|
|
149
|
+
portalLogo.toLowerCase().includes('py-full-logo')
|
|
150
|
+
) {
|
|
151
|
+
const portalLogoImage = Utils.getIconPath(Utils.getSDKStaticConentUrl()).concat('pzpega-logo-mark.svg');
|
|
152
|
+
setIconURL(portalLogoImage);
|
|
153
|
+
setFullIconURL(`${Utils.getSDKStaticConentUrl()}static/py-full-logo.svg`);
|
|
154
|
+
}
|
|
155
|
+
// not using default icon to fetch it using the way which uses authentication
|
|
156
|
+
else {
|
|
157
|
+
PCore.getAssetLoader()
|
|
158
|
+
.getSvcImageUrl(portalLogo)
|
|
159
|
+
.then(data => {
|
|
160
|
+
setIconURL(data);
|
|
161
|
+
setFullIconURL(data);
|
|
162
|
+
})
|
|
163
|
+
.catch(() => {
|
|
164
|
+
console.error(`${localizedVal('Unable to load the image for the portal logo/icon with the insName', 'AppShell')}:${portalLogo}`);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}, [portalLogo]);
|
|
168
|
+
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
if (imageKey && portalTemplate === 'wss') {
|
|
171
|
+
PCore.getAssetLoader()
|
|
172
|
+
.getSvcImageUrl(imageKey)
|
|
173
|
+
.then(imagePath => setImageBlobUrl(imagePath));
|
|
174
|
+
}
|
|
175
|
+
}, []);
|
|
176
|
+
|
|
177
|
+
const getOperator = () => {
|
|
178
|
+
return {
|
|
179
|
+
avatar: portalTemplate !== 'wss' ? <Avatar /> : { name: userName, imageSrc: imageBlobUrl },
|
|
180
|
+
name: userName,
|
|
181
|
+
currentUserInitials
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
function showPage(viewName, className) {
|
|
186
|
+
actionsAPI.showPage(viewName, className);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function openURL(URL) {
|
|
190
|
+
window.open(URL, '_blank');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const links = !pages
|
|
194
|
+
? []
|
|
195
|
+
: pages.map(page => {
|
|
196
|
+
const name = localizedVal(page.pyLabel, '', localeReference);
|
|
197
|
+
return {
|
|
198
|
+
text: name,
|
|
199
|
+
name,
|
|
200
|
+
icon: page.pxPageViewIcon.replace('pi pi-', ''),
|
|
201
|
+
active: page.pyRuleName === activeTab,
|
|
202
|
+
onClick: () => (!page.pyURLContent || page.pyURLContent === '' ? showPage(page.pyRuleName, page.pyClassName) : openURL(page.pyURLContent))
|
|
203
|
+
};
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
if (pConn.hasChildren()) {
|
|
207
|
+
// const theChildren = pConn.getChildren();
|
|
208
|
+
// const mapChildCompNames = theChildren.map((child) => { return child.getPConnect().getComponentName()});
|
|
209
|
+
// debugging/investigation help
|
|
210
|
+
// console.log(`AppShell has children: ${theChildren.length}`);
|
|
211
|
+
// console.log(`--> ${mapChildCompNames.map((name) => {return name;})}`);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (portalTemplate === 'wss') {
|
|
215
|
+
return (
|
|
216
|
+
<div id='AppShell' className={classes.root}>
|
|
217
|
+
<WssNavBar
|
|
218
|
+
portalName={portalName}
|
|
219
|
+
imageSrc={iconURL}
|
|
220
|
+
fullImageSrc={fullIconURL}
|
|
221
|
+
appName={localizedVal(appNameToDisplay || '', '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase())}
|
|
222
|
+
appInfo={{
|
|
223
|
+
imageSrc: iconURL,
|
|
224
|
+
appName: localizedVal(appNameToDisplay || '', '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase()),
|
|
225
|
+
onClick: links[0] && /* links[0].onClick ? */ links[0].onClick /* : undefined */
|
|
226
|
+
}}
|
|
227
|
+
navLinks={links.filter((link, index) => {
|
|
228
|
+
return index !== 0;
|
|
229
|
+
})}
|
|
230
|
+
operator={getOperator()}
|
|
231
|
+
navDisplayOptions={navDisplayOptions}
|
|
232
|
+
/>
|
|
233
|
+
<div className={classes.wsscontent}>
|
|
234
|
+
{banners}
|
|
235
|
+
{children}
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return (
|
|
242
|
+
<NavContext.Provider value={{ open, setOpen }}>
|
|
243
|
+
<div id='AppShell' className={classes.root} style={{ display: 'flex' }}>
|
|
244
|
+
<NavBar
|
|
245
|
+
getPConnect={getPConnect}
|
|
246
|
+
pConn={getPConnect()}
|
|
247
|
+
appName={localizedVal(appNameToDisplay || '', '', `${portalClass}!PORTAL!${envPortalName}`.toUpperCase())}
|
|
248
|
+
pages={pages}
|
|
249
|
+
caseTypes={caseTypes}
|
|
250
|
+
/>
|
|
251
|
+
|
|
252
|
+
<div className={classes.content}>
|
|
253
|
+
{banners}
|
|
254
|
+
{children}
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
</NavContext.Provider>
|
|
258
|
+
);
|
|
259
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './AppShell';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Children, type PropsWithChildren, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
4
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
5
|
+
|
|
6
|
+
interface BannerPageProps extends PConnProps {
|
|
7
|
+
// If any, enter additional props that only exist on this component
|
|
8
|
+
layout?: string;
|
|
9
|
+
heading?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
imageTheme?: string;
|
|
12
|
+
backgroundImage?: string;
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
tintImage?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* BannerPage template.
|
|
19
|
+
*/
|
|
20
|
+
export default function BannerPage(props: PropsWithChildren<BannerPageProps>) {
|
|
21
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
22
|
+
const Banner = getComponentFromRegistry('Banner');
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
children,
|
|
26
|
+
layout = 'two-column',
|
|
27
|
+
heading = '',
|
|
28
|
+
message = '',
|
|
29
|
+
imageTheme = 'light',
|
|
30
|
+
backgroundImage = '',
|
|
31
|
+
backgroundColor = '',
|
|
32
|
+
tintImage = false
|
|
33
|
+
} = props;
|
|
34
|
+
|
|
35
|
+
const childArray = useMemo(() => {
|
|
36
|
+
return Children.toArray(children);
|
|
37
|
+
}, [children]);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Banner
|
|
41
|
+
variant={layout}
|
|
42
|
+
a={childArray[0]}
|
|
43
|
+
b={childArray[1]}
|
|
44
|
+
banner={{
|
|
45
|
+
variant: imageTheme,
|
|
46
|
+
backgroundColor,
|
|
47
|
+
title: heading,
|
|
48
|
+
message,
|
|
49
|
+
backgroundImage,
|
|
50
|
+
tintImage
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './BannerPage';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
3
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
4
|
+
|
|
5
|
+
interface CaseSummaryProps extends PConnProps {
|
|
6
|
+
arPrimaryFields: any[];
|
|
7
|
+
arSecondaryFields: any[];
|
|
8
|
+
// If any, enter additional props that only exist on this component
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default function CaseSummary(props: PropsWithChildren<CaseSummaryProps>) {
|
|
12
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
13
|
+
const CaseSummaryFields = getComponentFromRegistry('CaseSummaryFields');
|
|
14
|
+
|
|
15
|
+
const { children } = props;
|
|
16
|
+
let { arPrimaryFields = [], arSecondaryFields = [] } = props;
|
|
17
|
+
|
|
18
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
19
|
+
const localeCategory = 'ModalContainer';
|
|
20
|
+
|
|
21
|
+
function prepareComponentInCaseSummary(pConnectMeta, getPConnect) {
|
|
22
|
+
const { config, children } = pConnectMeta;
|
|
23
|
+
const pConnect = getPConnect();
|
|
24
|
+
|
|
25
|
+
const caseSummaryComponentObject: any = {};
|
|
26
|
+
|
|
27
|
+
const { type } = pConnectMeta;
|
|
28
|
+
const createdComponent = pConnect.createComponent({
|
|
29
|
+
type,
|
|
30
|
+
children: children ? [...children] : [],
|
|
31
|
+
config: {
|
|
32
|
+
...config
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
caseSummaryComponentObject.value = createdComponent;
|
|
37
|
+
return caseSummaryComponentObject;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function prepareCaseSummaryData(summaryFieldChildren) {
|
|
41
|
+
const convertChildrenToSummaryData = kid => {
|
|
42
|
+
return kid?.map((childItem, index) => {
|
|
43
|
+
const childMeta = childItem.getPConnect().meta;
|
|
44
|
+
const caseSummaryComponentObject = prepareComponentInCaseSummary(childMeta, childItem.getPConnect);
|
|
45
|
+
caseSummaryComponentObject.id = index + 1;
|
|
46
|
+
return caseSummaryComponentObject;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
return summaryFieldChildren ? convertChildrenToSummaryData(summaryFieldChildren?.getChildren()) : undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (arPrimaryFields.length === 0 && arSecondaryFields.length === 0) {
|
|
53
|
+
for (const child of children as ReactElement[]) {
|
|
54
|
+
const childPConn = (child as ReactElement).props.getPConnect();
|
|
55
|
+
const childPConnData = childPConn.resolveConfigProps(childPConn.getRawMetadata());
|
|
56
|
+
if (childPConnData.name.toLowerCase() === 'primary fields') {
|
|
57
|
+
arPrimaryFields = childPConnData.children;
|
|
58
|
+
arPrimaryFields.forEach(field => {
|
|
59
|
+
if (field.config?.value && typeof field.config?.value === 'string') {
|
|
60
|
+
field.config.value = localizedVal(field.config.value, localeCategory);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
} else if (childPConnData.name.toLowerCase() === 'secondary fields') {
|
|
64
|
+
const secondarySummaryFields = prepareCaseSummaryData(childPConn);
|
|
65
|
+
arSecondaryFields = childPConnData.children;
|
|
66
|
+
arSecondaryFields.forEach((field, index) => {
|
|
67
|
+
field.config.displayLabel = secondarySummaryFields[index]?.value?.props?.label;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div id='CaseSummary'>
|
|
75
|
+
<CaseSummaryFields theFields={arPrimaryFields} />
|
|
76
|
+
<CaseSummaryFields theFields={arSecondaryFields} />
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CaseSummary';
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { type PropsWithChildren, type ReactElement, useContext, useEffect, useState } from 'react';
|
|
2
|
+
import { Avatar, Card, CardHeader, Divider, Typography } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import Button from '@mui/material/Button';
|
|
6
|
+
import Grid from '@mui/material/Grid';
|
|
7
|
+
|
|
8
|
+
import { Utils } from '../../helpers/utils';
|
|
9
|
+
import { PegaStoreContext as StoreContext } from '@pega/sdk-react';
|
|
10
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
11
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
12
|
+
|
|
13
|
+
interface CaseViewProps extends PConnProps {
|
|
14
|
+
// If any, enter additional props that only exist on this component
|
|
15
|
+
icon: string;
|
|
16
|
+
subheader: string;
|
|
17
|
+
header: string;
|
|
18
|
+
showIconInHeader: boolean;
|
|
19
|
+
caseInfo: any;
|
|
20
|
+
lastUpdateCaseTime: any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const useStyles = makeStyles(theme => ({
|
|
24
|
+
root: {
|
|
25
|
+
paddingRight: theme.spacing(1),
|
|
26
|
+
paddingLeft: theme.spacing(1),
|
|
27
|
+
paddingTop: theme.spacing(1),
|
|
28
|
+
paddingBottom: theme.spacing(1),
|
|
29
|
+
marginRight: theme.spacing(1),
|
|
30
|
+
marginLeft: theme.spacing(1),
|
|
31
|
+
marginTop: theme.spacing(1),
|
|
32
|
+
marginBottom: theme.spacing(1)
|
|
33
|
+
},
|
|
34
|
+
caseViewHeader: {
|
|
35
|
+
backgroundColor: theme.palette.info.light,
|
|
36
|
+
color: theme.palette.getContrastText(theme.palette.info.light),
|
|
37
|
+
borderRadius: 'inherit'
|
|
38
|
+
},
|
|
39
|
+
caseViewIconBox: {
|
|
40
|
+
backgroundColor: theme.palette.info.dark,
|
|
41
|
+
width: theme.spacing(8),
|
|
42
|
+
height: theme.spacing(8),
|
|
43
|
+
padding: theme.spacing(1)
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
|
|
48
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
49
|
+
const CaseViewActionsMenu = getComponentFromRegistry('CaseViewActionsMenu');
|
|
50
|
+
const VerticalTabs = getComponentFromRegistry('VerticalTabs');
|
|
51
|
+
const DeferLoad = getComponentFromRegistry('DeferLoad');
|
|
52
|
+
|
|
53
|
+
const {
|
|
54
|
+
getPConnect,
|
|
55
|
+
icon = '',
|
|
56
|
+
header,
|
|
57
|
+
subheader,
|
|
58
|
+
children = [],
|
|
59
|
+
caseInfo: { availableActions = [], availableProcesses = [], hasNewAttachments, caseTypeID = '', caseTypeName = '', caseTypeIcon }
|
|
60
|
+
} = props;
|
|
61
|
+
const { lastUpdateCaseTime = getPConnect().getValue('caseInfo.lastUpdateTime') } = props;
|
|
62
|
+
const currentCaseID = props.caseInfo.ID;
|
|
63
|
+
let isComponentMounted = true;
|
|
64
|
+
const { displayOnlyFA } = useContext<any>(StoreContext);
|
|
65
|
+
|
|
66
|
+
const thePConn = getPConnect();
|
|
67
|
+
|
|
68
|
+
const classes = useStyles();
|
|
69
|
+
|
|
70
|
+
const editAction = availableActions.find(action => action.ID === 'pyUpdateCaseDetails');
|
|
71
|
+
|
|
72
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
73
|
+
const localizationService = thePConn.getLocalizationService();
|
|
74
|
+
const localeCategory = 'CaseView';
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* @param inName the metadata <em>name</em> that will cause a region to be returned
|
|
79
|
+
*/
|
|
80
|
+
function getChildRegionByName(inName: string): any {
|
|
81
|
+
for (const child of children as ReactElement[]) {
|
|
82
|
+
const theMetadataType: string = (child as ReactElement).props.getPConnect().getRawMetadata().type?.toLowerCase();
|
|
83
|
+
const theMetadataName: string = (child as ReactElement).props.getPConnect().getRawMetadata().name?.toLowerCase();
|
|
84
|
+
if (theMetadataType === 'region' && theMetadataName === inName) {
|
|
85
|
+
return child;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const theSummaryRegion = getChildRegionByName('summary');
|
|
93
|
+
const theStagesRegion = getChildRegionByName('stages');
|
|
94
|
+
const theTodoRegion = getChildRegionByName('todo');
|
|
95
|
+
const theUtilitiesRegion = getChildRegionByName('utilities');
|
|
96
|
+
const theTabsRegion = getChildRegionByName('tabs');
|
|
97
|
+
|
|
98
|
+
let iconForCaseType = caseTypeIcon ? caseTypeIcon.replace('pi pi-', '') : icon;
|
|
99
|
+
|
|
100
|
+
if (!iconForCaseType || iconForCaseType.includes('.')) {
|
|
101
|
+
iconForCaseType = 'polaris-solid';
|
|
102
|
+
}
|
|
103
|
+
const caseSvgIconUrl = Utils.getImageSrc(iconForCaseType, Utils.getSDKStaticConentUrl());
|
|
104
|
+
|
|
105
|
+
const [activeVertTab, setActiveVertTab] = useState(0);
|
|
106
|
+
|
|
107
|
+
// const tmpLoadData1 = { config: { label: "Details", name: "pyDetailsTabContent" }, type: "DeferLoad" };
|
|
108
|
+
// const tmpLoadData2 = { config: { label: "Case History", name: "CaseHistory" }, type: "DeferLoad" };
|
|
109
|
+
|
|
110
|
+
// Extract the tabs we need to display from theTabsRegion (one tab per entry in theTabsRegionChildren)
|
|
111
|
+
const theTabsRegionChildren = theTabsRegion?.props.getPConnect().getChildren();
|
|
112
|
+
|
|
113
|
+
// vertTabInfo is sent to VerticalTabs component
|
|
114
|
+
const vertTabInfo: object[] = [];
|
|
115
|
+
|
|
116
|
+
// deferLoadInfo is sent to DeferLoad component (currently selected entry)
|
|
117
|
+
const deferLoadInfo: any[] = [];
|
|
118
|
+
|
|
119
|
+
if (theTabsRegionChildren) {
|
|
120
|
+
// populate vertTabInfo and deferLoadInfo
|
|
121
|
+
theTabsRegionChildren.forEach((tabComp, index) => {
|
|
122
|
+
const theTabCompConfig = tabComp.getPConnect().getConfigProps();
|
|
123
|
+
// eslint-disable-next-line prefer-const
|
|
124
|
+
let { label, inheritedProps } = theTabCompConfig;
|
|
125
|
+
// For some tabs, "label" property is not avaialable in theTabCompConfig, so will get them from inheritedProps
|
|
126
|
+
if (!label) {
|
|
127
|
+
inheritedProps.forEach(inheritedProp => {
|
|
128
|
+
if (inheritedProp.prop === 'label') {
|
|
129
|
+
label = inheritedProp.value;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
// We'll display the tabs when either visibility property doesn't exist or is true(if exists)
|
|
134
|
+
if (theTabCompConfig.visibility === undefined || theTabCompConfig.visibility === true) {
|
|
135
|
+
vertTabInfo.push({ name: label, id: index });
|
|
136
|
+
deferLoadInfo.push({ type: 'DeferLoad', config: theTabCompConfig });
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function handleVerticalTabClick(eventDetail: any) {
|
|
142
|
+
const theItem = parseInt(eventDetail.additionalData.itemClicked, 10);
|
|
143
|
+
|
|
144
|
+
// only call useEffectSetter if the component is mounted
|
|
145
|
+
if (isComponentMounted) {
|
|
146
|
+
setActiveVertTab(theItem);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Add and Remove event listener for VerticalTabClick only at startup and teardown
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
document.addEventListener('VerticalTabClick', (event: any) => {
|
|
153
|
+
handleVerticalTabClick(event.detail);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
return (): void => {
|
|
157
|
+
// inform that the component is unmounted so other code can
|
|
158
|
+
// know not to try to call useState setters (to avoid console warnings)
|
|
159
|
+
isComponentMounted = false;
|
|
160
|
+
|
|
161
|
+
document.removeEventListener('VerticalTabClick', (event: any) => {
|
|
162
|
+
handleVerticalTabClick(event.detail);
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
}, []);
|
|
166
|
+
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
if (hasNewAttachments) {
|
|
169
|
+
PCore.getPubSubUtils().publish((PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true);
|
|
170
|
+
}
|
|
171
|
+
}, [hasNewAttachments]);
|
|
172
|
+
|
|
173
|
+
function _editClick() {
|
|
174
|
+
const actionsAPI = thePConn.getActionsApi();
|
|
175
|
+
const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);
|
|
176
|
+
|
|
177
|
+
openLocalAction(editAction.ID, { ...editAction, containerName: 'modal', type: 'express' });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function getActionButtonsHtml(): any {
|
|
181
|
+
return (
|
|
182
|
+
<Box>
|
|
183
|
+
{editAction && (
|
|
184
|
+
<Button
|
|
185
|
+
id='edit'
|
|
186
|
+
onClick={() => {
|
|
187
|
+
_editClick();
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
{localizedVal('Edit', localeCategory)}
|
|
191
|
+
</Button>
|
|
192
|
+
)}
|
|
193
|
+
<CaseViewActionsMenu
|
|
194
|
+
getPConnect={getPConnect}
|
|
195
|
+
availableActions={availableActions}
|
|
196
|
+
availableProcesses={availableProcesses}
|
|
197
|
+
caseTypeName={caseTypeName}
|
|
198
|
+
caseTypeID={caseTypeID}
|
|
199
|
+
/>
|
|
200
|
+
</Box>
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function getContainerContents() {
|
|
205
|
+
if (!displayOnlyFA) {
|
|
206
|
+
// show full portal
|
|
207
|
+
return (
|
|
208
|
+
<Grid container>
|
|
209
|
+
<Grid size={{ xs: 3 }}>
|
|
210
|
+
<div hidden={true} id='current-caseID'>
|
|
211
|
+
{currentCaseID}
|
|
212
|
+
</div>
|
|
213
|
+
<Card className={classes.root}>
|
|
214
|
+
<CardHeader
|
|
215
|
+
className={classes.caseViewHeader}
|
|
216
|
+
title={
|
|
217
|
+
<Typography variant='h6' component='div' id='case-name'>
|
|
218
|
+
{localizationService.getLocalizedText(header)}
|
|
219
|
+
</Typography>
|
|
220
|
+
}
|
|
221
|
+
subheader={
|
|
222
|
+
<Typography variant='body1' component='div' id='caseId'>
|
|
223
|
+
{subheader}
|
|
224
|
+
</Typography>
|
|
225
|
+
}
|
|
226
|
+
avatar={
|
|
227
|
+
<Avatar className={classes.caseViewIconBox} variant='square'>
|
|
228
|
+
<img src={caseSvgIconUrl} />
|
|
229
|
+
</Avatar>
|
|
230
|
+
}
|
|
231
|
+
/>
|
|
232
|
+
{getActionButtonsHtml()}
|
|
233
|
+
<Divider />
|
|
234
|
+
{theSummaryRegion}
|
|
235
|
+
<Divider />
|
|
236
|
+
{vertTabInfo.length > 1 && <VerticalTabs tabconfig={vertTabInfo} />}
|
|
237
|
+
</Card>
|
|
238
|
+
</Grid>
|
|
239
|
+
|
|
240
|
+
<Grid size={{ xs: 6 }}>
|
|
241
|
+
{theStagesRegion}
|
|
242
|
+
{theTodoRegion}
|
|
243
|
+
{deferLoadInfo.length > 0 && (
|
|
244
|
+
<DeferLoad getPConnect={getPConnect} name={deferLoadInfo[activeVertTab].config.name} isTab lastUpdateCaseTime={lastUpdateCaseTime} />
|
|
245
|
+
)}
|
|
246
|
+
</Grid>
|
|
247
|
+
|
|
248
|
+
<Grid size={{ xs: 3 }}>{theUtilitiesRegion}</Grid>
|
|
249
|
+
</Grid>
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
// displayOnlyFA - only show the "todo" region
|
|
253
|
+
return (
|
|
254
|
+
<Grid container>
|
|
255
|
+
<Grid size={{ xs: 12 }}>{theTodoRegion}</Grid>
|
|
256
|
+
</Grid>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return getContainerContents();
|
|
261
|
+
}
|