@pega/sdk 0.0.1 → 0.0.3
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/dist/index.js +2 -19
- package/package.json +4 -1
- package/templates/react-sdk-reference/.claude/instructions/component-map.md +38 -0
- package/templates/react-sdk-reference/.claude/instructions/dse-component.md +75 -0
- package/templates/react-sdk-reference/.claude/instructions/field-component.md +71 -0
- package/templates/react-sdk-reference/.claude/instructions/template-component.md +92 -0
- package/templates/react-sdk-reference/.claude/instructions/widget-component.md +87 -0
- package/templates/react-sdk-reference/.claude/prompts/add-component.md +144 -0
- package/templates/react-sdk-reference/.claude/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-all-components.md +149 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-dse-components.md +126 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-field-components.md +139 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-template-components.md +151 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-widget-components.md +124 -0
- package/templates/react-sdk-reference/.claude/prompts/identify-components.md +105 -0
- package/templates/react-sdk-reference/.claude/prompts/replace-design-system.md +519 -0
- package/templates/react-sdk-reference/.claude/skills/component-contracts.md +140 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/AlertBanner.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Banner.md +149 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/CaseSummaryFields.md +154 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/DetailsFields.md +144 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroup.md +131 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroupList.md +111 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldValueList.md +115 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Operator.md +149 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Pulse.md +83 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/RichTextEditor.md +206 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/WssQuickCreate.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension.md +289 -0
- package/templates/react-sdk-reference/.claude/skills/field-components.md +294 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/AutoComplete.md +112 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/CancelAlert.md +203 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Checkbox.md +158 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Currency.md +106 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Date.md +99 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/DateTime.md +103 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Decimal.md +98 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Dropdown.md +114 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Email.md +107 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Group.md +90 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Integer.md +87 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Location.md +136 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Multiselect.md +164 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/ObjectReference.md +164 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Percentage.md +92 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Phone.md +110 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/RadioButtons.md +146 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/RichText.md +138 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/ScalarList.md +124 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/SelectableCard.md +216 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/SemanticLink.md +148 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextArea.md +96 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextContent.md +101 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextInput.md +104 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Time.md +88 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/URL.md +85 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/UserReference.md +180 -0
- package/templates/react-sdk-reference/.claude/skills/run-and-verify.md +68 -0
- package/templates/react-sdk-reference/.claude/skills/template-components.md +322 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/AdvancedSearch.md +144 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/AppShell.md +122 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/BannerPage.md +83 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseSummary.md +100 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseView.md +131 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseViewActionsMenu.md +126 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/Confirmation.md +107 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DataReference.md +120 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultForm.md +102 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultPage.md +110 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/Details.md +88 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsSubTabs.md +95 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsThreeColumn.md +78 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsTwoColumn.md +78 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DynamicTabs.md +101 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/FieldGroupTemplate.md +109 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/HierarchicalForm.md +113 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboard.md +104 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboardPage.md +85 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListPage.md +68 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListView.md +139 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/MultiReferenceReadOnly.md +80 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/NarrowWide.md +141 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/OneColumn.md +109 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/PromotedFilters.md +124 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SelfServiceCaseView.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SimpleTable.md +127 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SingleReferenceReadOnly.md +103 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SubTabs.md +79 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/TwoColumn.md +131 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/WideNarrow.md +150 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/WssNavBar.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/widget-components.md +271 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/AppAnnouncement.md +82 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/Attachment.md +146 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/CaseHistory.md +107 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/FileUtility.md +200 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/Followers.md +99 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/QuickCreate.md +114 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/SummaryItem.md +167 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/ToDo.md +190 -0
- package/templates/react-sdk-reference/.cursor/rules/component-map.mdrules +41 -0
- package/templates/react-sdk-reference/.cursor/rules/dse-component.mdrules +78 -0
- package/templates/react-sdk-reference/.cursor/rules/field-component.mdrules +74 -0
- package/templates/react-sdk-reference/.cursor/rules/pega-sdk.mdrules +247 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/add-component.mdrules +149 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-all-components.mdrules +154 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-dse-components.mdrules +131 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-field-components.mdrules +144 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-template-components.mdrules +156 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-widget-components.mdrules +129 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/identify-components.mdrules +110 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/replace-design-system.mdrules +524 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/component-contracts.mdrules +145 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/AlertBanner.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Banner.mdrules +154 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/CaseSummaryFields.mdrules +159 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/DetailsFields.mdrules +149 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroup.mdrules +136 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroupList.mdrules +116 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldValueList.mdrules +120 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Operator.mdrules +154 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Pulse.mdrules +88 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/RichTextEditor.mdrules +211 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/WssQuickCreate.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension.mdrules +294 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-components.mdrules +299 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/AutoComplete.mdrules +117 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/CancelAlert.mdrules +208 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Checkbox.mdrules +163 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Currency.mdrules +111 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Date.mdrules +104 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/DateTime.mdrules +108 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Decimal.mdrules +103 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Dropdown.mdrules +119 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Email.mdrules +112 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Group.mdrules +95 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Integer.mdrules +92 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Location.mdrules +141 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Multiselect.mdrules +169 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ObjectReference.mdrules +169 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Percentage.mdrules +97 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Phone.mdrules +115 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RadioButtons.mdrules +151 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RichText.mdrules +143 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ScalarList.mdrules +129 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SelectableCard.mdrules +221 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SemanticLink.mdrules +153 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextArea.mdrules +101 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextContent.mdrules +106 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextInput.mdrules +109 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Time.mdrules +93 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/URL.mdrules +90 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/UserReference.mdrules +185 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/run-and-verify.mdrules +73 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-components.mdrules +327 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AdvancedSearch.mdrules +149 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AppShell.mdrules +127 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/BannerPage.mdrules +88 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseSummary.mdrules +105 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseView.mdrules +136 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseViewActionsMenu.mdrules +131 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Confirmation.mdrules +112 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DataReference.mdrules +125 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultForm.mdrules +107 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultPage.mdrules +115 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Details.mdrules +93 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsSubTabs.mdrules +100 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsThreeColumn.mdrules +83 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsTwoColumn.mdrules +83 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DynamicTabs.mdrules +106 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/FieldGroupTemplate.mdrules +114 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/HierarchicalForm.mdrules +118 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboard.mdrules +109 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboardPage.mdrules +90 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListPage.mdrules +73 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListView.mdrules +144 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/MultiReferenceReadOnly.mdrules +85 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/NarrowWide.mdrules +146 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/OneColumn.mdrules +114 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/PromotedFilters.mdrules +129 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SelfServiceCaseView.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SimpleTable.mdrules +132 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SingleReferenceReadOnly.mdrules +108 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SubTabs.mdrules +84 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/TwoColumn.mdrules +136 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WideNarrow.mdrules +155 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WssNavBar.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-components.mdrules +276 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/AppAnnouncement.mdrules +87 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Attachment.mdrules +151 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/CaseHistory.mdrules +112 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/FileUtility.mdrules +205 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Followers.mdrules +104 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/QuickCreate.mdrules +119 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/SummaryItem.mdrules +172 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/ToDo.mdrules +195 -0
- package/templates/react-sdk-reference/.cursor/rules/template-component.mdrules +95 -0
- package/templates/react-sdk-reference/.cursor/rules/widget-component.mdrules +90 -0
- package/templates/react-sdk-reference/.github/copilot-instructions.md +58 -0
- package/templates/react-sdk-reference/.github/prompts/add-component.prompt.md +144 -16
- package/templates/react-sdk-reference/.github/prompts/generate-all-components.prompt.md +154 -0
- package/templates/react-sdk-reference/.github/prompts/generate-dse-components.prompt.md +131 -0
- package/templates/react-sdk-reference/.github/prompts/generate-field-components.prompt.md +144 -0
- package/templates/react-sdk-reference/.github/prompts/generate-template-components.prompt.md +156 -0
- package/templates/react-sdk-reference/.github/prompts/generate-widget-components.prompt.md +129 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension.md +58 -18
- package/templates/react-sdk-reference/.github/skills/field-components.md +55 -23
- package/templates/react-sdk-reference/.github/skills/template-components.md +48 -11
- package/templates/react-sdk-reference/.github/skills/widget-components.md +49 -12
- package/templates/react-sdk-reference/AGENTS.md +217 -29
- package/templates/react-sdk-reference/package.json +3 -2
- package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
- package/templates/react-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/sdk-config.json +1 -1
- package/templates/react-sdk-reference/vite.config.ts +1 -1
- package/templates/react-sdk-reference/.github/prompts/replace-all-fields.prompt.md +0 -48
- package/templates/react-sdk-reference/.github/prompts/replace-component.prompt.md +0 -81
- package/templates/react-sdk-reference/.github/prompts/replace-field.prompt.md +0 -41
- package/templates/react-sdk-reference/.github/prompts/swap-design-system.prompt.md +0 -49
- package/templates/react-sdk-reference/.github/skills/swap-design-system.md +0 -105
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Skill: CaseHistory
|
|
2
|
+
|
|
3
|
+
Case history widget. Fetches and displays the full audit trail for the current case in a table with Date, Description, and Performer columns.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Renders a table of case events sourced from the `D_pyWorkHistory` data page. Shows when each event happened (`pyUpdatedDateTime`), what happened (`pyMessageKey`), and who performed it (`pyPerformer`). Uses `fast-deep-equal` to skip unnecessary re-renders when data has not changed.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Registration key:** `CaseHistory` (in `component-map.ts`)
|
|
16
|
+
- **Category:** Widget — case data display
|
|
17
|
+
- **Extends:** `PConnProps`
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
|------|------|----------|-------------|
|
|
23
|
+
| `getPConnect` | `function` | Yes | PConnect getter — used to resolve case ID and context |
|
|
24
|
+
|
|
25
|
+
No additional custom props. All data is fetched internally.
|
|
26
|
+
|
|
27
|
+
## Behavioral Contract
|
|
28
|
+
|
|
29
|
+
### Data Fetch
|
|
30
|
+
|
|
31
|
+
On mount, fetch history from the `D_pyWorkHistory` data page:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
PCore.getDataApiUtils().getData(
|
|
35
|
+
'D_pyWorkHistory',
|
|
36
|
+
{ pyCaseInsKey: caseKey },
|
|
37
|
+
context
|
|
38
|
+
)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- `caseKey` = `pConn.getCaseInfo().getKey()` (the fully-qualified case key).
|
|
42
|
+
- `context` = `pConn.getContextName()`.
|
|
43
|
+
- Store result in `historyData` state array.
|
|
44
|
+
- On error or empty response, `historyData` stays as `[]`.
|
|
45
|
+
|
|
46
|
+
### Re-render Optimization
|
|
47
|
+
|
|
48
|
+
Use `fast-deep-equal/react` to compare new `historyData` with previous value — only call `setHistoryData` if the data has actually changed. This prevents unnecessary re-renders caused by reference inequality.
|
|
49
|
+
|
|
50
|
+
### Data Transformation
|
|
51
|
+
|
|
52
|
+
For each history row, map:
|
|
53
|
+
- **Date column:** Format `pyUpdatedDateTime` using the SDK date formatter (e.g., `formatDateTime(row.pyUpdatedDateTime)`) or display as-is.
|
|
54
|
+
- **Description column:** `row.pyMessageKey` — the localized event description string.
|
|
55
|
+
- **Performer column:** `row.pyPerformer` — the operator who performed the action.
|
|
56
|
+
- Missing values: display `"---"` for any undefined/null field.
|
|
57
|
+
|
|
58
|
+
## Visual Specifications
|
|
59
|
+
|
|
60
|
+
### Table Layout
|
|
61
|
+
|
|
62
|
+
| Column | Field | Width |
|
|
63
|
+
|--------|-------|-------|
|
|
64
|
+
| Date | `pyUpdatedDateTime` (formatted) | ~25% |
|
|
65
|
+
| Description | `pyMessageKey` | ~50% |
|
|
66
|
+
| Performer | `pyPerformer` | ~25% |
|
|
67
|
+
|
|
68
|
+
**CSS-only implementation notes:**
|
|
69
|
+
- Table container: `width: 100%; overflow-x: auto`.
|
|
70
|
+
- Table: `border-collapse: collapse; width: 100%`.
|
|
71
|
+
- Header cells: `background: var(--table-header-bg); font-weight: 600; padding: 8px 12px; border-bottom: 2px solid var(--divider-color)`.
|
|
72
|
+
- Body cells: `padding: 8px 12px; border-bottom: 1px solid var(--divider-color)`.
|
|
73
|
+
- Missing value placeholder `"---"`: `color: var(--secondary-text-color)`.
|
|
74
|
+
- No pagination in the reference implementation — all rows shown.
|
|
75
|
+
|
|
76
|
+
## Edge Cases & Special Logic
|
|
77
|
+
|
|
78
|
+
- `D_pyWorkHistory` may return an empty array for cases with no history events — render an empty table body (or an empty-state message like `"No history available"`).
|
|
79
|
+
- `pyUpdatedDateTime` format varies — always run it through the SDK date formatter before display.
|
|
80
|
+
- `pyMessageKey` may be a locale key — resolve it via `PCore.getLocaleUtils().getLocaleValue()` if a localized string is required.
|
|
81
|
+
- The widget has no pagination — for cases with very long history, the table may become very tall. Consider adding pagination if needed.
|
|
82
|
+
|
|
83
|
+
## Dependencies
|
|
84
|
+
|
|
85
|
+
- `PCore.getDataApiUtils().getData()` — fetches `D_pyWorkHistory` data page
|
|
86
|
+
- `fast-deep-equal/react` — prevents unnecessary re-renders
|
|
87
|
+
- `PCore.getConstants().CASE_INFO.CASE_INFO_ID` — resolves case ID constant
|
|
88
|
+
- MUI: `<Table>`, `<TableBody>`, `<TableCell>`, `<TableContainer>`, `<TableHead>`, `<TableRow>`
|
|
89
|
+
|
|
90
|
+
## Design System Mapping
|
|
91
|
+
|
|
92
|
+
**UI control type:** Read-only case audit table with 3 columns.
|
|
93
|
+
|
|
94
|
+
Listed design systems are examples only.
|
|
95
|
+
|
|
96
|
+
| Design System | Table |
|
|
97
|
+
|---|---|
|
|
98
|
+
| Default (CSS only) | `<table>/<thead>/<tbody>/<tr>/<td>` |
|
|
99
|
+
| MUI | `<TableContainer>` + `<Table>` + `<TableHead>/<TableBody>/<TableRow>/<TableCell>` |
|
|
100
|
+
| Ant Design | `<Table dataSource={historyData} columns={...}>` |
|
|
101
|
+
| Chakra UI | `<Table>` + `<Thead>/<Tbody>/<Tr>/<Th>/<Td>` |
|
|
102
|
+
| Shadcn/ui | `<Table>` + `<TableHeader>/<TableBody>/<TableRow>/<TableHead>/<TableCell>` |
|
|
103
|
+
|
|
104
|
+
When implementing in a specific design system:
|
|
105
|
+
- `fast-deep-equal` comparison is a performance optimization — include it to avoid redundant renders on re-subscription
|
|
106
|
+
- Data page name `D_pyWorkHistory` is fixed — do not make it configurable
|
|
107
|
+
- Missing field fallback `"---"` should be consistent across all three columns
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Skill: FileUtility
|
|
2
|
+
|
|
3
|
+
File and URL management utility widget. Displays case attachments and links, supports upload/download/delete, and provides modals for adding new files or URLs. Also covers `ActionButtonsForFileUtil` sub-component.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
The primary attachments management panel in the case utilities column. Shows up to 3 attachments/links in the main view with a "View all" option that opens a modal with the full list. Users can upload files, attach URLs, download, and delete items. Attachment state is kept fresh via debounced pub-sub subscriptions.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Registration key:** `FileUtility` (in `component-map.ts`)
|
|
16
|
+
- **Category:** Widget — file management
|
|
17
|
+
- **Extends:** `PConnProps`
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
|------|------|----------|-------------|
|
|
23
|
+
| `caseId` | `string` | No | Optional case ID override. If absent, resolved from `pConn.getCaseInfo().getID()` |
|
|
24
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
25
|
+
|
|
26
|
+
## Behavioral Contract
|
|
27
|
+
|
|
28
|
+
### Attachment Fetch
|
|
29
|
+
|
|
30
|
+
On mount and on attachment change events:
|
|
31
|
+
```
|
|
32
|
+
PCore.getAttachmentUtils().getCaseAttachments(caseKey, context)
|
|
33
|
+
```
|
|
34
|
+
Returns array of attachment/link objects. Store in `attachments` state.
|
|
35
|
+
|
|
36
|
+
Debounced auto-refresh: on `CASE_ATTACHMENTS_UPDATED` pub-sub event, wait 1000ms (debounced) then re-fetch. This prevents rapid re-fetches when multiple files are uploaded simultaneously.
|
|
37
|
+
|
|
38
|
+
### Main View — Top 3 Display
|
|
39
|
+
|
|
40
|
+
Show only the first 3 items from `attachments`. If `attachments.length > 3`, show a `"View all (N)"` button that opens the full-list modal.
|
|
41
|
+
|
|
42
|
+
### SummaryList Integration
|
|
43
|
+
|
|
44
|
+
Map each attachment/link to a `SummaryItem`-compatible object:
|
|
45
|
+
```typescript
|
|
46
|
+
{
|
|
47
|
+
id: attachment.ID,
|
|
48
|
+
visual: { icon: getFileIcon(attachment.mimeType) },
|
|
49
|
+
primary: {
|
|
50
|
+
type: attachment.category === 'FILE' ? 'FILE' : 'URL',
|
|
51
|
+
name: attachment.name,
|
|
52
|
+
click: () => handleDownloadOrOpen(attachment)
|
|
53
|
+
},
|
|
54
|
+
secondary: { text: attachment.createdBy + ' · ' + formatDate(attachment.createTime) }
|
|
55
|
+
actions: [
|
|
56
|
+
{ id: 'delete', text: 'Delete', icon: 'trash', onClick: () => handleDelete(attachment.ID) }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Pass to `<SummaryList arItems$={summaryItems} />`.
|
|
62
|
+
|
|
63
|
+
### File Upload
|
|
64
|
+
|
|
65
|
+
1. User clicks "Add file" from the `<Menu>`.
|
|
66
|
+
2. Opens an add-file modal (dialog).
|
|
67
|
+
3. User selects a file via `<input type='file'>`.
|
|
68
|
+
4. On confirm: call `PCore.getAttachmentUtils().uploadAttachment(file, onProgress, onError, context)`.
|
|
69
|
+
5. On success: call `PCore.getAttachmentUtils().linkAttachmentsToCase(caseKey, [newAttachment], context)`.
|
|
70
|
+
6. Refresh attachment list.
|
|
71
|
+
|
|
72
|
+
### URL Attachment
|
|
73
|
+
|
|
74
|
+
1. User clicks "Add link" from the `<Menu>`.
|
|
75
|
+
2. Opens add-link modal with two fields: `Title` (required) and `URL` (required).
|
|
76
|
+
3. The "Attach" button is enabled only when both `title` and `url` are non-empty.
|
|
77
|
+
4. On confirm: call `PCore.getAttachmentUtils().linkAttachmentsToCase(caseKey, [{ name: title, url, category: 'URL' }], context)`.
|
|
78
|
+
5. Refresh attachment list.
|
|
79
|
+
|
|
80
|
+
### Download / Open
|
|
81
|
+
|
|
82
|
+
- **FILE type:** Call `PCore.getAttachmentUtils().downloadAttachment(attachmentID, context)` then trigger browser download via `downloadjs`.
|
|
83
|
+
- **URL type:** Open `attachment.url` in a new browser tab (`window.open(url, '_blank')`).
|
|
84
|
+
|
|
85
|
+
### Delete
|
|
86
|
+
|
|
87
|
+
Call `PCore.getAttachmentUtils().deleteAttachment(attachmentID, context)`. Refresh attachment list after success.
|
|
88
|
+
|
|
89
|
+
### Actions Menu
|
|
90
|
+
|
|
91
|
+
Render a `<MoreVertIcon>` `<IconButton>` that opens a `<Menu>` with:
|
|
92
|
+
- `"Add file"` — opens add-file modal
|
|
93
|
+
- `"Add link"` — opens add-link modal
|
|
94
|
+
|
|
95
|
+
## Visual Specifications
|
|
96
|
+
|
|
97
|
+
### Main Card
|
|
98
|
+
|
|
99
|
+
| Element | Description |
|
|
100
|
+
|---------|-------------|
|
|
101
|
+
| Card header | `"Attachments"` (or localized) + count badge |
|
|
102
|
+
| Actions icon | `<MoreVertIcon>` button top-right |
|
|
103
|
+
| Attachment rows | Up to 3 `SummaryItem` cards |
|
|
104
|
+
| "View all" button | Text button, shown when > 3 attachments |
|
|
105
|
+
|
|
106
|
+
### "View all" Modal
|
|
107
|
+
|
|
108
|
+
| Element | Description |
|
|
109
|
+
|---------|-------------|
|
|
110
|
+
| Modal header | `"All attachments (N)"` |
|
|
111
|
+
| Attachment rows | All items in `SummaryList` |
|
|
112
|
+
| Close button | `X` in modal header |
|
|
113
|
+
|
|
114
|
+
### Add File Modal
|
|
115
|
+
|
|
116
|
+
| Element | Description |
|
|
117
|
+
|---------|-------------|
|
|
118
|
+
| File picker | `<input type='file'>` |
|
|
119
|
+
| Progress bar | Per-file upload progress |
|
|
120
|
+
| Action buttons | `ActionButtonsForFileUtil` (Cancel + Attach) |
|
|
121
|
+
|
|
122
|
+
### Add Link Modal
|
|
123
|
+
|
|
124
|
+
| Element | Description |
|
|
125
|
+
|---------|-------------|
|
|
126
|
+
| Title field | `<TextField label='Title'>` — required |
|
|
127
|
+
| URL field | `<TextField label='URL'>` — required |
|
|
128
|
+
| Attach button | Enabled only when both fields are filled |
|
|
129
|
+
| Action buttons | `ActionButtonsForFileUtil` (Cancel + Attach) |
|
|
130
|
+
|
|
131
|
+
**CSS-only implementation notes:**
|
|
132
|
+
- Main card: standard card styles.
|
|
133
|
+
- Modal: `position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.2); min-width: 480px; padding: 1.5rem`.
|
|
134
|
+
- "View all" button: text style, `color: var(--app-primary-color); cursor: pointer`.
|
|
135
|
+
- Progress bar: `height: 4px; background: var(--app-primary-color); transition: width 0.3s`.
|
|
136
|
+
|
|
137
|
+
## Sub-Component: ActionButtonsForFileUtil
|
|
138
|
+
|
|
139
|
+
**Registration key:** `ActionButtonsForFileUtil`
|
|
140
|
+
|
|
141
|
+
A simple button row component used inside the FileUtility modals to render Cancel + primary action buttons.
|
|
142
|
+
|
|
143
|
+
### Props
|
|
144
|
+
|
|
145
|
+
| Prop | Type | Required | Description |
|
|
146
|
+
|------|------|----------|-------------|
|
|
147
|
+
| `arMainButtons` | `any[]` | Yes | Primary button definitions `[{ actionID, name }]` |
|
|
148
|
+
| `arSecondaryButtons` | `any[]` | Yes | Secondary (cancel) button definitions `[{ actionID, name }]` |
|
|
149
|
+
| `primaryAction` | `function` | Yes | Callback invoked when the primary button is clicked |
|
|
150
|
+
| `secondaryAction` | `function` | Yes | Callback invoked when the secondary/cancel button is clicked |
|
|
151
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
152
|
+
|
|
153
|
+
### Layout
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
[Secondary buttons (left)] [Primary buttons (right)]
|
|
157
|
+
Cancel Attach
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
- Secondary buttons: outlined/text style.
|
|
161
|
+
- Primary buttons: contained/filled style with theme primary color.
|
|
162
|
+
- Render using `arSecondaryButtons.map(...)` and `arMainButtons.map(...)`.
|
|
163
|
+
|
|
164
|
+
## Edge Cases & Special Logic
|
|
165
|
+
|
|
166
|
+
- **Debounce (1000ms):** Prevents excessive re-fetches when multiple attachment events fire in quick succession.
|
|
167
|
+
- **Add link "Attach" button disabled state:** Title and URL validation must happen on every keystroke — use controlled inputs with `!title || !url` to derive disabled state.
|
|
168
|
+
- **`linkAttachmentsToCase`:** After upload, the file must be explicitly linked to the case. Uploading alone does not associate the file with the case.
|
|
169
|
+
- **Pub-sub cleanup:** Unsubscribe from `CASE_ATTACHMENTS_UPDATED` on unmount to prevent stale callbacks.
|
|
170
|
+
- **Error display:** Use `PCore.getMessageManager()` or inline error state in the modal — do not silently fail on upload/link errors.
|
|
171
|
+
|
|
172
|
+
## Dependencies
|
|
173
|
+
|
|
174
|
+
- `PCore.getAttachmentUtils()` — getCaseAttachments, uploadAttachment, downloadAttachment, deleteAttachment, linkAttachmentsToCase
|
|
175
|
+
- `PCore.getMessagingServiceManager()` — subscribe to attachment change events
|
|
176
|
+
- `PCore.getConstants()` — case info ID, summary refresh timing
|
|
177
|
+
- `getComponentFromRegistry('SummaryList')` — renders the attachment item list
|
|
178
|
+
- `getComponentFromRegistry('ActionButtonsForFileUtil')` — renders modal action buttons
|
|
179
|
+
- `downloadjs` — browser file download trigger
|
|
180
|
+
- MUI: `<Card>`, `<CardHeader>`, `<CardContent>`, `<IconButton>`, `<Menu>`, `<MenuItem>`, `<Button>`, `<TextField>`, `<Dialog>`, `<CircularProgress>`
|
|
181
|
+
- MUI Icons: `<MoreVertIcon>`
|
|
182
|
+
|
|
183
|
+
## Design System Mapping
|
|
184
|
+
|
|
185
|
+
**UI control type:** File management widget — attachment list with upload/download/delete and add modals.
|
|
186
|
+
|
|
187
|
+
Listed design systems are examples only.
|
|
188
|
+
|
|
189
|
+
| Design System | Card | Action Menu | Modal | Progress |
|
|
190
|
+
|---|---|---|---|---|
|
|
191
|
+
| Default (CSS only) | `<div>` card | `<button>` + custom dropdown | `<dialog>` | CSS progress bar |
|
|
192
|
+
| MUI | `<Card>` | `<IconButton>` + `<Menu>/<MenuItem>` | `<Dialog>` | `<CircularProgress>` or `<LinearProgress>` |
|
|
193
|
+
| Ant Design | `<Card>` | `<Dropdown menu={{ items }}>` | `<Modal>` | `<Progress>` |
|
|
194
|
+
| Chakra UI | `<Card>` | `<Menu>/<MenuButton>/<MenuList>` | `<Modal>` | `<Progress>` |
|
|
195
|
+
| Shadcn/ui | `<Card>` | `<DropdownMenu>` | `<Dialog>` | Custom progress bar |
|
|
196
|
+
|
|
197
|
+
When implementing in a specific design system:
|
|
198
|
+
- Debounced refresh (1000ms) after pub-sub attachment events is required — prevents excessive API calls
|
|
199
|
+
- `linkAttachmentsToCase` must be called after upload — uploading alone does not attach to the case
|
|
200
|
+
- `ActionButtonsForFileUtil` receives button definition arrays — render them generically from `arMainButtons`/`arSecondaryButtons`
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Skill: Followers
|
|
2
|
+
|
|
3
|
+
Followers widget. Displays the list of users following the current case. Currently a stub/placeholder in the reference implementation — renders an "unsupported" message.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Intended to display the list of operators following a case, allowing users to follow/unfollow a case and see who else is following it. The reference implementation is a **stub** — it renders a `"Followers - unsupported"` message inside a card. A full implementation would fetch follower data from the Pega data layer and provide follow/unfollow actions.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Registration key:** `Followers` (in `component-map.ts`)
|
|
16
|
+
- **Category:** Widget — social / collaboration
|
|
17
|
+
- **Extends:** `PConnProps`
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
|------|------|----------|-------------|
|
|
23
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
24
|
+
|
|
25
|
+
No additional custom props in the current stub implementation. A full implementation would likely include:
|
|
26
|
+
- `datasource` — data page name for follower list
|
|
27
|
+
- `headerText` — widget title (e.g., `"Followers"`)
|
|
28
|
+
|
|
29
|
+
## Behavioral Contract
|
|
30
|
+
|
|
31
|
+
### Current (Stub) Implementation
|
|
32
|
+
|
|
33
|
+
1. Render a `<Card>` with title `"Followers"`.
|
|
34
|
+
2. Show `"Followers - unsupported"` body text.
|
|
35
|
+
3. No data fetching, no actions.
|
|
36
|
+
|
|
37
|
+
### Expected Full Implementation
|
|
38
|
+
|
|
39
|
+
1. **Fetch followers:** Call `PCore.getDataPageUtils().getDataAsync('D_pyCaseFollowers', context, { caseKey })` on mount.
|
|
40
|
+
2. **Display follower list:** Render each follower's avatar (initials) and display name.
|
|
41
|
+
3. **Follow/unfollow toggle:** Button to follow or unfollow the current case:
|
|
42
|
+
- Follow: `PCore.getRestClient().invokeCustomRestApi('/api/v1/cases/{caseID}/followers', { method: 'POST', ... })`.
|
|
43
|
+
- Unfollow: same endpoint with `DELETE` method.
|
|
44
|
+
4. **Real-time update:** Subscribe to follower change events via pub-sub if available.
|
|
45
|
+
|
|
46
|
+
## Visual Specifications
|
|
47
|
+
|
|
48
|
+
### Stub Rendering
|
|
49
|
+
|
|
50
|
+
| Element | Value |
|
|
51
|
+
|---------|-------|
|
|
52
|
+
| Card title | `"Followers"` |
|
|
53
|
+
| Card body | `"Followers - unsupported"` plain text |
|
|
54
|
+
|
|
55
|
+
### Expected Full Rendering
|
|
56
|
+
|
|
57
|
+
| Element | Description |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| Card header | `"Followers"` + count badge |
|
|
60
|
+
| Follower avatars | Row of avatar initials circles |
|
|
61
|
+
| Follow button | Toggle button `"Follow"` / `"Unfollow"` |
|
|
62
|
+
|
|
63
|
+
**CSS-only implementation notes (stub):**
|
|
64
|
+
- Card: standard card layout — `border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.12); padding: 1rem`.
|
|
65
|
+
- Unsupported message: `color: var(--secondary-text-color); font-size: 0.875rem`.
|
|
66
|
+
|
|
67
|
+
**CSS-only implementation notes (full):**
|
|
68
|
+
- Avatar row: `display: flex; flex-wrap: wrap; gap: 4px`.
|
|
69
|
+
- Avatar circle: `width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600`.
|
|
70
|
+
|
|
71
|
+
## Edge Cases & Special Logic
|
|
72
|
+
|
|
73
|
+
- If the stub message `"Followers - unsupported"` is shown in production, it means this widget has not been fully implemented yet — that is expected behavior.
|
|
74
|
+
- When implementing: guard against empty follower arrays — show a `"No followers yet"` state.
|
|
75
|
+
- Follow/unfollow toggle must reflect the current user's follow status — fetch this as part of the initial data load.
|
|
76
|
+
|
|
77
|
+
## Dependencies
|
|
78
|
+
|
|
79
|
+
- MUI: `<Card>`, `<CardContent>`, `<CardHeader>`, `<Typography>` (current stub)
|
|
80
|
+
- Future full implementation would add: `<Avatar>`, `<Button>`, `<Badge>`, pub-sub subscriptions
|
|
81
|
+
|
|
82
|
+
## Design System Mapping
|
|
83
|
+
|
|
84
|
+
**UI control type:** Social widget — follower list with follow/unfollow action.
|
|
85
|
+
|
|
86
|
+
Listed design systems are examples only.
|
|
87
|
+
|
|
88
|
+
| Design System | Card | Avatar | Toggle Button |
|
|
89
|
+
|---|---|---|---|
|
|
90
|
+
| Default (CSS only) | `<div>` with border | CSS circle with initials | `<button>` |
|
|
91
|
+
| MUI | `<Card>` + `<Avatar>` | `<Avatar>` | `<Button>` variant toggle |
|
|
92
|
+
| Ant Design | `<Card>` | `<Avatar>` | `<Button>` |
|
|
93
|
+
| Chakra UI | `<Card>` | `<Avatar>` | `<Button>` |
|
|
94
|
+
| Shadcn/ui | `<Card>` | Custom avatar | `<Button>` |
|
|
95
|
+
|
|
96
|
+
When implementing in a specific design system:
|
|
97
|
+
- The current stub only needs a card with a message — implement the full behavior once the Pega backend supports it
|
|
98
|
+
- Follow/unfollow must be scoped to the current case (`caseKey` from `pConn.getCaseInfo().getKey()`)
|
|
99
|
+
- Follower count badge in the card header improves scannability
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Skill: QuickCreate
|
|
2
|
+
|
|
3
|
+
Quick case creation widget. Renders a set of buttons — one per available case type — allowing users to create cases directly from the widget without navigating to a separate form.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Provides a shortcut panel for creating new cases. Case types are sourced from the Pega environment info (or a fallback portal config for Launchpad). The list can be filtered by class name. Each button triggers case creation via `pConn.getActionsApi().createWork()`. Rendering is delegated to the `WssQuickCreate` design system extension component.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Registration key:** `QuickCreate` (in `component-map.ts`)
|
|
16
|
+
- **Category:** Widget — action / case creation
|
|
17
|
+
- **Extends:** `PConnProps`
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
|------|------|----------|-------------|
|
|
23
|
+
| `heading` | `string` | Yes | Widget title (e.g., `"Create"`) |
|
|
24
|
+
| `showCaseIcons` | `boolean` | No | Whether to show case type icons alongside labels. Default `false` |
|
|
25
|
+
| `classFilter` | `any[]` | No | Array of class names to filter available case types. Empty array = show all |
|
|
26
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
27
|
+
|
|
28
|
+
## Behavioral Contract
|
|
29
|
+
|
|
30
|
+
### Case Types Resolution
|
|
31
|
+
|
|
32
|
+
1. Read `PCore.getEnvironmentInfo().environmentInfoObject.pyCaseTypeList` — the primary source.
|
|
33
|
+
2. If the list is empty or unavailable (e.g., Launchpad mode), fall back to the app portal config:
|
|
34
|
+
```
|
|
35
|
+
PCore.getConfig().getApplicationName() // or portal config equivalent
|
|
36
|
+
```
|
|
37
|
+
3. Apply `classFilter`: if `classFilter` is non-empty, retain only case types whose class name is included in the array.
|
|
38
|
+
|
|
39
|
+
### Case Type Object Mapping
|
|
40
|
+
|
|
41
|
+
For each case type, build:
|
|
42
|
+
```typescript
|
|
43
|
+
{
|
|
44
|
+
classname: caseType.pyClassName,
|
|
45
|
+
label: caseType.pyLabel,
|
|
46
|
+
onClick: () => pConn.getActionsApi().createWork(caseType.pyClassName, {
|
|
47
|
+
openCaseViewAfterCreate: true,
|
|
48
|
+
containerName: PCore.getConstants().APP.APP
|
|
49
|
+
}),
|
|
50
|
+
icon: showCaseIcons ? getIconURL(caseType.pyClassName) : undefined
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Rendering Delegation
|
|
55
|
+
|
|
56
|
+
Pass the mapped case type array to `WssQuickCreate` (retrieved via `getComponentFromRegistry('WssQuickCreate')`):
|
|
57
|
+
```tsx
|
|
58
|
+
const WssQuickCreate = getComponentFromRegistry('WssQuickCreate');
|
|
59
|
+
return <WssQuickCreate heading={heading} caseTypes={caseTypeObjects} />;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This component handles all button rendering — `QuickCreate` is purely a data-preparation orchestrator.
|
|
63
|
+
|
|
64
|
+
## Visual Specifications
|
|
65
|
+
|
|
66
|
+
Visual rendering is owned by `WssQuickCreate` (a design system extension component). Typical layout:
|
|
67
|
+
|
|
68
|
+
| Element | Description |
|
|
69
|
+
|---------|-------------|
|
|
70
|
+
| Heading | Widget title at the top |
|
|
71
|
+
| Case type buttons | One button per case type; icon (optional) + label |
|
|
72
|
+
|
|
73
|
+
**CSS-only implementation notes (if implementing without `WssQuickCreate`):**
|
|
74
|
+
- Container: `display: flex; flex-direction: column; gap: 0.5rem`.
|
|
75
|
+
- Heading: `font-weight: 600; margin-bottom: 0.5rem`.
|
|
76
|
+
- Case type button: `display: flex; align-items: center; gap: 0.5rem; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 4px; cursor: pointer; background: white`.
|
|
77
|
+
- Icon: `width: 20px; height: 20px; object-fit: contain`.
|
|
78
|
+
|
|
79
|
+
## Edge Cases & Special Logic
|
|
80
|
+
|
|
81
|
+
- `classFilter` is an empty array by default — empty array means **no filtering** (show all case types).
|
|
82
|
+
- If `pyCaseTypeList` is empty and the fallback also produces no results, render the widget with a `"No case types available"` message or hide the widget.
|
|
83
|
+
- `showCaseIcons` requires a valid icon URL — `getIconURL(classname)` returns `undefined` if no icon is configured; guard against rendering a broken `<img>`.
|
|
84
|
+
- `createWork` opens the case creation form in the primary container. If the user already has an unsaved case open, behavior depends on container configuration (may replace or open in a new tab).
|
|
85
|
+
|
|
86
|
+
## Dependencies
|
|
87
|
+
|
|
88
|
+
- `getComponentFromRegistry('WssQuickCreate')` — design system extension for case type button rendering
|
|
89
|
+
- `pConn.getActionsApi().createWork()` — triggers case creation
|
|
90
|
+
- `PCore.getEnvironmentInfo()` — primary source for available case types
|
|
91
|
+
- `PCore.getConstants().APP.APP` — app context constant
|
|
92
|
+
|
|
93
|
+
## Design System Mapping
|
|
94
|
+
|
|
95
|
+
**UI control type:** Quick-action panel with one button per available case type.
|
|
96
|
+
|
|
97
|
+
Listed design systems are examples only.
|
|
98
|
+
|
|
99
|
+
Rendering is delegated to `WssQuickCreate` — implement that DSE component for your design system. `QuickCreate` itself has no direct UI output beyond the delegation.
|
|
100
|
+
|
|
101
|
+
If implementing without `WssQuickCreate`:
|
|
102
|
+
|
|
103
|
+
| Design System | Button List |
|
|
104
|
+
|---|---|
|
|
105
|
+
| Default (CSS only) | `<button>` list with optional `<img>` icon |
|
|
106
|
+
| MUI | `<List>` + `<ListItemButton>` or `<Button>` stack |
|
|
107
|
+
| Ant Design | `<Space direction='vertical'>` + `<Button>` per case type |
|
|
108
|
+
| Chakra UI | `<VStack>` + `<Button>` per case type |
|
|
109
|
+
| Shadcn/ui | `<div>` stack + `<Button variant='outline'>` |
|
|
110
|
+
|
|
111
|
+
When implementing in a specific design system:
|
|
112
|
+
- `classFilter` empty array = show ALL case types (not zero) — this is a common gotcha
|
|
113
|
+
- `createWork` must be called with the correct `containerName` constant (`APP.APP`)
|
|
114
|
+
- `showCaseIcons` is optional — only fetch/render icons when this prop is `true`
|