@pega/custom-dx-components 0.24.14 → 0.24.16
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/Icon-Button-URL/demo.stories.tsx.mustache +5 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +26 -15
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +78 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Operator.tsx.mustache +218 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +47 -13
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +69 -10
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +78 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Operator.tsx.mustache +218 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +46 -12
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +55 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +29 -22
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +34 -20
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +5 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +30 -17
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +30 -22
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +34 -20
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +47 -13
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +2 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/mock.ts +69 -10
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +5 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +26 -15
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +29 -22
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +34 -20
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +46 -12
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +2 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/mock.ts +55 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +2 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +47 -13
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +2 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/mock.ts +69 -10
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +5 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/index.tsx +30 -17
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +30 -22
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +34 -20
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +46 -12
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +2 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/mock.ts +55 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +2 -2
package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
5
|
import { Text, FieldValueList, Button, DateTimeDisplay, useTheme } from '@pega/cosmos-react-core';
|
|
6
6
|
import PegaDxilMyTwoColumnDetails from './index';
|
|
7
|
-
import { pyReviewRaw, pyReviewResolved, regionChildrenResolved } from './mock';
|
|
7
|
+
import { pyReviewRaw, pyReviewResolved, regionChildrenResolved, operatorDetails, configProps } from './mock';
|
|
8
8
|
import StatusWorkRenderer from './StatusWork';
|
|
9
|
+
import Operator from './Operator';
|
|
9
10
|
|
|
10
11
|
const meta: Meta<typeof PegaDxilMyTwoColumnDetails> = {
|
|
11
12
|
title: 'PegaDxilMyTwoColumnDetails',
|
|
@@ -19,6 +20,28 @@ const meta: Meta<typeof PegaDxilMyTwoColumnDetails> = {
|
|
|
19
20
|
export default meta;
|
|
20
21
|
type Story = StoryObj<typeof PegaDxilMyTwoColumnDetails>;
|
|
21
22
|
|
|
23
|
+
if (!window.PCore) {
|
|
24
|
+
window.PCore = {};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
window.PCore.getLocaleUtils = () => {
|
|
28
|
+
return {
|
|
29
|
+
getLocaleValue: value => {
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
window.PCore.getUserApi = () => {
|
|
36
|
+
return {
|
|
37
|
+
getOperatorDetails: () => {
|
|
38
|
+
return new Promise(resolve => {
|
|
39
|
+
resolve(operatorDetails);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
22
45
|
const Region = props => {
|
|
23
46
|
return <></>;
|
|
24
47
|
};
|
|
@@ -58,19 +81,30 @@ const renderField = resolvedProps => {
|
|
|
58
81
|
|
|
59
82
|
if (displayAsStatus === true) val = <StatusWorkRenderer value={value} key={key} />;
|
|
60
83
|
|
|
84
|
+
const [_label] =
|
|
85
|
+
label === 'Create operator'
|
|
86
|
+
? [configProps.createLabel, configProps.createOperator, configProps.createDateTime]
|
|
87
|
+
: label === 'Update operator'
|
|
88
|
+
? [configProps.updateLabel, configProps.updateOperator, configProps.updateDateTime]
|
|
89
|
+
: [configProps.resolveLabel, configProps.resolveOperator, configProps.resolveDateTime];
|
|
90
|
+
|
|
61
91
|
if (label === 'Create Operator')
|
|
62
92
|
val = (
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
|
|
93
|
+
<Operator
|
|
94
|
+
label={configProps.hideLabel ? '' : _label}
|
|
95
|
+
name={configProps.createOperator.userName}
|
|
96
|
+
id={configProps.createOperator.userId}
|
|
97
|
+
value={undefined}
|
|
98
|
+
validatemessage=''
|
|
99
|
+
hideLabel={false}
|
|
100
|
+
readOnly={false}
|
|
101
|
+
required={false}
|
|
102
|
+
disabled={false}
|
|
103
|
+
externalUser={undefined}
|
|
104
|
+
metaObj={undefined}
|
|
105
|
+
testId=''
|
|
106
|
+
helperText=''
|
|
107
|
+
/>
|
|
74
108
|
);
|
|
75
109
|
|
|
76
110
|
if (variant === 'inline') {
|
|
@@ -35,7 +35,7 @@ function PegaDxilMyTwoColumnDetails(props: PegaDxilMyTwoColumnDetailsProps) {
|
|
|
35
35
|
const numRegions = getAllFields(getPConnect)?.length;
|
|
36
36
|
const gridRepeat = "repeat(".concat(numRegions).concat(", 1fr)");
|
|
37
37
|
|
|
38
|
-
const gridContainer: GridContainerProps = { colGap:
|
|
38
|
+
const gridContainer: GridContainerProps = { colGap: 6 };
|
|
39
39
|
gridContainer.cols = gridRepeat;
|
|
40
40
|
gridContainer.alignItems = 'start';
|
|
41
41
|
|
|
@@ -73,7 +73,7 @@ function PegaDxilMyTwoColumnDetails(props: PegaDxilMyTwoColumnDetailsProps) {
|
|
|
73
73
|
{children.map((child: any, i: number) => (
|
|
74
74
|
<Flex
|
|
75
75
|
// @ts-ignore
|
|
76
|
-
container={{ direction: 'column', alignItems: 'normal', colGap:
|
|
76
|
+
container={{ direction: 'column', alignItems: 'normal', colGap: 1, rowGap: 1.5 }}
|
|
77
77
|
key={`r-${i + 1}`}
|
|
78
78
|
>
|
|
79
79
|
<DetailsRender child={child} />
|
|
@@ -233,3 +233,58 @@ export const regionChildrenResolved = [
|
|
|
233
233
|
key: 'SLA Start Time'
|
|
234
234
|
}
|
|
235
235
|
];
|
|
236
|
+
|
|
237
|
+
export const operatorDetails = {
|
|
238
|
+
data: {
|
|
239
|
+
pzLoadTime: 'January 18, 2023 10:33:19 AM EST',
|
|
240
|
+
pzPageNameHash: '_pa1519192551088960pz',
|
|
241
|
+
pyOperatorInfo: {
|
|
242
|
+
pyUserName: 'french DigV2',
|
|
243
|
+
pyPosition: '',
|
|
244
|
+
pyImageInsKey: '',
|
|
245
|
+
pySkills: [
|
|
246
|
+
{
|
|
247
|
+
pySkillName: '',
|
|
248
|
+
pzIndexOwnerKey: 'DATA-ADMIN-OPERATOR-ID FRENCHTEST.DIGV2',
|
|
249
|
+
pySkillRating: 0
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
pyReportToUserName: '',
|
|
253
|
+
pyReportTo: '',
|
|
254
|
+
pyOrganization: 'DXIL',
|
|
255
|
+
pyTitle: '',
|
|
256
|
+
pyLabel: 'frenchTest.DigV2',
|
|
257
|
+
pyEmailAddress: 'User@DigV2',
|
|
258
|
+
pyTelephone: ''
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
status: 200,
|
|
262
|
+
statusText: '',
|
|
263
|
+
headers: {
|
|
264
|
+
'content-length': '435',
|
|
265
|
+
'content-type': 'application/json;charset=UTF-8'
|
|
266
|
+
},
|
|
267
|
+
request: {}
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const configProps = {
|
|
271
|
+
label: 'Create operator',
|
|
272
|
+
createLabel: 'Created',
|
|
273
|
+
updateLabel: 'Updated',
|
|
274
|
+
updateDateTime: '2023-01-16T14:53:33.280Z',
|
|
275
|
+
createDateTime: '2023-01-16T14:53:33.198Z',
|
|
276
|
+
updateOperator: {
|
|
277
|
+
userId: 'admin@mediaco',
|
|
278
|
+
userName: 'admin'
|
|
279
|
+
},
|
|
280
|
+
createOperator: {
|
|
281
|
+
userId: 'admin@mediaco',
|
|
282
|
+
userName: 'admin'
|
|
283
|
+
},
|
|
284
|
+
resolveLabel: '',
|
|
285
|
+
resolveOperator: '',
|
|
286
|
+
resolveDateTime: '',
|
|
287
|
+
hideLabel: true,
|
|
288
|
+
key: '_532zx1dah',
|
|
289
|
+
displayMode: 'LABELS_LEFT'
|
|
290
|
+
};
|
|
@@ -22,7 +22,7 @@ function PegaDxilMyTwoColumnForm(props: PegaDxilMyTwoColumnFormProps) {
|
|
|
22
22
|
|
|
23
23
|
const numRegions = children?.length;
|
|
24
24
|
const gridRepeat = "repeat(".concat(numRegions).concat(", 1fr)");
|
|
25
|
-
const gridContainer = {"colGap" :
|
|
25
|
+
const gridContainer = {"colGap" : 6};
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
gridContainer.cols = gridRepeat;
|
|
28
28
|
// @ts-ignore
|
|
@@ -40,7 +40,7 @@ function PegaDxilMyTwoColumnForm(props: PegaDxilMyTwoColumnFormProps) {
|
|
|
40
40
|
{children.map((child: any, i: number) => (
|
|
41
41
|
<Flex
|
|
42
42
|
// @ts-ignore
|
|
43
|
-
container={{ direction: 'column', alignItems: 'normal', colGap:
|
|
43
|
+
container={{ direction: 'column', alignItems: 'normal', colGap: 1, rowGap: 1.5 }}
|
|
44
44
|
key={`r-${i + 1}`}
|
|
45
45
|
>
|
|
46
46
|
<DetailsRender child={child} />
|