@pega/dx-component-builder-sdk 0.1.7 → 0.1.8

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.
Files changed (94) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/build/helper.js +1 -1
  3. package/src/tasks/create/index.js +8 -1
  4. package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +1 -1
  5. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +60 -0
  6. package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +1 -2
  7. package/src/tasks/create/templates/Constellation/Field/Boolean/mock.stories.js.mustache +21 -0
  8. package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +61 -0
  9. package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +41 -0
  10. package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +179 -67
  11. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +40 -16
  12. package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +3 -1
  13. package/src/tasks/create/templates/Constellation/Field/Date/mock.stories.js.mustache +23 -0
  14. package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +0 -1
  15. package/src/tasks/create/templates/Constellation/Field/DateTime/{date-utils.js → date-utils.js.mustache} +1 -0
  16. package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +1 -0
  17. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +40 -15
  18. package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +2 -0
  19. package/src/tasks/create/templates/Constellation/Field/DateTime/mock.stories.js.mustache +23 -0
  20. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +22 -17
  21. package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +2 -1
  22. package/src/tasks/create/templates/Constellation/Field/Decimal/mock.stories.js.mustache +21 -0
  23. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +25 -17
  24. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +3 -4
  25. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.stories.js.mustache +23 -0
  26. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +22 -17
  27. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +8 -2
  28. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.stories.js.mustache +21 -0
  29. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +22 -17
  30. package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +2 -1
  31. package/src/tasks/create/templates/Constellation/Field/Integer/mock.stories.js.mustache +21 -0
  32. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +42 -14
  33. package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +44 -1
  34. package/src/tasks/create/templates/Constellation/Field/Picklist/mock.stories.js.mustache +67 -0
  35. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +21 -16
  36. package/src/tasks/create/templates/Constellation/Field/Text/mock.stories.js.mustache +13 -0
  37. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +20 -16
  38. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +44 -2
  39. package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.stories.js.mustache +22 -0
  40. package/src/tasks/create/templates/Constellation/Field/Text-Input/{StatusWork.js → StatusWork.jsx} +0 -1
  41. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +21 -17
  42. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +46 -3
  43. package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.stories.js.mustache +21 -0
  44. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +21 -17
  45. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +44 -2
  46. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.stories.js.mustache +20 -0
  47. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +19 -17
  48. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +46 -2
  49. package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.stories.js.mustache +37 -0
  50. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +19 -17
  51. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +174 -3
  52. package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.stories.js.mustache +22 -0
  53. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +24 -16
  54. package/src/tasks/create/templates/Constellation/Field/TimeofDay/mock.stories.js.mustache +20 -0
  55. package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache +1 -0
  56. package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.jsx.mustache +26 -0
  57. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +110 -0
  58. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +3 -5
  59. package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.stories.js.mustache +179 -0
  60. package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +3 -6
  61. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.jsx.mustache +26 -0
  62. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +118 -0
  63. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +3 -5
  64. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.stories.js.mustache +215 -0
  65. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache +3 -3
  66. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +89 -0
  67. package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +6 -10
  68. package/src/tasks/create/templates/Constellation/Template/FORM/mock.stories.js.mustache +125 -0
  69. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +100 -0
  70. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +5 -11
  71. package/src/tasks/create/templates/Constellation/Template/FORM-region/mock.stories.js.mustache +131 -0
  72. package/src/tasks/create/templates/Constellation/Template/PAGE/{GetNextWork.js.mustache → GetNextWork.jsx.mustache} +6 -0
  73. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.jsx.mustache +102 -0
  74. package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +9 -7
  75. package/src/tasks/create/templates/Constellation/Template/PAGE/mock.stories.js.mustache +94 -0
  76. package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +4 -1
  77. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.jsx.mustache +78 -0
  78. package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +1 -0
  79. package/src/tasks/create/templates/Constellation/Widget/CASE/mock.stories.js.mustache +389 -0
  80. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.jsx.mustache +30 -0
  81. package/src/tasks/create/templates/Constellation/Widget/PAGE/mock.stories.js.mustache +22 -0
  82. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Avatar.js.mustache → Avatar.jsx.mustache} +2 -0
  83. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Operator.js.mustache → Operator.jsx.mustache} +2 -1
  84. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.jsx.mustache +68 -0
  85. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +9 -9
  86. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.stories.js.mustache +51 -0
  87. package/src/tasks/map/map.js +0 -7
  88. package/src/tasks/override/index.js +38 -9
  89. package/src/tasks/create/templates/Constellation/Field/Picklist/picklist.js.mustache +0 -43
  90. package/src/tasks/create/templates/Constellation/Field/Text-Email/text-email.js.mustache +0 -43
  91. package/src/tasks/create/templates/Constellation/Field/Text-Input/text-input.js.mustache +0 -43
  92. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/text-paragraph.js.mustache +0 -43
  93. package/src/tasks/create/templates/Constellation/Field/Text-Phone/text-phone.js.mustache +0 -43
  94. package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.js.mustache +0 -172
@@ -17,16 +17,14 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
17
17
  const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
18
18
 
19
19
  const numRegions = getAllFields(getPConnect)?.length;
20
- const gridRepeat = 'repeat(' + numRegions + ', 1fr)';
21
- let gridContainer = {};
20
+ const gridRepeat = "repeat(".concat(numRegions).concat(", 1fr)");
21
+ const gridContainer = { "colGap": 1};
22
22
  gridContainer.cols = gridRepeat;
23
23
  gridContainer.alignItems = 'start';
24
- gridContainer.colGap = 1;
25
24
 
26
- let gridHighlightContainer = {};
25
+ const gridHighlightContainer = { "gap": 2};
27
26
  gridHighlightContainer.cols = gridRepeat;
28
27
  gridHighlightContainer.alignItems = 'start';
29
- gridHighlightContainer.gap = 2;
30
28
  gridHighlightContainer.pad = [0, 0, 2, 0];
31
29
 
32
30
  // Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
@@ -0,0 +1,179 @@
1
+ export const pyReviewRaw = {
2
+ name: 'pyReview',
3
+ type: 'View',
4
+ config: {
5
+ template: 'Details',
6
+ ruleClass: 'MyCo-MyCompon-Work-MyComponents',
7
+ showLabel: true,
8
+ label: '@L Details',
9
+ localeReference: '@LR MYCO-MYCOMPON-WORK-MYCOMPONENTS!VIEW!PYREVIEW',
10
+ showHighlightedData: true,
11
+ highlightedData: [
12
+ {
13
+ type: 'TextInput',
14
+ config: {
15
+ value: '@P .pyStatusWork',
16
+ label: '@L Work Status',
17
+ displayMode: 'STACKED_LARGE_VAL',
18
+ displayAsStatus: true
19
+ }
20
+ },
21
+ {
22
+ type: 'TextInput',
23
+ config: {
24
+ value: '@P .pyID',
25
+ label: '@L Case ID',
26
+ displayMode: 'STACKED_LARGE_VAL'
27
+ }
28
+ },
29
+ {
30
+ type: 'DateTime',
31
+ config: {
32
+ value: '@P .pxCreateDateTime',
33
+ label: '@L Create date/time',
34
+ displayMode: 'STACKED_LARGE_VAL'
35
+ }
36
+ },
37
+ {
38
+ type: 'UserReference',
39
+ config: {
40
+ label: '@L Create Operator',
41
+ value: '@USER .pxCreateOperator',
42
+ placeholder: 'Select...',
43
+ displayMode: 'STACKED_LARGE_VAL'
44
+ }
45
+ }
46
+ ],
47
+ inheritedProps: [
48
+ {
49
+ prop: 'label',
50
+ value: '@L Details'
51
+ },
52
+ {
53
+ prop: 'showLabel',
54
+ value: true
55
+ }
56
+ ]
57
+ },
58
+ children: [
59
+ {
60
+ name: 'A',
61
+ type: 'Region',
62
+ getPConnect: () => {
63
+ return {
64
+ getRawMetadata: () => {
65
+ return pyReviewRaw.children[0];
66
+ }
67
+ };
68
+ },
69
+ children: [
70
+ {
71
+ type: 'DateTime',
72
+ config: {
73
+ value: '@P .pySLADeadline',
74
+ label: '@L SLA Deadline'
75
+ }
76
+ },
77
+ {
78
+ type: 'DateTime',
79
+ config: {
80
+ value: '@P .pySLAGoal',
81
+ label: '@L SLA Goal'
82
+ }
83
+ },
84
+ {
85
+ type: 'RadioButtons',
86
+ config: {
87
+ value: '@P .pySLAStartTime',
88
+ label: '@L SLA Start Time',
89
+ listType: 'associated',
90
+ datasource: '@ASSOCIATED .pySLAStartTime'
91
+ }
92
+ }
93
+ ]
94
+ }
95
+ ],
96
+ classID: 'MyCo-MyCompon-Work-MyComponents'
97
+ };
98
+
99
+ export const pyReviewResolved = {
100
+ readOnly: true,
101
+ template: 'Details',
102
+ ruleClass: 'MyCo-MyCompon-Work-MyComponents',
103
+ showLabel: true,
104
+ label: 'Details',
105
+ localeReference: 'MYCO-MYCOMPON-WORK-MYCOMPONENTS!VIEW!PYREVIEW',
106
+ showHighlightedData: true,
107
+ highlightedData: [
108
+ {
109
+ type: 'TextInput',
110
+ config: {
111
+ value: 'New',
112
+ label: 'Work Status',
113
+ displayMode: 'STACKED_LARGE_VAL',
114
+ displayAsStatus: true
115
+ }
116
+ },
117
+ {
118
+ type: 'TextInput',
119
+ config: {
120
+ value: 'M-1002',
121
+ label: 'Case ID',
122
+ displayMode: 'STACKED_LARGE_VAL'
123
+ }
124
+ },
125
+ {
126
+ type: 'DateTime',
127
+ config: {
128
+ value: '2022-12-11T20:06:27.232Z',
129
+ label: 'Create date/time',
130
+ displayMode: 'STACKED_LARGE_VAL'
131
+ }
132
+ },
133
+ {
134
+ type: 'UserReference',
135
+ config: {
136
+ label: 'Create Operator',
137
+ value: {
138
+ userId: 'conns',
139
+ userName: 'Sara Connor'
140
+ },
141
+ placeholder: 'Select...',
142
+ displayMode: 'STACKED_LARGE_VAL'
143
+ }
144
+ }
145
+ ],
146
+ displayMode: 'LABELS_LEFT'
147
+ };
148
+
149
+ export const regionChildrenResolved = [
150
+ {
151
+ readOnly: true,
152
+ value: '',
153
+ label: 'SLA Deadline',
154
+ displayMode: 'LABELS_LEFT'
155
+ },
156
+ {
157
+ readOnly: true,
158
+ value: '',
159
+ label: 'SLA Goal',
160
+ displayMode: 'LABELS_LEFT'
161
+ },
162
+ {
163
+ readOnly: true,
164
+ value: '',
165
+ label: 'SLA Start Time',
166
+ listType: 'associated',
167
+ datasource: [
168
+ {
169
+ key: 'AssignmentCreation',
170
+ value: 'The creation time of the Assignment'
171
+ },
172
+ {
173
+ key: 'CurrentTime',
174
+ value: 'Current Date Time'
175
+ }
176
+ ],
177
+ displayMode: 'LABELS_LEFT'
178
+ }
179
+ ];
@@ -1,8 +1,4 @@
1
- import { useContext, createContext } from 'react';
2
- import { connect, Provider, shallowEqual } from 'react-redux';
3
- import { createUID } from '@pega/cosmos-react-core';
4
-
5
-
1
+ /* eslint-disable no-undef */
6
2
 
7
3
  /**
8
4
  * Given the PConnect object of a Template component, retrieve the children
@@ -141,8 +137,9 @@ export function getInstructions(pConnect, instructions = 'casestep') {
141
137
 
142
138
  // If the annotation wasn't processed correctly, don't return any instruction text
143
139
  if (instructions?.startsWith('@PARAGRAPH')) {
140
+ /* eslint-disable no-console */
144
141
  console.error('@PARAGRAPH annotation was not processed. Hiding custom instructions.');
145
- return undefined;
142
+ /* eslint-enable no-console */ return undefined;
146
143
  }
147
144
 
148
145
  // Custom instructions from the view
@@ -0,0 +1,26 @@
1
+ import { Status } from "@pega/cosmos-react-core";
2
+
3
+ export default function StatusWorkRenderer({ value }) {
4
+ let variant = "info";
5
+
6
+ const warnStrings = ["fail", "cancel", "reject", "revoke", "stopped", "warn"];
7
+ const infoStrings = ["open", "hold", "info", "new"];
8
+ const successStrings = ["resolved", "completed", "success"];
9
+ const pendingStrings = ["pending"];
10
+
11
+ if (new RegExp(warnStrings.join("|"), "i").test(value)) {
12
+ variant = "warn";
13
+ } else if (new RegExp(infoStrings.join("|"), "i").test(value)) {
14
+ variant = "info";
15
+ } else if (new RegExp(successStrings.join("|"), "i").test(value)) {
16
+ variant = "success";
17
+ } else if (new RegExp(pendingStrings.join("|"), "i").test(value)) {
18
+ variant = "pending";
19
+ }
20
+
21
+ return (
22
+ <Status type="rectangle" variant={variant}>
23
+ {value}
24
+ </Status>
25
+ );
26
+ }
@@ -0,0 +1,118 @@
1
+ import { Text, FieldValueList, Button, DateTimeDisplay, useTheme } from '@pega/cosmos-react-core';
2
+ import {{COMPONENT_CLASS_NAME}} from './index';
3
+ import { pyReviewRaw, pyReviewResolved, regionChildrenResolved } from './mock.stories';
4
+ import StatusWorkRenderer from './StatusWork.jsx';
5
+
6
+ export default {
7
+ title: '{{COMPONENT_CLASS_NAME}}',
8
+ component: {{COMPONENT_CLASS_NAME}}
9
+ };
10
+
11
+ const Template = args => {
12
+ const regionAChildren = pyReviewRaw.children[0].children.map(child => {
13
+ return Primary.args.getPConnect().createComponent(child);
14
+ });
15
+ const regionBChildren = pyReviewRaw.children[1].children.map(child => {
16
+ return Primary.args.getPConnect().createComponent(child);
17
+ });
18
+
19
+ return (
20
+ <{{COMPONENT_CLASS_NAME}} {...args}>
21
+ {regionAChildren}
22
+ {regionBChildren}
23
+ </{{COMPONENT_CLASS_NAME}}>
24
+ );
25
+ };
26
+
27
+ export const Primary = Template.bind({});
28
+
29
+ Primary.args = {
30
+ template: 'MyCo_MyComponents_NewDetailsTemplate',
31
+ showHighlightedData: true,
32
+ label: 'Test Details',
33
+ showLabel: true,
34
+ getPConnect: () => {
35
+ return {
36
+ getChildren: () => {
37
+ return pyReviewRaw.children;
38
+ },
39
+ getRawMetadata: () => {
40
+ return pyReviewRaw;
41
+ },
42
+ getInheritedProps: () => {
43
+ return pyReviewRaw.config.inheritedProps;
44
+ },
45
+ createComponent: config => {
46
+ switch (config.config.value) {
47
+ case '@P .pyStatusWork':
48
+ return renderField(pyReviewResolved.highlightedData[0].config);
49
+ case '@P .pyID':
50
+ return renderField(pyReviewResolved.highlightedData[1].config);
51
+ case '@P .pxCreateDateTime':
52
+ return renderField(pyReviewResolved.highlightedData[2].config);
53
+ case '@USER .pxCreateOperator':
54
+ return renderField(pyReviewResolved.highlightedData[3].config);
55
+ case '@P .pySLADeadline':
56
+ return renderField(regionChildrenResolved[0]);
57
+ case '@P .pySLAGoal':
58
+ return renderField(regionChildrenResolved[1]);
59
+ case '@P .pySLAStartTime':
60
+ return renderField(regionChildrenResolved[2]);
61
+ }
62
+ },
63
+ setInheritedProp: () => {},
64
+ resolveConfigProps: () => {}
65
+ };
66
+ }
67
+ };
68
+
69
+ const renderField = resolvedProps => {
70
+ const {
71
+ displayAsStatus = false,
72
+ displayMode,
73
+ value = '',
74
+ label = '',
75
+ theme = useTheme()
76
+ } = resolvedProps;
77
+
78
+ const variant = displayMode === 'LABELS_LEFT' ? 'inline' : 'stacked';
79
+
80
+ let val =
81
+ value != '' ? (
82
+ <Text variant='h1' as='span'>
83
+ {value}
84
+ </Text>
85
+ ) : (
86
+ ''
87
+ );
88
+
89
+ if (label === 'Create date/time')
90
+ val = <DateTimeDisplay value={value} variant='datetime' format='long' clockFormat={null} />;
91
+
92
+ if (displayAsStatus === true) val = <StatusWorkRenderer value={value} />;
93
+
94
+ if (label === 'Create Operator')
95
+ val = (
96
+ <Button
97
+ variant='link'
98
+ style={
99
+ label !== null
100
+ ? { width: 'max-content', height: theme.components.input.height }
101
+ : undefined
102
+ }
103
+ >
104
+ {value.userName}
105
+ </Button>
106
+ );
107
+
108
+ if (variant === 'inline') {
109
+ val = value || <span aria-hidden='true'>&ndash;&ndash;</span>;
110
+ } else {
111
+ val = (
112
+ <Text variant='h1' as='span'>
113
+ {val}
114
+ </Text>
115
+ );
116
+ }
117
+ return <FieldValueList variant={variant} fields={[{ name: label, value: val }]} />;
118
+ };
@@ -17,16 +17,14 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
17
17
  const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
18
18
 
19
19
  const numRegions = getAllFields(getPConnect)?.length;
20
- const gridRepeat = 'repeat(' + numRegions + ', 1fr)';
21
- let gridContainer = {};
20
+ const gridRepeat = "repeat(".concat(numRegions).concat(", 1fr)");
21
+ const gridContainer = { "colGap": 1};
22
22
  gridContainer.cols = gridRepeat;
23
23
  gridContainer.alignItems = 'start';
24
- gridContainer.colGap = 1;
25
24
 
26
- let gridHighlightContainer = {};
25
+ const gridHighlightContainer = { "gap": 2};
27
26
  gridHighlightContainer.cols = gridRepeat;
28
27
  gridHighlightContainer.alignItems = 'start';
29
- gridHighlightContainer.gap = 2;
30
28
  gridHighlightContainer.pad = [0, 0, 2, 0];
31
29
 
32
30
  // Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
@@ -0,0 +1,215 @@
1
+ export const pyReviewRaw = {
2
+ name: 'pyReview',
3
+ type: 'View',
4
+ config: {
5
+ template: 'Details',
6
+ ruleClass: 'MyCo-MyCompon-Work-MyComponents',
7
+ showLabel: true,
8
+ label: '@L Details',
9
+ localeReference: '@LR MYCO-MYCOMPON-WORK-MYCOMPONENTS!VIEW!PYREVIEW',
10
+ showHighlightedData: true,
11
+ highlightedData: [
12
+ {
13
+ type: 'TextInput',
14
+ config: {
15
+ value: '@P .pyStatusWork',
16
+ label: '@L Work Status',
17
+ displayMode: 'STACKED_LARGE_VAL',
18
+ displayAsStatus: true
19
+ }
20
+ },
21
+ {
22
+ type: 'TextInput',
23
+ config: {
24
+ value: '@P .pyID',
25
+ label: '@L Case ID',
26
+ displayMode: 'STACKED_LARGE_VAL'
27
+ }
28
+ },
29
+ {
30
+ type: 'DateTime',
31
+ config: {
32
+ value: '@P .pxCreateDateTime',
33
+ label: '@L Create date/time',
34
+ displayMode: 'STACKED_LARGE_VAL'
35
+ }
36
+ },
37
+ {
38
+ type: 'UserReference',
39
+ config: {
40
+ label: '@L Create Operator',
41
+ value: '@USER .pxCreateOperator',
42
+ placeholder: 'Select...',
43
+ displayMode: 'STACKED_LARGE_VAL'
44
+ }
45
+ }
46
+ ],
47
+ inheritedProps: [
48
+ {
49
+ prop: 'label',
50
+ value: '@L Details'
51
+ },
52
+ {
53
+ prop: 'showLabel',
54
+ value: true
55
+ }
56
+ ]
57
+ },
58
+ children: [
59
+ {
60
+ name: 'A',
61
+ type: 'Region',
62
+ getPConnect: () => {
63
+ return {
64
+ getRawMetadata: () => {
65
+ return pyReviewRaw.children[0];
66
+ }
67
+ };
68
+ },
69
+ children: [
70
+ {
71
+ type: 'DateTime',
72
+ config: {
73
+ value: '@P .pySLADeadline',
74
+ label: '@L SLA Deadline'
75
+ }
76
+ },
77
+ {
78
+ type: 'DateTime',
79
+ config: {
80
+ value: '@P .pySLAGoal',
81
+ label: '@L SLA Goal'
82
+ }
83
+ },
84
+ {
85
+ type: 'RadioButtons',
86
+ config: {
87
+ value: '@P .pySLAStartTime',
88
+ label: '@L SLA Start Time',
89
+ listType: 'associated',
90
+ datasource: '@ASSOCIATED .pySLAStartTime'
91
+ }
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ name: 'B',
97
+ type: 'Region',
98
+ getPConnect: () => {
99
+ return {
100
+ getRawMetadata: () => {
101
+ return pyReviewRaw.children[0];
102
+ }
103
+ };
104
+ },
105
+ children: [
106
+ {
107
+ type: 'DateTime',
108
+ config: {
109
+ value: '@P .pySLADeadline',
110
+ label: '@L SLA Deadline'
111
+ }
112
+ },
113
+ {
114
+ type: 'DateTime',
115
+ config: {
116
+ value: '@P .pySLAGoal',
117
+ label: '@L SLA Goal'
118
+ }
119
+ },
120
+ {
121
+ type: 'RadioButtons',
122
+ config: {
123
+ value: '@P .pySLAStartTime',
124
+ label: '@L SLA Start Time',
125
+ listType: 'associated',
126
+ datasource: '@ASSOCIATED .pySLAStartTime'
127
+ }
128
+ }
129
+ ]
130
+ }
131
+ ],
132
+ classID: 'MyCo-MyCompon-Work-MyComponents'
133
+ };
134
+
135
+ export const pyReviewResolved = {
136
+ readOnly: true,
137
+ template: 'Details',
138
+ ruleClass: 'MyCo-MyCompon-Work-MyComponents',
139
+ showLabel: true,
140
+ label: 'Details',
141
+ localeReference: 'MYCO-MYCOMPON-WORK-MYCOMPONENTS!VIEW!PYREVIEW',
142
+ showHighlightedData: true,
143
+ highlightedData: [
144
+ {
145
+ type: 'TextInput',
146
+ config: {
147
+ value: 'New',
148
+ label: 'Work Status',
149
+ displayMode: 'STACKED_LARGE_VAL',
150
+ displayAsStatus: true
151
+ }
152
+ },
153
+ {
154
+ type: 'TextInput',
155
+ config: {
156
+ value: 'M-1002',
157
+ label: 'Case ID',
158
+ displayMode: 'STACKED_LARGE_VAL'
159
+ }
160
+ },
161
+ {
162
+ type: 'DateTime',
163
+ config: {
164
+ value: '2022-12-11T20:06:27.232Z',
165
+ label: 'Create date/time',
166
+ displayMode: 'STACKED_LARGE_VAL'
167
+ }
168
+ },
169
+ {
170
+ type: 'UserReference',
171
+ config: {
172
+ label: 'Create Operator',
173
+ value: {
174
+ userId: 'conns',
175
+ userName: 'Sara Connor'
176
+ },
177
+ placeholder: 'Select...',
178
+ displayMode: 'STACKED_LARGE_VAL'
179
+ }
180
+ }
181
+ ],
182
+ displayMode: 'LABELS_LEFT'
183
+ };
184
+
185
+ export const regionChildrenResolved = [
186
+ {
187
+ readOnly: true,
188
+ value: '',
189
+ label: 'SLA Deadline',
190
+ displayMode: 'LABELS_LEFT'
191
+ },
192
+ {
193
+ readOnly: true,
194
+ value: '',
195
+ label: 'SLA Goal',
196
+ displayMode: 'LABELS_LEFT'
197
+ },
198
+ {
199
+ readOnly: true,
200
+ value: '',
201
+ label: 'SLA Start Time',
202
+ listType: 'associated',
203
+ datasource: [
204
+ {
205
+ key: 'AssignmentCreation',
206
+ value: 'The creation time of the Assignment'
207
+ },
208
+ {
209
+ key: 'CurrentTime',
210
+ value: 'Current Date Time'
211
+ }
212
+ ],
213
+ displayMode: 'LABELS_LEFT'
214
+ }
215
+ ];
@@ -1,6 +1,4 @@
1
- import { useContext, createContext } from 'react';
2
- import { connect, Provider, shallowEqual } from 'react-redux';
3
- import { createUID } from '@pega/cosmos-react-core';
1
+ /* eslint-disable no-undef */
4
2
 
5
3
 
6
4
 
@@ -141,7 +139,9 @@ export function getInstructions(pConnect, instructions = 'casestep') {
141
139
 
142
140
  // If the annotation wasn't processed correctly, don't return any instruction text
143
141
  if (instructions?.startsWith('@PARAGRAPH')) {
142
+ /* eslint-disable no-console */
144
143
  console.error('@PARAGRAPH annotation was not processed. Hiding custom instructions.');
144
+ /* eslint-enable no-console */
145
145
  return undefined;
146
146
  }
147
147