@pega/custom-dx-components 0.242.16 → 0.242.17
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/package.json +1 -1
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Boolean/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +3 -5
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal/event-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +1 -4
- package/src/tasks/create/templates/Constellation/Field/Decimal/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/event-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/event-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +1 -4
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.ts.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +4 -5
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Integer/event-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +2 -9
- package/src/tasks/create/templates/Constellation/Field/Integer/mock.ts.mustache +3 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +4 -6
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +4 -6
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache +26 -23
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +10 -52
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +4 -6
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +1 -6
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/mock.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Text/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +1 -3
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/event-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +2 -6
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +1 -3
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache +13 -8
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/mock.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +3 -5
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +8 -7
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +1 -3
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +15 -14
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +2 -5
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +1 -3
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +67 -7
- package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +4 -5
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/mock.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache +6 -19
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +4 -6
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +1 -4
- package/src/tasks/create/templates/Constellation/Widget/CASE/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +3 -4
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +2 -6
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +2 -5
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +4 -5
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +0 -2
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.tsx.mustache +4 -6
- package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +1 -4
- package/src/tasks/create/templates/Launchpad/Widget/CASE/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +3 -5
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +2 -6
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.tsx.mustache +1 -3
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/demo.stories.tsx.mustache +2 -3
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/mock.ts.mustache +0 -1
- package/src/tasks/init/template/package.json.mustache +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
3
|
/* eslint-disable react/no-unstable-nested-components */
|
|
4
|
-
// @ts-nocheck
|
|
5
4
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
5
|
|
|
7
6
|
import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
|
|
@@ -18,14 +17,14 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
|
|
|
18
17
|
export default meta;
|
|
19
18
|
type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
|
|
20
19
|
|
|
21
|
-
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
20
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
|
|
22
21
|
if (!window.PCore) {
|
|
23
22
|
window.PCore = {};
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
window.PCore.getLocaleUtils = () => {
|
|
27
26
|
return {
|
|
28
|
-
getLocaleValue: val => {
|
|
27
|
+
getLocaleValue: (val: any) => {
|
|
29
28
|
return val;
|
|
30
29
|
}
|
|
31
30
|
};
|
|
@@ -59,13 +58,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
59
58
|
getComponentName: () => {
|
|
60
59
|
return '';
|
|
61
60
|
},
|
|
62
|
-
getLocalizedValue: value => {
|
|
61
|
+
getLocalizedValue: (value: any) => {
|
|
63
62
|
return value;
|
|
64
63
|
},
|
|
65
64
|
getRawMetadata: () => {
|
|
66
65
|
return pyHome1Raw;
|
|
67
66
|
},
|
|
68
|
-
createComponent: config => {
|
|
67
|
+
createComponent: (config: any) => {
|
|
69
68
|
if (config.type === 'AppAnnouncement') {
|
|
70
69
|
return (
|
|
71
70
|
<PegaAppAnnouncement
|
|
@@ -54,7 +54,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
54
54
|
|
|
55
55
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
56
56
|
<OneColumn
|
|
57
|
-
// @ts-ignore
|
|
58
57
|
a={useConfigurableLayout ? <ConfigurableLayout items={layoutItemsA} /> : childArray[0]}
|
|
59
58
|
title={title}
|
|
60
59
|
icon={tempIcon?.replace('pi pi-', '')}
|
|
@@ -2,7 +2,7 @@ import { createUID } from '@pega/cosmos-react-core';
|
|
|
2
2
|
|
|
3
3
|
// import { LazyMap as LazyComponentMap } from '../../components_map';
|
|
4
4
|
|
|
5
|
-
const LazyComponentMap = {};
|
|
5
|
+
const LazyComponentMap: any = {};
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Given the PConnect object of a Template component, retrieve the children
|
|
@@ -53,47 +53,40 @@ export function getAllFields(pConnect: Function) {
|
|
|
53
53
|
export function prepareComponentInCaseSummary(configObject: any, getPConnect: Function, displayMode: string) {
|
|
54
54
|
const { config, children } = configObject;
|
|
55
55
|
let { type } = configObject;
|
|
56
|
-
const caseSummaryComponentObject = {};
|
|
56
|
+
const caseSummaryComponentObject: any = {};
|
|
57
57
|
let showAddressLabel = true;
|
|
58
58
|
if (config && config.value === '@P .pyStatusWork') {
|
|
59
59
|
config.displayAsStatus = true;
|
|
60
60
|
type = 'TextInput'; // force the type to be TextInput for status field.
|
|
61
61
|
// As TextInput is loaded forcefully sometimes, TextInput component might not be available in lazy map.
|
|
62
62
|
// Load TextInput if it is not available.
|
|
63
|
-
// @ts-ignore
|
|
64
63
|
if (!LazyComponentMap[type]) {
|
|
65
64
|
PCore.getAssetLoader().getLoader('component-loader')([type]);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
// @ts-ignore
|
|
70
68
|
caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
|
|
71
69
|
label: config.label
|
|
72
70
|
}).label;
|
|
73
71
|
if (type === 'CaseOperator') {
|
|
74
|
-
// @ts-ignore
|
|
75
72
|
switch (caseSummaryComponentObject.name) {
|
|
76
73
|
case 'Create operator':
|
|
77
|
-
// @ts-ignore
|
|
78
74
|
caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
|
|
79
75
|
createLabel: config.createLabel
|
|
80
76
|
}).createLabel;
|
|
81
77
|
break;
|
|
82
78
|
case 'Update operator':
|
|
83
|
-
// @ts-ignore
|
|
84
79
|
caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
|
|
85
80
|
updateLabel: config.updateLabel
|
|
86
81
|
}).updateLabel;
|
|
87
82
|
break;
|
|
88
83
|
default:
|
|
89
|
-
// @ts-ignore
|
|
90
84
|
caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
|
|
91
85
|
resolveLabel: config.resolveLabel
|
|
92
86
|
}).resolveLabel;
|
|
93
87
|
break;
|
|
94
88
|
}
|
|
95
89
|
} else if (type === 'Checkbox') {
|
|
96
|
-
// @ts-ignore
|
|
97
90
|
caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
|
|
98
91
|
label: config.caption
|
|
99
92
|
}).label;
|
|
@@ -115,10 +108,8 @@ export function prepareComponentInCaseSummary(configObject: any, getPConnect: Fu
|
|
|
115
108
|
createdComponent.props.getPConnect().setInheritedProp('showAddressLabel', showAddressLabel);
|
|
116
109
|
}
|
|
117
110
|
// createdComponent.props.getPConnect().setInheritedProp("hideLabel", true);
|
|
118
|
-
// @ts-ignore
|
|
119
111
|
caseSummaryComponentObject.value = createdComponent;
|
|
120
112
|
if (type === 'reference') {
|
|
121
|
-
// @ts-ignore
|
|
122
113
|
caseSummaryComponentObject.name = createdComponent.props.getPConnect().getInheritedProps().label;
|
|
123
114
|
}
|
|
124
115
|
|
|
@@ -188,16 +179,13 @@ export function getLayoutDataFromRegion(regionData: object[]) {
|
|
|
188
179
|
export function getIsAssignmentView(pConnect: Function) {
|
|
189
180
|
// Get caseInfo content from the store which contains the view info about the current assignment/step
|
|
190
181
|
// TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
// @ts-ignore
|
|
194
|
-
const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);
|
|
182
|
+
const assignmentViewClass = pConnect().getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);
|
|
183
|
+
const assignmentViewName = pConnect().getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);
|
|
195
184
|
|
|
196
185
|
const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;
|
|
197
186
|
|
|
198
187
|
// Get the info about the current view from pConnect
|
|
199
|
-
|
|
200
|
-
const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;
|
|
188
|
+
const currentViewId = `${pConnect().getCurrentView()}!${pConnect().getCurrentClassID()}`;
|
|
201
189
|
|
|
202
190
|
return assignmentViewId === currentViewId;
|
|
203
191
|
}
|
|
@@ -208,8 +196,7 @@ export function getIsAssignmentView(pConnect: Function) {
|
|
|
208
196
|
* @param {string} [instructions="casestep"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)
|
|
209
197
|
*/
|
|
210
198
|
export function getInstructions(pConnect: Function, instructions: string = 'casestep') {
|
|
211
|
-
|
|
212
|
-
const caseStepInstructions = pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);
|
|
199
|
+
const caseStepInstructions = pConnect().getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);
|
|
213
200
|
|
|
214
201
|
// Determine if this view is the current assignment/step view
|
|
215
202
|
const isCurrentAssignmentView = getIsAssignmentView(pConnect);
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
1
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
-
// @ts-nocheck
|
|
4
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
3
|
|
|
6
4
|
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
@@ -30,7 +28,7 @@ window.PCore.getConstants = () => {
|
|
|
30
28
|
|
|
31
29
|
window.PCore.getLocaleUtils = () => {
|
|
32
30
|
return {
|
|
33
|
-
getLocaleValue: value => {
|
|
31
|
+
getLocaleValue: (value: any) => {
|
|
34
32
|
return value;
|
|
35
33
|
}
|
|
36
34
|
};
|
|
@@ -46,19 +44,19 @@ window.PCore.getDataApiUtils = () => {
|
|
|
46
44
|
};
|
|
47
45
|
};
|
|
48
46
|
|
|
49
|
-
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
47
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
|
|
50
48
|
|
|
51
49
|
const props = {
|
|
52
50
|
|
|
53
51
|
getPConnect: () => {
|
|
54
52
|
return {
|
|
55
|
-
getValue: value => {
|
|
53
|
+
getValue: (value: any) => {
|
|
56
54
|
return value;
|
|
57
55
|
},
|
|
58
56
|
getContextName: () => {
|
|
59
57
|
return 'app/primary_1';
|
|
60
58
|
},
|
|
61
|
-
getLocalizedValue: value => {
|
|
59
|
+
getLocalizedValue: (value: any) => {
|
|
62
60
|
return value;
|
|
63
61
|
},
|
|
64
62
|
getActionsApi: () => {
|
|
@@ -31,13 +31,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
31
31
|
];
|
|
32
32
|
|
|
33
33
|
useEffect(() => {
|
|
34
|
-
// @ts-ignore
|
|
35
34
|
const payload = { dataViewParameters: [{ CaseInstanceKey: caseID }] };
|
|
36
35
|
PCore.getDataApiUtils()
|
|
37
|
-
// @ts-ignore
|
|
38
36
|
.getData('D_pyWorkHistory', payload, context)
|
|
39
|
-
|
|
40
|
-
.then((response) => {
|
|
37
|
+
.then((response: any) => {
|
|
41
38
|
setIsLoading(false);
|
|
42
39
|
if (response.data.data !== null) {
|
|
43
40
|
setHistory(
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
-
// @ts-nocheck
|
|
4
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
4
|
|
|
6
5
|
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
@@ -63,19 +62,19 @@ window.PCore.getDataApiUtils = () => {
|
|
|
63
62
|
|
|
64
63
|
|
|
65
64
|
|
|
66
|
-
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
65
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
|
|
67
66
|
|
|
68
67
|
const props = {
|
|
69
68
|
...configProps,
|
|
70
69
|
getPConnect: () => {
|
|
71
70
|
return {
|
|
72
|
-
getValue: value => {
|
|
71
|
+
getValue: (value: any) => {
|
|
73
72
|
return value;
|
|
74
73
|
},
|
|
75
74
|
getContextName: () => {
|
|
76
75
|
return 'app/primary_1';
|
|
77
76
|
},
|
|
78
|
-
getLocalizedValue: value => {
|
|
77
|
+
getLocalizedValue: (value: any) => {
|
|
79
78
|
return value;
|
|
80
79
|
},
|
|
81
80
|
getActionsApi: () => {
|
|
@@ -8,7 +8,7 @@ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
|
8
8
|
// interface for props
|
|
9
9
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
10
10
|
// If any, enter additional props that only exist on TextInput here
|
|
11
|
-
datasource:
|
|
11
|
+
datasource: any;
|
|
12
12
|
header: string;
|
|
13
13
|
description: string;
|
|
14
14
|
whatsnewlink: string;
|
|
@@ -27,10 +27,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
27
27
|
const context = PConnect.getContextName();
|
|
28
28
|
|
|
29
29
|
let details = [];
|
|
30
|
-
// @ts-ignore
|
|
31
30
|
if (datasource && datasource.source) {
|
|
32
|
-
|
|
33
|
-
details = datasource.source.map((item) => {
|
|
31
|
+
details = datasource.source.map((item: { name: any; }) => {
|
|
34
32
|
return item.name;
|
|
35
33
|
});
|
|
36
34
|
}
|
|
@@ -50,9 +48,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
50
48
|
useEffect(() => {
|
|
51
49
|
|
|
52
50
|
PCore.getDataApiUtils()
|
|
53
|
-
// @ts-ignore
|
|
54
51
|
.getData(dataViewName, {}, context)
|
|
55
|
-
// @ts-ignore
|
|
56
52
|
.then((response: any) => {
|
|
57
53
|
setIsLoading(false);
|
|
58
54
|
if (response.data.data !== null) {
|
|
@@ -46,22 +46,19 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
46
46
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
47
|
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
const handleUserStateChange = ({ state }) => {
|
|
49
|
+
const handleUserStateChange = ({ state }: any) => {
|
|
51
50
|
setUserState(state === 'online' ? 'active' : 'inactive');
|
|
52
51
|
};
|
|
53
52
|
|
|
54
53
|
useEffect(() => {
|
|
55
54
|
const subId = PCore.getMessagingServiceManager()
|
|
56
55
|
.getUserPresence()
|
|
57
|
-
|
|
58
|
-
.subscribe(userIdentifier, handleUserStateChange);
|
|
56
|
+
.subscribe(userIdentifier, handleUserStateChange, '');
|
|
59
57
|
|
|
60
58
|
return function cleanup() {
|
|
61
59
|
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
62
60
|
};
|
|
63
61
|
}, [userIdentifier, handleUserStateChange]);
|
|
64
|
-
// @ts-ignore
|
|
65
62
|
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
|
|
66
63
|
}
|
|
67
64
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
2
|
-
// @ts-nocheck
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
3
|
|
|
5
4
|
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
@@ -21,7 +20,7 @@ if (!window.PCore) {
|
|
|
21
20
|
|
|
22
21
|
window.PCore.getLocaleUtils = () => {
|
|
23
22
|
return {
|
|
24
|
-
getLocaleValue: value => {
|
|
23
|
+
getLocaleValue: (value: any) => {
|
|
25
24
|
return value;
|
|
26
25
|
}
|
|
27
26
|
};
|
|
@@ -37,7 +36,7 @@ window.PCore.getUserApi = () => {
|
|
|
37
36
|
};
|
|
38
37
|
};
|
|
39
38
|
|
|
40
|
-
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
39
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
|
|
41
40
|
|
|
42
41
|
const props = {
|
|
43
42
|
label: configProps.label,
|
package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
-
// @ts-nocheck
|
|
4
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
4
|
|
|
6
5
|
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
7
|
-
import {
|
|
6
|
+
import { configProps } from './mock';
|
|
8
7
|
|
|
9
8
|
const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
|
|
10
9
|
title: '{{COMPONENT_CLASS_NAME}}',
|
|
@@ -51,18 +50,18 @@ window.PCore.getDataPageUtils = () => {
|
|
|
51
50
|
};
|
|
52
51
|
};
|
|
53
52
|
|
|
54
|
-
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
53
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
|
|
55
54
|
|
|
56
55
|
const props = {
|
|
57
56
|
getPConnect: () => {
|
|
58
57
|
return {
|
|
59
|
-
getValue: value => {
|
|
58
|
+
getValue: (value: any) => {
|
|
60
59
|
return value;
|
|
61
60
|
},
|
|
62
61
|
getContextName: () => {
|
|
63
62
|
return 'app/primary_1';
|
|
64
63
|
},
|
|
65
|
-
getLocalizedValue: value => {
|
|
64
|
+
getLocalizedValue: (value: any) => {
|
|
66
65
|
return value;
|
|
67
66
|
},
|
|
68
67
|
getActionsApi: () => {
|
|
@@ -116,9 +116,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
116
116
|
// only retrieve table data if table is shown
|
|
117
117
|
if (showTable) {
|
|
118
118
|
PCore.getDataPageUtils()
|
|
119
|
-
// @ts-ignore
|
|
120
119
|
.getDataAsync(dataViewName, context, params, null, null)
|
|
121
|
-
// @ts-ignore
|
|
122
120
|
.then((response: any) => {
|
|
123
121
|
setIsLoading(false);
|
|
124
122
|
// table requires an index or will get setExtraStackFrame error
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
1
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
-
// @ts-nocheck
|
|
4
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
3
|
|
|
6
4
|
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
@@ -30,7 +28,7 @@ window.PCore.getConstants = () => {
|
|
|
30
28
|
|
|
31
29
|
window.PCore.getLocaleUtils = () => {
|
|
32
30
|
return {
|
|
33
|
-
getLocaleValue: value => {
|
|
31
|
+
getLocaleValue: (value: any) => {
|
|
34
32
|
return value;
|
|
35
33
|
}
|
|
36
34
|
};
|
|
@@ -46,20 +44,20 @@ window.PCore.getDataApiUtils = () => {
|
|
|
46
44
|
};
|
|
47
45
|
};
|
|
48
46
|
|
|
49
|
-
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
47
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
|
|
50
48
|
|
|
51
49
|
const props = {
|
|
52
50
|
label: 'Case history',
|
|
53
51
|
|
|
54
52
|
getPConnect: () => {
|
|
55
53
|
return {
|
|
56
|
-
getValue: value => {
|
|
54
|
+
getValue: (value: any) => {
|
|
57
55
|
return value;
|
|
58
56
|
},
|
|
59
57
|
getContextName: () => {
|
|
60
58
|
return 'app/primary_1';
|
|
61
59
|
},
|
|
62
|
-
getLocalizedValue: value => {
|
|
60
|
+
getLocalizedValue: (value: any) => {
|
|
63
61
|
return value;
|
|
64
62
|
},
|
|
65
63
|
getActionsApi: () => {
|
|
@@ -29,13 +29,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
29
29
|
];
|
|
30
30
|
|
|
31
31
|
useEffect(() => {
|
|
32
|
-
// @ts-ignore
|
|
33
32
|
const payload = { dataViewParameters: [{ ObjectID: caseID }] };
|
|
34
33
|
PCore.getDataApiUtils()
|
|
35
|
-
// @ts-ignore
|
|
36
34
|
.getData('ObjectHistory', payload, context)
|
|
37
|
-
|
|
38
|
-
.then((response) => {
|
|
35
|
+
.then((response: any) => {
|
|
39
36
|
setIsLoading(false);
|
|
40
37
|
if (response.data.data !== null) {
|
|
41
38
|
setHistory(
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
1
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
-
// @ts-nocheck
|
|
4
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
3
|
|
|
6
4
|
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
@@ -64,19 +62,19 @@ window.PCore.getDataApiUtils = () => {
|
|
|
64
62
|
|
|
65
63
|
|
|
66
64
|
|
|
67
|
-
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
65
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
|
|
68
66
|
|
|
69
67
|
const props = {
|
|
70
68
|
...configProps,
|
|
71
69
|
getPConnect: () => {
|
|
72
70
|
return {
|
|
73
|
-
getValue: value => {
|
|
71
|
+
getValue: (value: any) => {
|
|
74
72
|
return value;
|
|
75
73
|
},
|
|
76
74
|
getContextName: () => {
|
|
77
75
|
return 'app/primary_1';
|
|
78
76
|
},
|
|
79
|
-
getLocalizedValue: value => {
|
|
77
|
+
getLocalizedValue: (value: any) => {
|
|
80
78
|
return value;
|
|
81
79
|
},
|
|
82
80
|
getActionsApi: () => {
|
|
@@ -8,7 +8,7 @@ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
|
8
8
|
// interface for props
|
|
9
9
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
10
10
|
// If any, enter additional props that only exist on TextInput here
|
|
11
|
-
datasource:
|
|
11
|
+
datasource: any;
|
|
12
12
|
header: string;
|
|
13
13
|
description: string;
|
|
14
14
|
whatsnewlink: string;
|
|
@@ -27,10 +27,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
27
27
|
const context = PConnect.getContextName();
|
|
28
28
|
|
|
29
29
|
let details = [];
|
|
30
|
-
// @ts-ignore
|
|
31
30
|
if (datasource && datasource.source) {
|
|
32
|
-
|
|
33
|
-
details = datasource.source.map((item) => {
|
|
31
|
+
details = datasource.source.map((item: any) => {
|
|
34
32
|
return item.name;
|
|
35
33
|
});
|
|
36
34
|
}
|
|
@@ -50,9 +48,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
50
48
|
useEffect(() => {
|
|
51
49
|
|
|
52
50
|
PCore.getDataApiUtils()
|
|
53
|
-
// @ts-ignore
|
|
54
51
|
.getData(dataViewName, {}, context)
|
|
55
|
-
// @ts-ignore
|
|
56
52
|
.then((response: any) => {
|
|
57
53
|
setIsLoading(false);
|
|
58
54
|
if (response.data.data !== null) {
|
|
@@ -46,8 +46,7 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
46
46
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
47
|
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
const handleUserStateChange = ({ state }) => {
|
|
49
|
+
const handleUserStateChange = ({ state } : any) => {
|
|
51
50
|
setUserState(state === 'online' ? 'active' : 'inactive');
|
|
52
51
|
};
|
|
53
52
|
|
|
@@ -61,7 +60,6 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
61
60
|
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
62
61
|
};
|
|
63
62
|
}, [userIdentifier, handleUserStateChange]);
|
|
64
|
-
// @ts-ignore
|
|
65
63
|
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
|
|
66
64
|
}
|
|
67
65
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
2
|
-
// @ts-nocheck
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
3
|
|
|
5
4
|
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
@@ -21,7 +20,7 @@ if (!window.PCore) {
|
|
|
21
20
|
|
|
22
21
|
window.PCore.getLocaleUtils = () => {
|
|
23
22
|
return {
|
|
24
|
-
getLocaleValue: value => {
|
|
23
|
+
getLocaleValue: (value: any) => {
|
|
25
24
|
return value;
|
|
26
25
|
}
|
|
27
26
|
};
|
|
@@ -37,7 +36,7 @@ window.PCore.getUserApi = () => {
|
|
|
37
36
|
};
|
|
38
37
|
};
|
|
39
38
|
|
|
40
|
-
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
39
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
|
|
41
40
|
|
|
42
41
|
const props = {
|
|
43
42
|
label: configProps.label,
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@pega/configs": "^0.6.0",
|
|
83
|
-
"@pega/custom-dx-components": "0.242.
|
|
83
|
+
"@pega/custom-dx-components": "0.242.17",
|
|
84
84
|
"@pega/pcore-pconnect-typedefs": "~3.0.0",
|
|
85
85
|
"@storybook/addon-actions": "^7.6.7",
|
|
86
86
|
"@storybook/addon-essentials": "^7.6.19",
|