@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,452 @@
|
|
|
1
|
+
import { Utils } from './utils';
|
|
2
|
+
|
|
3
|
+
export const TABLE_CELL = 'SdkRenderer';
|
|
4
|
+
export const DELETE_ICON = 'DeleteIcon';
|
|
5
|
+
|
|
6
|
+
// BUG-615253: Workaround for autosize in table with lazy loading components
|
|
7
|
+
/* istanbul ignore next */
|
|
8
|
+
function getFieldWidth(field, label) {
|
|
9
|
+
let width: number;
|
|
10
|
+
switch (field.type) {
|
|
11
|
+
case 'Time':
|
|
12
|
+
width = 150;
|
|
13
|
+
break;
|
|
14
|
+
case 'Date':
|
|
15
|
+
width = 160;
|
|
16
|
+
break;
|
|
17
|
+
case 'DateTime':
|
|
18
|
+
width = 205;
|
|
19
|
+
break;
|
|
20
|
+
case 'AutoComplete':
|
|
21
|
+
case 'TextArea':
|
|
22
|
+
width = 190;
|
|
23
|
+
break;
|
|
24
|
+
case 'Currency':
|
|
25
|
+
case 'TextInput':
|
|
26
|
+
width = 182;
|
|
27
|
+
break;
|
|
28
|
+
case 'Checkbox':
|
|
29
|
+
// eslint-disable-next-line no-case-declarations
|
|
30
|
+
const text = document.createElement('span');
|
|
31
|
+
document.body.appendChild(text);
|
|
32
|
+
text.style.fontSize = '13px';
|
|
33
|
+
text.style.position = 'absolute';
|
|
34
|
+
text.innerHTML = label;
|
|
35
|
+
width = Math.ceil(text.clientWidth) + 30;
|
|
36
|
+
document.body.removeChild(text);
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
width = 180;
|
|
40
|
+
}
|
|
41
|
+
return width;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const getContext = thePConn => {
|
|
45
|
+
const contextName = thePConn.getContextName();
|
|
46
|
+
const pageReference = thePConn.getPageReference();
|
|
47
|
+
const { referenceList } = thePConn.getStateProps()?.config || thePConn.getStateProps();
|
|
48
|
+
const pageReferenceForRows = referenceList.startsWith('.') ? `${pageReference}.${referenceList.substring(1)}` : referenceList;
|
|
49
|
+
|
|
50
|
+
// removing "caseInfo.content" prefix to avoid setting it as a target while preparing pageInstructions
|
|
51
|
+
// skipping the removal as StateMachine itself is removing this case info prefix while preparing pageInstructions
|
|
52
|
+
// referenceList = pageReferenceForRows.replace(
|
|
53
|
+
// PCore.getConstants().CASE_INFO.CASE_INFO_CONTENT,
|
|
54
|
+
// ""
|
|
55
|
+
// );
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
contextName,
|
|
59
|
+
referenceListStr: referenceList,
|
|
60
|
+
pageReferenceForRows
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const populateRowKey = rawData => {
|
|
65
|
+
return rawData.map((row: any, index: number) => {
|
|
66
|
+
return { ...row, index };
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const getApiContext = (processedData, pConnect, reorderCB) => {
|
|
71
|
+
return {
|
|
72
|
+
fetchData: () => {
|
|
73
|
+
return new Promise(resolve => {
|
|
74
|
+
resolve({
|
|
75
|
+
data: processedData,
|
|
76
|
+
filteredRecordCount: processedData.length,
|
|
77
|
+
totalRecordCount: processedData.length
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
fetchPersonalizations: () => {
|
|
82
|
+
return Promise.resolve({});
|
|
83
|
+
},
|
|
84
|
+
applyRowReorder: (sourceKey, destinationKey) => {
|
|
85
|
+
// indexes are keys for simple table so, it should work.
|
|
86
|
+
reorderCB();
|
|
87
|
+
return Promise.resolve(pConnect.getListActions().reorder(parseInt(sourceKey, 10), parseInt(destinationKey, 10)));
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const PRIMARY_FIELDS = 'pyPrimaryFields';
|
|
93
|
+
const SUPPORTED_FIELD_TYPES = [
|
|
94
|
+
'Address',
|
|
95
|
+
'TextArea',
|
|
96
|
+
'TextInput',
|
|
97
|
+
'Phone',
|
|
98
|
+
'Email',
|
|
99
|
+
'Time',
|
|
100
|
+
'URL',
|
|
101
|
+
'Percentage',
|
|
102
|
+
'Integer',
|
|
103
|
+
'Decimal',
|
|
104
|
+
'Date',
|
|
105
|
+
'DateTime',
|
|
106
|
+
'Currency',
|
|
107
|
+
'Checkbox',
|
|
108
|
+
'Dropdown',
|
|
109
|
+
'AutoComplete',
|
|
110
|
+
'UserReference',
|
|
111
|
+
'RichText'
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
export const getConfigFields = (rawFields, contextClass, primaryFieldsViewIndex) => {
|
|
115
|
+
let primaryFields: any = [];
|
|
116
|
+
let configFields: any = [];
|
|
117
|
+
|
|
118
|
+
if (primaryFieldsViewIndex > -1) {
|
|
119
|
+
let primaryFieldVMD: any = PCore.getMetadataUtils().resolveView(PRIMARY_FIELDS);
|
|
120
|
+
if (Array.isArray(primaryFieldVMD)) {
|
|
121
|
+
primaryFieldVMD = primaryFieldVMD.find(primaryFieldView => primaryFieldView.classID === contextClass);
|
|
122
|
+
primaryFields = primaryFieldVMD?.children?.[0]?.children || [];
|
|
123
|
+
} else if (primaryFieldVMD?.classID === contextClass) {
|
|
124
|
+
primaryFields = primaryFieldVMD?.children?.[0]?.children || [];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (primaryFields.length) {
|
|
128
|
+
primaryFields = primaryFields.filter(primaryField => SUPPORTED_FIELD_TYPES.includes(primaryField.type));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
configFields = [...rawFields.slice(0, primaryFieldsViewIndex), ...primaryFields, ...rawFields.slice(primaryFieldsViewIndex + 1)];
|
|
133
|
+
// filter duplicate fields after combining raw fields and primary fields
|
|
134
|
+
return configFields.filter((field, index) => configFields.findIndex(_field => field.config?.value === _field.config?.value) === index);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export const buildMetaForListView = (fieldMetadata, fields, type, ruleClass, name, propertyLabel, isDataObject, parameters) => {
|
|
138
|
+
return {
|
|
139
|
+
name,
|
|
140
|
+
config: {
|
|
141
|
+
type,
|
|
142
|
+
referenceList: fieldMetadata.datasource.name,
|
|
143
|
+
parameters: parameters ?? fieldMetadata.datasource.parameters,
|
|
144
|
+
personalization: false,
|
|
145
|
+
isDataObject,
|
|
146
|
+
grouping: true,
|
|
147
|
+
globalSearch: true,
|
|
148
|
+
reorderFields: true,
|
|
149
|
+
toggleFieldVisibility: true,
|
|
150
|
+
title: propertyLabel,
|
|
151
|
+
personalizationId: '' /* TODO */,
|
|
152
|
+
template: 'ListView',
|
|
153
|
+
presets: [
|
|
154
|
+
{
|
|
155
|
+
name: 'presets',
|
|
156
|
+
template: 'Table',
|
|
157
|
+
config: {},
|
|
158
|
+
children: [
|
|
159
|
+
{
|
|
160
|
+
name: 'Columns',
|
|
161
|
+
type: 'Region',
|
|
162
|
+
children: fields
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
label: propertyLabel,
|
|
166
|
+
id: 'P_' /* TODO */
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
ruleClass
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export function isFLProperty(label) {
|
|
175
|
+
return label?.startsWith('@FL');
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* [getFieldLabel]
|
|
180
|
+
* Description - A utility that returns resolved field label for "@FL" annotation i.e from data model.
|
|
181
|
+
* @param {Object} fieldConfig
|
|
182
|
+
* @returns {string} resolved label string
|
|
183
|
+
*
|
|
184
|
+
* example:
|
|
185
|
+
* fieldConfig = {label: "@FL .pyID", classID: "TestCase-Work"};
|
|
186
|
+
* return "Case ID"
|
|
187
|
+
*/
|
|
188
|
+
export function getFieldLabel(fieldConfig) {
|
|
189
|
+
const { label, classID, caption } = fieldConfig;
|
|
190
|
+
let fieldLabel = (label ?? caption)?.substring(4);
|
|
191
|
+
const labelSplit = fieldLabel?.split('.');
|
|
192
|
+
const propertyName = labelSplit?.pop();
|
|
193
|
+
const fieldMetaData: any = PCore.getMetadataUtils().getPropertyMetadata(propertyName, classID) ?? {};
|
|
194
|
+
fieldLabel = fieldMetaData.label ?? fieldMetaData.caption ?? propertyName;
|
|
195
|
+
return fieldLabel;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export const updateFieldLabels = (fields, configFields, primaryFieldsViewIndex, pConnect, options) => {
|
|
199
|
+
const labelsOfFields: any = [];
|
|
200
|
+
const { columnsRawConfig = [] } = options;
|
|
201
|
+
fields.forEach((field, idx) => {
|
|
202
|
+
const rawColumnConfig = columnsRawConfig[idx]?.config;
|
|
203
|
+
if (field.config.value === PRIMARY_FIELDS) {
|
|
204
|
+
labelsOfFields.push('');
|
|
205
|
+
} else if (isFLProperty(rawColumnConfig?.label ?? rawColumnConfig?.caption)) {
|
|
206
|
+
labelsOfFields.push(getFieldLabel(rawColumnConfig) || field.config.label || field.config.caption);
|
|
207
|
+
} else {
|
|
208
|
+
labelsOfFields.push(field.config.label || field.config.caption);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
if (primaryFieldsViewIndex > -1) {
|
|
213
|
+
const totalPrimaryFieldsColumns = configFields.length - fields.length + 1;
|
|
214
|
+
if (totalPrimaryFieldsColumns) {
|
|
215
|
+
const primaryFieldLabels: any = [];
|
|
216
|
+
for (let i = primaryFieldsViewIndex; i < primaryFieldsViewIndex + totalPrimaryFieldsColumns; i += 1) {
|
|
217
|
+
let label = configFields[i].config?.label;
|
|
218
|
+
if (isFLProperty(label)) {
|
|
219
|
+
label = getFieldLabel(configFields[i].config);
|
|
220
|
+
} else if (label.startsWith('@')) {
|
|
221
|
+
label = label.substring(3);
|
|
222
|
+
}
|
|
223
|
+
if (pConnect) {
|
|
224
|
+
label = pConnect.getLocalizedValue(label);
|
|
225
|
+
}
|
|
226
|
+
primaryFieldLabels.push(label);
|
|
227
|
+
}
|
|
228
|
+
labelsOfFields.splice(primaryFieldsViewIndex, 1, ...primaryFieldLabels);
|
|
229
|
+
} else {
|
|
230
|
+
labelsOfFields.splice(primaryFieldsViewIndex, 1);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return labelsOfFields;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export const buildFieldsForTable = (configFields, pConnect, showDeleteButton, options) => {
|
|
237
|
+
const { primaryFieldsViewIndex, fields } = options;
|
|
238
|
+
|
|
239
|
+
// get resolved field labels for primary fields raw config included in configFields
|
|
240
|
+
const fieldsLabels = updateFieldLabels(fields, configFields, primaryFieldsViewIndex, pConnect, {
|
|
241
|
+
columnsRawConfig: pConnect.getRawConfigProps()?.children?.find(item => item?.name === 'Columns')?.children
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
const fieldDefs = configFields.map((field, index) => {
|
|
245
|
+
return {
|
|
246
|
+
type: 'text',
|
|
247
|
+
label: fieldsLabels[index],
|
|
248
|
+
fillAvailableSpace: !!field.config.fillAvailableSpace,
|
|
249
|
+
id: `${index}`,
|
|
250
|
+
name: field.config.value.substr(4),
|
|
251
|
+
cellRenderer: TABLE_CELL,
|
|
252
|
+
sort: false,
|
|
253
|
+
noContextMenu: true,
|
|
254
|
+
showMenu: false,
|
|
255
|
+
meta: {
|
|
256
|
+
...field
|
|
257
|
+
},
|
|
258
|
+
// BUG-615253: Workaround for autosize in table with lazy loading components
|
|
259
|
+
width: getFieldWidth(field, fields[index].config.label)
|
|
260
|
+
};
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
// ONLY add DELETE_ICON to fields when the table is requested as EDITABLE
|
|
264
|
+
if (showDeleteButton) {
|
|
265
|
+
fieldDefs.push({
|
|
266
|
+
type: 'text',
|
|
267
|
+
id: fieldDefs.length,
|
|
268
|
+
cellRenderer: DELETE_ICON,
|
|
269
|
+
sort: false,
|
|
270
|
+
noContextMenu: true,
|
|
271
|
+
showMenu: false,
|
|
272
|
+
// BUG-615253: Workaround for autosize in table with lazy loading components
|
|
273
|
+
width: 46
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return fieldDefs;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export const createMetaForTable = (fields, renderMode) => {
|
|
281
|
+
return {
|
|
282
|
+
height: {
|
|
283
|
+
minHeight: 'auto',
|
|
284
|
+
fitHeightToElement: 'fitHeightToElement',
|
|
285
|
+
deltaAdjustment: 'deltaAdjustment',
|
|
286
|
+
autoSize: true
|
|
287
|
+
},
|
|
288
|
+
fieldDefs: fields,
|
|
289
|
+
itemKey: 'index',
|
|
290
|
+
grouping: false,
|
|
291
|
+
reorderFields: false,
|
|
292
|
+
reorderItems: renderMode === 'Editable',
|
|
293
|
+
dragHandle: renderMode === 'Editable',
|
|
294
|
+
globalSearch: false,
|
|
295
|
+
personalization: false,
|
|
296
|
+
toggleFieldVisibility: false,
|
|
297
|
+
toolbar: false,
|
|
298
|
+
footer: false,
|
|
299
|
+
filterExpression: null,
|
|
300
|
+
editing: false,
|
|
301
|
+
timezone: PCore.getEnvironmentInfo().getTimeZone()
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* This method returns a callBack function for Add action.
|
|
307
|
+
* @param {object} pConnect - PConnect object
|
|
308
|
+
* @param {number} index - index of the page list to add
|
|
309
|
+
*/
|
|
310
|
+
export const getAddRowCallback = (pConnect, index) => {
|
|
311
|
+
return () => pConnect.getListActions().insert({}, index, ''); // 3rd arg null until typedef marked correctly as optional
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* This method creates a PConnect object with proper options for Add and Delete actions
|
|
316
|
+
* @param {string} contextName - contextName
|
|
317
|
+
* @param {string} referenceList - referenceList
|
|
318
|
+
* @param {string} pageReference - pageReference
|
|
319
|
+
*/
|
|
320
|
+
// NOTE: use of type "any" is required since TypeScript doesn't allow private/protected properties
|
|
321
|
+
// to be exported from a class (TS4094 error)
|
|
322
|
+
export function createPConnect(contextName, referenceList, pageReference): any {
|
|
323
|
+
const options = {
|
|
324
|
+
context: contextName,
|
|
325
|
+
pageReference,
|
|
326
|
+
referenceList
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// create PConnect object
|
|
330
|
+
const config: any = { meta: {}, options };
|
|
331
|
+
const { getPConnect } = PCore.createPConnect(config);
|
|
332
|
+
|
|
333
|
+
return getPConnect();
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export const filterData = filterByColumns => {
|
|
337
|
+
return function filteringData(item) {
|
|
338
|
+
let bKeep = true;
|
|
339
|
+
for (const filterObj of filterByColumns) {
|
|
340
|
+
if (filterObj.containsFilterValue !== '' || filterObj.containsFilter === 'null' || filterObj.containsFilter === 'notnull') {
|
|
341
|
+
let value: any;
|
|
342
|
+
let filterValue: any;
|
|
343
|
+
|
|
344
|
+
switch (filterObj.type) {
|
|
345
|
+
case 'Date':
|
|
346
|
+
case 'DateTime':
|
|
347
|
+
case 'Time':
|
|
348
|
+
value = item[filterObj.ref] !== null || item[filterObj.ref] !== '' ? Utils.getSeconds(item[filterObj.ref]) : null;
|
|
349
|
+
filterValue =
|
|
350
|
+
filterObj.containsFilterValue !== null && filterObj.containsFilterValue !== '' ? Utils.getSeconds(filterObj.containsFilterValue) : null;
|
|
351
|
+
|
|
352
|
+
switch (filterObj.containsFilter) {
|
|
353
|
+
case 'notequal':
|
|
354
|
+
// becasue filterValue is in minutes, need to have a range of less than 60 secons
|
|
355
|
+
|
|
356
|
+
if (value !== null && filterValue !== null) {
|
|
357
|
+
// get rid of milliseconds
|
|
358
|
+
value /= 1000;
|
|
359
|
+
filterValue /= 1000;
|
|
360
|
+
|
|
361
|
+
const diff = value - filterValue;
|
|
362
|
+
if (diff >= 0 && diff < 60) {
|
|
363
|
+
bKeep = false;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
break;
|
|
368
|
+
|
|
369
|
+
case 'equal':
|
|
370
|
+
// becasue filterValue is in minutes, need to have a range of less than 60 secons
|
|
371
|
+
|
|
372
|
+
if (value !== null && filterValue !== null) {
|
|
373
|
+
// get rid of milliseconds
|
|
374
|
+
value /= 1000;
|
|
375
|
+
filterValue /= 1000;
|
|
376
|
+
|
|
377
|
+
const diff = value - filterValue;
|
|
378
|
+
if (diff !== 0) {
|
|
379
|
+
bKeep = false;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
break;
|
|
384
|
+
|
|
385
|
+
case 'after':
|
|
386
|
+
if (value < filterValue) {
|
|
387
|
+
bKeep = false;
|
|
388
|
+
}
|
|
389
|
+
break;
|
|
390
|
+
|
|
391
|
+
case 'before':
|
|
392
|
+
if (value > filterValue) {
|
|
393
|
+
bKeep = false;
|
|
394
|
+
}
|
|
395
|
+
break;
|
|
396
|
+
|
|
397
|
+
case 'null':
|
|
398
|
+
if (value !== null) {
|
|
399
|
+
bKeep = false;
|
|
400
|
+
}
|
|
401
|
+
break;
|
|
402
|
+
|
|
403
|
+
case 'notnull':
|
|
404
|
+
if (value === null) {
|
|
405
|
+
bKeep = false;
|
|
406
|
+
}
|
|
407
|
+
break;
|
|
408
|
+
|
|
409
|
+
default:
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
break;
|
|
413
|
+
|
|
414
|
+
default:
|
|
415
|
+
value = item[filterObj.ref].toLowerCase();
|
|
416
|
+
filterValue = filterObj.containsFilterValue.toLowerCase();
|
|
417
|
+
|
|
418
|
+
switch (filterObj.containsFilter) {
|
|
419
|
+
case 'contains':
|
|
420
|
+
if (value.indexOf(filterValue) < 0) {
|
|
421
|
+
bKeep = false;
|
|
422
|
+
}
|
|
423
|
+
break;
|
|
424
|
+
|
|
425
|
+
case 'equals':
|
|
426
|
+
if (value !== filterValue) {
|
|
427
|
+
bKeep = false;
|
|
428
|
+
}
|
|
429
|
+
break;
|
|
430
|
+
|
|
431
|
+
case 'startswith':
|
|
432
|
+
if (value.indexOf(filterValue) !== 0) {
|
|
433
|
+
bKeep = false;
|
|
434
|
+
}
|
|
435
|
+
break;
|
|
436
|
+
|
|
437
|
+
default:
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// if don't keep stop filtering
|
|
446
|
+
if (!bKeep) {
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
return bKeep;
|
|
451
|
+
};
|
|
452
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { connect, Provider, shallowEqual } from 'react-redux';
|
|
3
|
+
|
|
4
|
+
import { PegaStoreContext as ReactReduxContext } from '@pega/sdk-react';
|
|
5
|
+
|
|
6
|
+
const connectToState = (mapStateToProps = () => {}) => {
|
|
7
|
+
return (Component: any) => {
|
|
8
|
+
const ConnectedComponent = connect(mapStateToProps, null, null, {
|
|
9
|
+
areStatePropsEqual: (next, prev: any) => {
|
|
10
|
+
// Compare visibility
|
|
11
|
+
const prevWasVisible = prev.visibility !== false;
|
|
12
|
+
if (next.visibility !== undefined && next.visibility !== prevWasVisible) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
// Compare start props
|
|
16
|
+
const c11nEnv = next.getPConnect();
|
|
17
|
+
const allStateProps = c11nEnv.getStateProps();
|
|
18
|
+
for (const key of Object.keys(allStateProps)) {
|
|
19
|
+
if (!shallowEqual(next[key], prev[key]) || (next.routingInfo && !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/* TODO For some rawConfig we are not getting routingInfo under allStateProps */
|
|
24
|
+
return !(
|
|
25
|
+
'routingInfo' in next &&
|
|
26
|
+
(!shallowEqual(next.routingInfo, prev.routingInfo) || !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
})(Component);
|
|
30
|
+
|
|
31
|
+
return (ownProps = {}) => {
|
|
32
|
+
const { store } = useContext<any>(ReactReduxContext);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Provider store={store}>
|
|
36
|
+
<ConnectedComponent {...ownProps} />
|
|
37
|
+
</Provider>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default connectToState;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// This file is adapted from React DX components/template/utils.js
|
|
2
|
+
|
|
3
|
+
export function getAllFields(pConnect: any) {
|
|
4
|
+
const metadata = pConnect.getRawMetadata();
|
|
5
|
+
let allFields: any[] = [];
|
|
6
|
+
if (metadata.children && metadata.children.map) {
|
|
7
|
+
allFields = metadata.children.map(fields => {
|
|
8
|
+
const children = fields.children instanceof Array ? fields.children : [];
|
|
9
|
+
return children.map(field => field.config);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return allFields;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function filterForFieldValueList(fields: any[]) {
|
|
16
|
+
return fields
|
|
17
|
+
.filter(({ visibility }) => visibility !== false)
|
|
18
|
+
.map(({ value, label }) => ({
|
|
19
|
+
id: label.toLowerCase(),
|
|
20
|
+
name: label,
|
|
21
|
+
value
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Determine if the current view is the view of the case step/assignment.
|
|
27
|
+
* @param {Function} pConnect PConnect object for the component
|
|
28
|
+
*/
|
|
29
|
+
export function getIsAssignmentView(pConnect) {
|
|
30
|
+
// Get caseInfo content from the store which contains the view info about the current assignment/step
|
|
31
|
+
// TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available
|
|
32
|
+
const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);
|
|
33
|
+
const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);
|
|
34
|
+
|
|
35
|
+
const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;
|
|
36
|
+
|
|
37
|
+
// Get the info about the current view from pConnect
|
|
38
|
+
const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;
|
|
39
|
+
|
|
40
|
+
return assignmentViewId === currentViewId;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A hook that gets the instructions content for a view.
|
|
45
|
+
* @param {Function} pConnect PConnect object for the component
|
|
46
|
+
* @param {string} [instructions="casestep"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)
|
|
47
|
+
*/
|
|
48
|
+
export function getInstructions(pConnect, instructions: string = 'casestep'): string | undefined {
|
|
49
|
+
const caseStepInstructions = PCore.getConstants().CASE_INFO.INSTRUCTIONS && pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);
|
|
50
|
+
|
|
51
|
+
// Determine if this view is the current assignment/step view
|
|
52
|
+
const isCurrentAssignmentView = getIsAssignmentView(pConnect);
|
|
53
|
+
|
|
54
|
+
// Case step instructions
|
|
55
|
+
if (instructions === 'casestep' && isCurrentAssignmentView && caseStepInstructions?.length) {
|
|
56
|
+
return caseStepInstructions;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// No instructions
|
|
60
|
+
if (instructions === 'none') {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// If the annotation wasn't processed correctly, don't return any instruction text
|
|
65
|
+
if (instructions?.startsWith('@PARAGRAPH')) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Custom instructions from the view
|
|
70
|
+
// The raw metadata for `instructions` will be something like '@PARAGRAPH .SomeParagraphRule' but
|
|
71
|
+
// it is evaluated by core logic to the content
|
|
72
|
+
if (instructions !== 'casestep' && instructions !== 'none') {
|
|
73
|
+
return instructions;
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|