@pega/custom-dx-components 2.0.24 → 2.0.25

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 (122) hide show
  1. package/README.md +1 -1
  2. package/package.json +3 -5
  3. package/src/cli.js +0 -18
  4. package/src/constants.js +2 -32
  5. package/src/tasks/authenticate/helper.js +8 -91
  6. package/src/tasks/authenticate/index.js +56 -125
  7. package/src/tasks/create/index.js +63 -59
  8. package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +1 -1
  9. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +16 -33
  10. package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +2 -1
  11. package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +67 -179
  12. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +17 -46
  13. package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +1 -3
  14. package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +1 -0
  15. package/src/tasks/create/templates/Constellation/Field/DateTime/{date-utils.js.mustache → date-utils.js} +0 -1
  16. package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +0 -1
  17. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +17 -46
  18. package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +0 -2
  19. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +17 -22
  20. package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +1 -2
  21. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +17 -26
  22. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +4 -3
  23. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +17 -22
  24. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +2 -8
  25. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +17 -22
  26. package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +1 -2
  27. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +16 -50
  28. package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +1 -44
  29. package/src/tasks/create/templates/Constellation/Field/Picklist/picklist.js.mustache +43 -0
  30. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +16 -23
  31. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +17 -21
  32. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +2 -44
  33. package/src/tasks/create/templates/Constellation/Field/Text-Email/text-email.js.mustache +43 -0
  34. package/src/tasks/create/templates/Constellation/Field/Text-Input/{StatusWork.jsx → StatusWork.js} +1 -0
  35. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +17 -21
  36. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +3 -46
  37. package/src/tasks/create/templates/Constellation/Field/Text-Input/text-input.js.mustache +43 -0
  38. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +17 -21
  39. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +2 -44
  40. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/text-paragraph.js.mustache +43 -0
  41. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +17 -19
  42. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +3 -47
  43. package/src/tasks/create/templates/Constellation/Field/Text-Phone/text-phone.js.mustache +43 -0
  44. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +17 -19
  45. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +1 -1
  46. package/src/tasks/create/templates/Constellation/Field/Text-URL/{text-url.jsx.mustache → text-url.js.mustache} +1 -2
  47. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +17 -30
  48. package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache +0 -1
  49. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +29 -14
  50. package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +77 -3
  51. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +29 -14
  52. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache +74 -3
  53. package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +10 -6
  54. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +8 -10
  55. package/src/tasks/create/templates/Constellation/Template/PAGE/{GetNextWork.jsx.mustache → GetNextWork.js.mustache} +0 -6
  56. package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +7 -9
  57. package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +1 -4
  58. package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +0 -1
  59. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +8 -8
  60. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Avatar.jsx.mustache → Avatar.js.mustache} +0 -2
  61. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Operator.jsx.mustache → Operator.js.mustache} +1 -2
  62. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +9 -9
  63. package/src/tasks/delete/helper.js +0 -4
  64. package/src/tasks/delete/index.js +0 -4
  65. package/src/tasks/index.js +0 -3
  66. package/src/tasks/init/index.js +3 -3
  67. package/src/tasks/init/template/.eslintrc.json +5 -186
  68. package/src/tasks/init/template/README.md +59 -75
  69. package/src/tasks/init/template/package.json.mustache +6 -21
  70. package/src/tasks/init/template/tasks.config.json +4 -16
  71. package/src/tasks/list/index.js +0 -4
  72. package/src/tasks/{bundle → publish/bundle}/builder/webpack.config.js +2 -0
  73. package/src/tasks/{bundle → publish/bundle}/index.js +2 -2
  74. package/src/tasks/publish/index.js +1 -14
  75. package/src/util.js +6 -11
  76. package/src/auth.js +0 -573
  77. package/src/tasks/build/helper.js +0 -123
  78. package/src/tasks/build/index.js +0 -54
  79. package/src/tasks/create/templates/Constellation/Field/Boolean/mock.stories.js.mustache +0 -21
  80. package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +0 -61
  81. package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +0 -41
  82. package/src/tasks/create/templates/Constellation/Field/Date/mock.stories.js.mustache +0 -23
  83. package/src/tasks/create/templates/Constellation/Field/DateTime/mock.stories.js.mustache +0 -23
  84. package/src/tasks/create/templates/Constellation/Field/Decimal/mock.stories.js.mustache +0 -21
  85. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.stories.js.mustache +0 -23
  86. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.stories.js.mustache +0 -21
  87. package/src/tasks/create/templates/Constellation/Field/Integer/mock.stories.js.mustache +0 -21
  88. package/src/tasks/create/templates/Constellation/Field/Picklist/mock.stories.js.mustache +0 -67
  89. package/src/tasks/create/templates/Constellation/Field/Text/mock.stories.js.mustache +0 -13
  90. package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.stories.js.mustache +0 -22
  91. package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.stories.js.mustache +0 -21
  92. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.stories.js.mustache +0 -20
  93. package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.stories.js.mustache +0 -37
  94. package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.stories.js.mustache +0 -22
  95. package/src/tasks/create/templates/Constellation/Field/TimeofDay/mock.stories.js.mustache +0 -20
  96. package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.jsx.mustache +0 -26
  97. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +0 -118
  98. package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.stories.js.mustache +0 -179
  99. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.jsx.mustache +0 -26
  100. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +0 -123
  101. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.stories.js.mustache +0 -215
  102. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +0 -93
  103. package/src/tasks/create/templates/Constellation/Template/FORM/mock.stories.js.mustache +0 -125
  104. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +0 -100
  105. package/src/tasks/create/templates/Constellation/Template/FORM-region/mock.stories.js.mustache +0 -131
  106. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.jsx.mustache +0 -101
  107. package/src/tasks/create/templates/Constellation/Template/PAGE/mock.stories.js.mustache +0 -94
  108. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.jsx.mustache +0 -78
  109. package/src/tasks/create/templates/Constellation/Widget/CASE/mock.stories.js.mustache +0 -390
  110. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.jsx.mustache +0 -30
  111. package/src/tasks/create/templates/Constellation/Widget/PAGE/mock.stories.js.mustache +0 -23
  112. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.jsx.mustache +0 -68
  113. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.stories.js.mustache +0 -51
  114. package/src/tasks/delete-all/helper.js +0 -175
  115. package/src/tasks/delete-all/index.js +0 -49
  116. package/src/tasks/init/template/.eslintignore +0 -8
  117. package/src/tasks/linter/index.js +0 -46
  118. package/src/tasks/publish-all/helper.js +0 -139
  119. package/src/tasks/publish-all/index.js +0 -84
  120. /package/src/tasks/{bundle → publish/bundle}/builder/index.js +0 -0
  121. /package/src/tasks/{bundle → publish/bundle}/builder/modules.js +0 -0
  122. /package/src/tasks/{bundle → publish/bundle}/builder/paths.js +0 -0
@@ -1,26 +0,0 @@
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
- }
@@ -1,118 +0,0 @@
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 renderField = resolvedProps => {
12
- const {
13
- displayAsStatus = false,
14
- displayMode,
15
- value = '',
16
- label = '',
17
- // eslint-disable-next-line react-hooks/rules-of-hooks
18
- theme = useTheme()
19
- } = resolvedProps;
20
-
21
- const variant = displayMode === 'LABELS_LEFT' ? 'inline' : 'stacked';
22
-
23
- let val =
24
- value !== '' ? (
25
- <Text variant='h1' as='span'>
26
- {value}
27
- </Text>
28
- ) : (
29
- ''
30
- );
31
-
32
- if (label === 'Create date/time')
33
- val = <DateTimeDisplay value={value} variant='datetime' format='long' clockFormat={null} />;
34
-
35
- if (displayAsStatus === true) val = <StatusWorkRenderer value={value} />;
36
-
37
- if (label === 'Create Operator')
38
- val = (
39
- <Button
40
- variant='link'
41
- style={
42
- label !== null
43
- ? { width: 'max-content', height: theme.components.input.height }
44
- : undefined
45
- }
46
- >
47
- {value.userName}
48
- </Button>
49
- );
50
-
51
- if (variant === 'inline') {
52
- val = value || <span aria-hidden='true'>&ndash;&ndash;</span>;
53
- } else {
54
- val = (
55
- <Text variant='h1' as='span'>
56
- {val}
57
- </Text>
58
- );
59
- }
60
- return <FieldValueList variant={variant} fields={[{ name: label, value: val }]} />;
61
- };
62
-
63
- export const base{{COMPONENT_CLASS_NAME}} = () => {
64
- const props = {
65
- template: 'MyCo_MyComponents_NewDetailsTemplate',
66
- showHighlightedData: true,
67
- label: 'Test Details',
68
- showLabel: true,
69
- getPConnect: () => {
70
- return {
71
- getChildren: () => {
72
- return pyReviewRaw.children;
73
- },
74
- getRawMetadata: () => {
75
- return pyReviewRaw;
76
- },
77
- getInheritedProps: () => {
78
- return pyReviewRaw.config.inheritedProps;
79
- },
80
- createComponent: config => {
81
- // eslint-disable-next-line default-case
82
- switch (config.config.value) {
83
- case '@P .pyStatusWork':
84
- return renderField(pyReviewResolved.highlightedData[0].config);
85
- case '@P .pyID':
86
- return renderField(pyReviewResolved.highlightedData[1].config);
87
- case '@P .pxCreateDateTime':
88
- return renderField(pyReviewResolved.highlightedData[2].config);
89
- case '@USER .pxCreateOperator':
90
- return renderField(pyReviewResolved.highlightedData[3].config);
91
- case '@P .pySLADeadline':
92
- return renderField(regionChildrenResolved[0]);
93
- case '@P .pySLAGoal':
94
- return renderField(regionChildrenResolved[1]);
95
- case '@P .pySLAStartTime':
96
- return renderField(regionChildrenResolved[2]);
97
- }
98
- },
99
- setInheritedProp: () => {
100
- /* nothing */
101
- },
102
- resolveConfigProps: () => {
103
- /* nothing */
104
- }
105
- };
106
- }
107
- };
108
-
109
- const regionAChildren = pyReviewRaw.children[0].children.map(child => {
110
- return props.getPConnect().createComponent(child);
111
- });
112
-
113
- return (
114
- <>
115
- <{{COMPONENT_CLASS_NAME}} {...props}>{regionAChildren}</{{COMPONENT_CLASS_NAME}}>
116
- </>
117
- );
118
- };
@@ -1,179 +0,0 @@
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,26 +0,0 @@
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
- }
@@ -1,123 +0,0 @@
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 renderField = resolvedProps => {
12
- const {
13
- displayAsStatus = false,
14
- displayMode,
15
- value = '',
16
- label = '',
17
- // eslint-disable-next-line react-hooks/rules-of-hooks
18
- theme = useTheme()
19
- } = resolvedProps;
20
-
21
- const variant = displayMode === 'LABELS_LEFT' ? 'inline' : 'stacked';
22
-
23
- let val =
24
- value !== '' ? (
25
- <Text variant='h1' as='span'>
26
- {value}
27
- </Text>
28
- ) : (
29
- ''
30
- );
31
-
32
- if (label === 'Create date/time')
33
- val = <DateTimeDisplay value={value} variant='datetime' format='long' clockFormat={null} />;
34
-
35
- if (displayAsStatus === true) val = <StatusWorkRenderer value={value} />;
36
-
37
- if (label === 'Create Operator')
38
- val = (
39
- <Button
40
- variant='link'
41
- style={
42
- label !== null
43
- ? { width: 'max-content', height: theme.components.input.height }
44
- : undefined
45
- }
46
- >
47
- {value.userName}
48
- </Button>
49
- );
50
-
51
- if (variant === 'inline') {
52
- val = value || <span aria-hidden='true'>&ndash;&ndash;</span>;
53
- } else {
54
- val = (
55
- <Text variant='h1' as='span'>
56
- {val}
57
- </Text>
58
- );
59
- }
60
- return <FieldValueList variant={variant} fields={[{ name: label, value: val }]} />;
61
- };
62
-
63
-
64
- export const base{{COMPONENT_CLASS_NAME}} = () => {
65
- const props = {
66
- template: 'MyCo_MyComponents_NewDetailsTemplate',
67
- showHighlightedData: true,
68
- label: 'Test Details',
69
- showLabel: true,
70
- getPConnect: () => {
71
- return {
72
- getChildren: () => {
73
- return pyReviewRaw.children;
74
- },
75
- getRawMetadata: () => {
76
- return pyReviewRaw;
77
- },
78
- getInheritedProps: () => {
79
- return pyReviewRaw.config.inheritedProps;
80
- },
81
- createComponent: config => {
82
- // eslint-disable-next-line default-case
83
- switch (config.config.value) {
84
- case '@P .pyStatusWork':
85
- return renderField(pyReviewResolved.highlightedData[0].config);
86
- case '@P .pyID':
87
- return renderField(pyReviewResolved.highlightedData[1].config);
88
- case '@P .pxCreateDateTime':
89
- return renderField(pyReviewResolved.highlightedData[2].config);
90
- case '@USER .pxCreateOperator':
91
- return renderField(pyReviewResolved.highlightedData[3].config);
92
- case '@P .pySLADeadline':
93
- return renderField(regionChildrenResolved[0]);
94
- case '@P .pySLAGoal':
95
- return renderField(regionChildrenResolved[1]);
96
- case '@P .pySLAStartTime':
97
- return renderField(regionChildrenResolved[2]);
98
- }
99
- },
100
- setInheritedProp: () => {
101
- /* nothing */
102
- },
103
- resolveConfigProps: () => {
104
- /* nothing */
105
- }
106
- };
107
- }
108
- };
109
-
110
- const regionAChildren = pyReviewRaw.children[0].children.map(child => {
111
- return props.getPConnect().createComponent(child);
112
- });
113
- const regionBChildren = pyReviewRaw.children[1].children.map(child => {
114
- return props.getPConnect().createComponent(child);
115
- });
116
-
117
- return (
118
- <{{COMPONENT_CLASS_NAME}} {...props}>
119
- {regionAChildren}
120
- {regionBChildren}
121
- </{{COMPONENT_CLASS_NAME}}>
122
- );
123
- };
@@ -1,215 +0,0 @@
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
- ];