@pega/dx-component-builder-sdk 0.23.16 → 0.23.18

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 (154) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -2
  3. package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +8 -1
  4. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +3 -9
  5. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +7 -15
  6. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +38 -37
  7. package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +3 -3
  8. package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +5 -3
  9. package/src/tasks/map/map.js +29 -8
  10. package/src/tasks/publish/index.js +3 -1
  11. package/src/tasks/publish-all/index.js +7 -5
  12. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
  13. package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
  14. package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
  15. package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +7 -15
  16. package/tests/assets/sdk-r/components/create/override-sdk/field/DateTime/config-ext.json +8 -8
  17. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +3 -9
  18. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/config-ext.json +8 -8
  19. package/tests/assets/sdk-r/components/create/override-sdk/field/Dropdown/config-ext.json +8 -8
  20. package/tests/assets/sdk-r/components/create/override-sdk/field/Email/config-ext.json +8 -8
  21. package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +2 -0
  22. package/tests/assets/sdk-r/components/create/override-sdk/field/Group/config-ext.json +7 -7
  23. package/tests/assets/sdk-r/components/create/override-sdk/field/Integer/config-ext.json +8 -8
  24. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +38 -36
  25. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/config-ext.json +8 -8
  26. package/tests/assets/sdk-r/components/create/override-sdk/field/RadioButtons/config-ext.json +8 -8
  27. package/tests/assets/sdk-r/components/create/override-sdk/field/SemanticLink/config-ext.json +8 -8
  28. package/tests/assets/sdk-r/components/create/override-sdk/field/TextArea/config-ext.json +8 -8
  29. package/tests/assets/sdk-r/components/create/override-sdk/field/TextContent/config-ext.json +8 -8
  30. package/tests/assets/sdk-r/components/create/override-sdk/field/TextInput/config-ext.json +8 -8
  31. package/tests/assets/sdk-r/components/create/override-sdk/field/Time/config-ext.json +8 -8
  32. package/tests/assets/sdk-r/components/create/override-sdk/field/URL/config-ext.json +8 -8
  33. package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/config-ext.json +8 -8
  34. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +21 -7
  35. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +5 -3
  36. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
  37. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/config-ext.json +8 -8
  38. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +1 -1
  39. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/config-ext.json +8 -8
  40. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
  41. package/tests/assets/sdk-r/components/create/override-sdk/template/Confirmation/config-ext.json +11 -11
  42. package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/config-ext.json +9 -9
  43. package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/config-ext.json +8 -8
  44. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsSubTabs/config-ext.json +8 -8
  45. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsThreeColumn/config-ext.json +8 -8
  46. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsTwoColumn/config-ext.json +8 -8
  47. package/tests/assets/sdk-r/components/create/override-sdk/template/ListPage/config-ext.json +7 -7
  48. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/config-ext.json +8 -8
  49. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +3 -1
  50. package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideDetails/config-ext.json +8 -8
  51. package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideForm/config-ext.json +8 -8
  52. package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWidePage/config-ext.json +8 -8
  53. package/tests/assets/sdk-r/components/create/override-sdk/template/OneColumn/config-ext.json +8 -8
  54. package/tests/assets/sdk-r/components/create/override-sdk/template/OneColumnPage/config-ext.json +8 -8
  55. package/tests/assets/sdk-r/components/create/override-sdk/template/OneColumnTab/config-ext.json +8 -8
  56. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTable/config-ext.json +8 -8
  57. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +28 -12
  58. package/tests/assets/sdk-r/components/create/override-sdk/template/SubTabs/config-ext.json +8 -8
  59. package/tests/assets/sdk-r/components/create/override-sdk/template/TwoColumn/config-ext.json +8 -8
  60. package/tests/assets/sdk-r/components/create/override-sdk/template/TwoColumnPage/config-ext.json +8 -8
  61. package/tests/assets/sdk-r/components/create/override-sdk/template/TwoColumnTab/config-ext.json +8 -8
  62. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
  63. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowDetails/config-ext.json +8 -8
  64. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowForm/config-ext.json +8 -8
  65. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowPage/config-ext.json +8 -8
  66. package/tests/assets/sdk-r/components/create/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
  67. package/tests/assets/sdk-r/components/create/override-sdk/widget/AppAnnouncement/config-ext.json +8 -8
  68. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +17 -3
  69. package/tests/assets/sdk-r/components/create/override-sdk/widget/CaseHistory/config-ext.json +8 -8
  70. package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/config-ext.json +8 -8
  71. package/tests/assets/sdk-r/components/create/override-sdk/widget/Followers/config-ext.json +8 -8
  72. package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
  73. package/tests/assets/sdk-r/components/create/override-sdk/widget/ToDo/config-ext.json +8 -8
  74. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
  75. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +7 -15
  76. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +8 -1
  77. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +3 -9
  78. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +38 -37
  79. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
  80. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +5 -3
  81. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
  82. package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
  83. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
  84. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +7 -15
  85. package/tests/assets/sdk-r/components/createAll/override-sdk/field/DateTime/config-ext.json +8 -8
  86. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +3 -9
  87. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/config-ext.json +8 -8
  88. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Dropdown/config-ext.json +8 -8
  89. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Email/config-ext.json +8 -8
  90. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +2 -0
  91. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/config-ext.json +7 -7
  92. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Integer/config-ext.json +8 -8
  93. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +38 -36
  94. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/config-ext.json +8 -8
  95. package/tests/assets/sdk-r/components/createAll/override-sdk/field/RadioButtons/config-ext.json +8 -8
  96. package/tests/assets/sdk-r/components/createAll/override-sdk/field/SemanticLink/config-ext.json +8 -8
  97. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextArea/config-ext.json +8 -8
  98. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextContent/config-ext.json +8 -8
  99. package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextInput/config-ext.json +8 -8
  100. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Time/config-ext.json +8 -8
  101. package/tests/assets/sdk-r/components/createAll/override-sdk/field/URL/config-ext.json +8 -8
  102. package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/config-ext.json +8 -8
  103. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +21 -7
  104. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +5 -3
  105. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
  106. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/config-ext.json +8 -8
  107. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +1 -1
  108. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/config-ext.json +8 -8
  109. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
  110. package/tests/assets/sdk-r/components/createAll/override-sdk/template/Confirmation/config-ext.json +11 -11
  111. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/config-ext.json +9 -9
  112. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/config-ext.json +8 -8
  113. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsSubTabs/config-ext.json +8 -8
  114. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsThreeColumn/config-ext.json +8 -8
  115. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsTwoColumn/config-ext.json +8 -8
  116. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListPage/config-ext.json +7 -7
  117. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/config-ext.json +8 -8
  118. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +3 -1
  119. package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideDetails/config-ext.json +8 -8
  120. package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideForm/config-ext.json +8 -8
  121. package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWidePage/config-ext.json +8 -8
  122. package/tests/assets/sdk-r/components/createAll/override-sdk/template/OneColumn/config-ext.json +8 -8
  123. package/tests/assets/sdk-r/components/createAll/override-sdk/template/OneColumnPage/config-ext.json +8 -8
  124. package/tests/assets/sdk-r/components/createAll/override-sdk/template/OneColumnTab/config-ext.json +8 -8
  125. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTable/config-ext.json +8 -8
  126. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +28 -12
  127. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SubTabs/config-ext.json +8 -8
  128. package/tests/assets/sdk-r/components/createAll/override-sdk/template/TwoColumn/config-ext.json +8 -8
  129. package/tests/assets/sdk-r/components/createAll/override-sdk/template/TwoColumnPage/config-ext.json +8 -8
  130. package/tests/assets/sdk-r/components/createAll/override-sdk/template/TwoColumnTab/config-ext.json +8 -8
  131. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
  132. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowDetails/config-ext.json +8 -8
  133. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowForm/config-ext.json +8 -8
  134. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowPage/config-ext.json +8 -8
  135. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
  136. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/AppAnnouncement/config-ext.json +8 -8
  137. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +17 -3
  138. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/CaseHistory/config-ext.json +8 -8
  139. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/config-ext.json +8 -8
  140. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Followers/config-ext.json +8 -8
  141. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
  142. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/ToDo/config-ext.json +8 -8
  143. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/PConnProps.d.ts +0 -46
  144. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -54
  145. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +0 -73
  146. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/mock.ts +0 -15
  147. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/styles.ts +0 -15
  148. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/config.json +0 -83
  149. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -59
  150. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -101
  151. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +0 -16
  152. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/styles.js +0 -7
  153. /package/src/tasks/create/templates/Constellation/field/Boolean/{demo.stories.jsx.mustache → demo.stories.tsx.mustache} +0 -0
  154. /package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/{demo.stories.jsx → demo.stories.tsx} +0 -0
@@ -1,67 +1,55 @@
1
- import { TextField } from '@material-ui/core';
2
- import { makeStyles } from '@material-ui/core/styles';
1
+ import CurrencyTextField from '@unicef/material-ui-currency-textfield';
3
2
 
4
3
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
4
  import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
-
7
- // Inspired by https://stackoverflow.com/questions/50823182/material-ui-remove-up-down-arrow-dials-from-textview
8
- const useStyles = makeStyles((/* theme */) => ({
9
- input: {
10
- '& input[type=number]': {
11
- '-moz-appearance': 'textfield'
12
- },
13
- '& input[type=number]::-webkit-outer-spin-button': {
14
- '-webkit-appearance': 'none',
15
- margin: 0
16
- },
17
- '& input[type=number]::-webkit-inner-spin-button': {
18
- '-webkit-appearance': 'none',
19
- margin: 0
20
- }
21
- }
22
- }));
5
+ import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
6
+ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
7
+ import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
23
8
 
24
9
  interface PercentageProps extends PConnFieldProps {
25
10
  // If any, enter additional props that only exist on Percentage here
11
+ currencyISOCode?: string;
26
12
  }
27
13
 
28
14
  export default function Percentage(props: PercentageProps) {
29
15
  // Get emitted components from map (so we can get any override that may exist)
30
- const TextInput = getComponentFromMap('TextInput');
31
16
  const FieldValueList = getComponentFromMap('FieldValueList');
32
17
 
33
- const classes = useStyles();
34
-
35
18
  const {
19
+ getPConnect,
36
20
  label,
37
21
  required,
38
22
  disabled,
39
23
  value = '',
40
24
  validatemessage,
41
25
  status,
42
- onChange,
43
- onBlur,
26
+ // onChange,
27
+ // onBlur,
44
28
  readOnly,
29
+ currencyISOCode = 'USD',
45
30
  testId,
46
31
  helperText,
47
32
  displayMode,
48
33
  hideLabel,
49
34
  placeholder
50
35
  } = props;
36
+
37
+ const pConn = getPConnect();
38
+ const actions = pConn.getActionsApi();
39
+ const propName = (pConn.getStateProps() as any).value;
51
40
  const helperTextToDisplay = validatemessage || helperText;
52
41
 
42
+ const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
43
+ const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
44
+
53
45
  // console.log(`Percentage: label: ${label} value: ${value}`);
54
46
 
55
47
  if (displayMode === 'LABELS_LEFT') {
56
- return <FieldValueList name={hideLabel ? '' : label} value={value} />;
48
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
57
49
  }
58
50
 
59
51
  if (displayMode === 'STACKED_LARGE_VAL') {
60
- return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
61
- }
62
-
63
- if (readOnly) {
64
- return <TextInput {...props} />;
52
+ return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
65
53
  }
66
54
 
67
55
  let testProp = {};
@@ -70,9 +58,16 @@ export default function Percentage(props: PercentageProps) {
70
58
  'data-test-id': testId
71
59
  };
72
60
 
61
+ const theSymbols = getCurrencyCharacters(currencyISOCode);
62
+ const theCurrDec = theSymbols.theDecimalIndicator;
63
+ const theCurrSep = theSymbols.theDigitGroupSeparator;
64
+
65
+ function PercentageOnBlur(event, inValue) {
66
+ handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);
67
+ }
68
+
73
69
  return (
74
- <TextField
75
- className={classes.input}
70
+ <CurrencyTextField
76
71
  fullWidth
77
72
  variant={readOnly ? 'standard' : 'outlined'}
78
73
  helperText={helperTextToDisplay}
@@ -80,13 +75,20 @@ export default function Percentage(props: PercentageProps) {
80
75
  size='small'
81
76
  required={required}
82
77
  disabled={disabled}
83
- onChange={onChange}
84
- onBlur={!readOnly ? onBlur : undefined}
78
+ readOnly={!!readOnly}
85
79
  error={status === 'error'}
86
80
  label={label}
87
81
  value={value}
88
- type='number'
89
- inputProps={{ ...testProp }}
82
+ type='text'
83
+ outputFormat='number'
84
+ textAlign='left'
85
+ InputProps={{
86
+ inputProps: { ...testProp }
87
+ }}
88
+ currencySymbol=''
89
+ decimalCharacter={theCurrDec}
90
+ digitGroupSeparator={theCurrSep}
91
+ onBlur={!readOnly ? PercentageOnBlur : undefined}
90
92
  />
91
93
  );
92
94
  }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "Percentage",
3
- "name": "Percentage",
4
- "label": "Percentage",
5
- "description": "Percentage",
6
- "type": "Field",
7
- "subtype": "Decimal-Percentage",
8
- "properties": []
9
- }
2
+ "componentKey": "Percentage",
3
+ "name": "Percentage",
4
+ "label": "Percentage",
5
+ "description": "Percentage",
6
+ "type": "Field",
7
+ "subtype": "Decimal-Percentage",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "RadioButtons",
3
- "name": "RadioButtons",
4
- "label": "Radio buttons",
5
- "description": "Picklist",
6
- "type": "Field",
7
- "subtype": "Picklist",
8
- "properties": []
9
- }
2
+ "componentKey": "RadioButtons",
3
+ "name": "RadioButtons",
4
+ "label": "Radio buttons",
5
+ "description": "Picklist",
6
+ "type": "Field",
7
+ "subtype": "Picklist",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "label": "SemanticLink",
3
- "componentKey": "SemanticLink",
4
- "name": "SemanticLink",
5
- "description": "SemanticLink",
6
- "type": "Field",
7
- "subtype": "ACTION",
8
- "properties": []
9
- }
2
+ "label": "SemanticLink",
3
+ "componentKey": "SemanticLink",
4
+ "name": "SemanticLink",
5
+ "description": "SemanticLink",
6
+ "type": "Field",
7
+ "subtype": "ACTION",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "TextArea",
3
- "name": "TextArea",
4
- "label": "Text area",
5
- "description": "Text (paragraph)",
6
- "type": "Field",
7
- "subtype": "Text-Paragraph",
8
- "properties": []
9
- }
2
+ "componentKey": "TextArea",
3
+ "name": "TextArea",
4
+ "label": "Text area",
5
+ "description": "Text (paragraph)",
6
+ "type": "Field",
7
+ "subtype": "Text-Paragraph",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "label": "TextContent",
3
- "componentKey": "TextContent",
4
- "name": "TextContent",
5
- "description": "Text",
6
- "type": "Field",
7
- "subtype": "DATA_CAPTURE",
8
- "properties": []
9
- }
2
+ "label": "TextContent",
3
+ "componentKey": "TextContent",
4
+ "name": "TextContent",
5
+ "description": "Text",
6
+ "type": "Field",
7
+ "subtype": "DATA_CAPTURE",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "TextInput",
3
- "name": "TextInput",
4
- "label": "Text input",
5
- "description": "Text (single line)",
6
- "type": "Field",
7
- "subtype": "Text",
8
- "properties": []
9
- }
2
+ "componentKey": "TextInput",
3
+ "name": "TextInput",
4
+ "label": "Text input",
5
+ "description": "Text (single line)",
6
+ "type": "Field",
7
+ "subtype": "Text",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "Time",
3
- "name": "Time",
4
- "label": "Time only",
5
- "description": "Time only",
6
- "type": "Field",
7
- "subtype": "TimeOfDay",
8
- "properties": []
9
- }
2
+ "componentKey": "Time",
3
+ "name": "Time",
4
+ "label": "Time only",
5
+ "description": "Time only",
6
+ "type": "Field",
7
+ "subtype": "TimeOfDay",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "URL",
3
- "name": "URL",
4
- "label": "URL",
5
- "description": "URL",
6
- "type": "Field",
7
- "subtype": "Text-URL",
8
- "properties": []
9
- }
2
+ "componentKey": "URL",
3
+ "name": "URL",
4
+ "label": "URL",
5
+ "description": "URL",
6
+ "type": "Field",
7
+ "subtype": "Text-URL",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "label": "UserReference",
3
- "componentKey": "UserReference",
4
- "name": "UserReference",
5
- "description": "User reference",
6
- "type": "Field",
7
- "subtype": "DATA_CAPTURE",
8
- "properties": []
9
- }
2
+ "label": "UserReference",
3
+ "componentKey": "UserReference",
4
+ "name": "UserReference",
5
+ "description": "User reference",
6
+ "type": "Field",
7
+ "subtype": "DATA_CAPTURE",
8
+ "properties": []
9
+ }
@@ -70,6 +70,20 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
70
70
  return arIndicies;
71
71
  }
72
72
 
73
+ function getStepsInfo(steps, formedSteps: any = []) {
74
+ steps.forEach(step => {
75
+ if (step.name) {
76
+ step.name = PCore.getLocaleUtils().getLocaleValue(step.name, undefined, localeReference);
77
+ }
78
+ if (step.steps) {
79
+ formedSteps = getStepsInfo(step.steps, formedSteps);
80
+ } else {
81
+ formedSteps.push(step);
82
+ }
83
+ });
84
+ return formedSteps;
85
+ }
86
+
73
87
  useEffect(() => {
74
88
  if (children) {
75
89
  const firstChild = Array.isArray(children) ? children[0] : children;
@@ -97,13 +111,13 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
97
111
  } else {
98
112
  setIsVertical(false);
99
113
  }
100
- const steps = JSON.parse(JSON.stringify(oCaseInfo?.navigation?.steps));
101
- steps.forEach(step => {
102
- if (step.name) {
103
- step.name = PCore.getLocaleUtils().getLocaleValue(step.name, undefined, localeReference);
104
- }
105
- });
106
- setArNavigationSteps(steps);
114
+
115
+ if (oCaseInfo?.navigation?.steps) {
116
+ const steps = JSON.parse(JSON.stringify(oCaseInfo?.navigation?.steps));
117
+ const formedSteps = getStepsInfo(steps);
118
+ setArNavigationSteps(formedSteps);
119
+ }
120
+
107
121
  setArCurrentStepIndicies(findCurrentIndicies(arNavigationSteps, arCurrentStepIndicies, 0));
108
122
  }
109
123
  }
@@ -116,6 +116,8 @@ export default function NavBar(props: NavBarProps) {
116
116
  const [bShowCaseTypes, setBShowCaseTypes] = useState(true);
117
117
  const [bShowOperatorButtons, setBShowOperatorButtons] = useState(false);
118
118
  const [anchorEl, setAnchorEl] = useState(null);
119
+ const localeUtils = PCore.getLocaleUtils();
120
+ const localeReference = pConn.getValue('.pyLocaleReference');
119
121
 
120
122
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
121
123
  const localeCategory = 'AppShell';
@@ -231,7 +233,7 @@ export default function NavBar(props: NavBarProps) {
231
233
  <ListItemIcon>
232
234
  <WorkOutlineIcon fontSize='large' />
233
235
  </ListItemIcon>
234
- <ListItemText primary={caseType.pyLabel} />
236
+ <ListItemText primary={localeUtils.getLocaleValue(caseType.pyLabel, '', localeReference)} />
235
237
  </ListItem>
236
238
  ))}
237
239
  </List>
@@ -240,7 +242,7 @@ export default function NavBar(props: NavBarProps) {
240
242
  {navPages.map(page => (
241
243
  <ListItem button onClick={() => navPanelButtonClick(page)} key={page.pyLabel}>
242
244
  <ListItemIcon>{iconMap[page.pxPageViewIcon]}</ListItemIcon>
243
- <ListItemText primary={page.pyLabel} />
245
+ <ListItemText primary={localeUtils.getLocaleValue(page.pyLabel, '', localeReference)} />
244
246
  </ListItem>
245
247
  ))}
246
248
  </List>
@@ -278,7 +280,7 @@ export default function NavBar(props: NavBarProps) {
278
280
  <ListItemIcon>
279
281
  <ArrowBackIcon fontSize='large' />
280
282
  </ListItemIcon>
281
- <Typography variant='inherit'>{localizedVal('Logout', localeCategory)}</Typography>
283
+ <Typography variant='inherit'>{localizedVal('Log off', localeCategory)}</Typography>
282
284
  </MenuItem>
283
285
  </Menu>
284
286
  </>
@@ -17,7 +17,8 @@ export default function CaseSummary(props: PropsWithChildren<CaseSummaryProps>)
17
17
  // const { status, showStatus } = theConfigProps;
18
18
  const status = theConfigProps.status;
19
19
  const showStatus = theConfigProps.showStatus;
20
-
20
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
21
+ const localeCategory = 'ModalContainer';
21
22
  // from Constellation DX Components
22
23
  // get the primary and secondary fields with the raw data (which has the non-resolved property values)
23
24
  // const regionsRaw = getPConnect().getRawMetadata().children;
@@ -29,13 +30,54 @@ export default function CaseSummary(props: PropsWithChildren<CaseSummaryProps>)
29
30
  let arPrimaryFields: any[] = [];
30
31
  let arSecondaryFields: any[] = [];
31
32
 
33
+ /* eslint-disable @typescript-eslint/no-shadow */
34
+ function prepareComponentInCaseSummary(pConnectMeta, getPConnect) {
35
+ const { config, children } = pConnectMeta;
36
+ const pConnect = getPConnect();
37
+
38
+ const caseSummaryComponentObject: any = {};
39
+
40
+ const { type } = pConnectMeta;
41
+ const createdComponent = pConnect.createComponent({
42
+ type,
43
+ children: children ? [...children] : [],
44
+ config: {
45
+ ...config
46
+ }
47
+ });
48
+
49
+ caseSummaryComponentObject.value = createdComponent;
50
+ return caseSummaryComponentObject;
51
+ }
52
+
53
+ function prepareCaseSummaryData(summaryFieldChildren) {
54
+ const convertChildrenToSummaryData = kid => {
55
+ return kid?.map((childItem, index) => {
56
+ const childMeta = childItem.getPConnect().meta;
57
+ const caseSummaryComponentObject = prepareComponentInCaseSummary(childMeta, childItem.getPConnect);
58
+ caseSummaryComponentObject.id = index + 1;
59
+ return caseSummaryComponentObject;
60
+ });
61
+ };
62
+ return summaryFieldChildren ? convertChildrenToSummaryData(summaryFieldChildren?.getChildren()) : undefined;
63
+ }
64
+
32
65
  for (const child of children as ReactElement[]) {
33
66
  const childPConn = (child as ReactElement).props.getPConnect();
34
67
  const childPConnData = childPConn.resolveConfigProps(childPConn.getRawMetadata());
35
68
  if (childPConnData.name.toLowerCase() === 'primary fields') {
36
69
  arPrimaryFields = childPConnData.children;
70
+ arPrimaryFields.forEach(field => {
71
+ if (field.config?.value && typeof field.config?.value === 'string') {
72
+ field.config.value = localizedVal(field.config.value, localeCategory);
73
+ }
74
+ });
37
75
  } else if (childPConnData.name.toLowerCase() === 'secondary fields') {
76
+ const secondarySummaryFields = prepareCaseSummaryData(childPConn);
38
77
  arSecondaryFields = childPConnData.children;
78
+ arSecondaryFields.forEach((field, index) => {
79
+ field.config.displayLabel = secondarySummaryFields[index]?.value?.props?.label;
80
+ });
39
81
  }
40
82
  }
41
83
 
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "CaseSummary",
3
- "name": "CaseSummary",
4
- "label": "Summary data",
5
- "description": "Case summary template",
6
- "type": "Template",
7
- "subtype": "SUMMARY",
8
- "properties": []
9
- }
2
+ "componentKey": "CaseSummary",
3
+ "name": "CaseSummary",
4
+ "label": "Summary data",
5
+ "description": "Case summary template",
6
+ "type": "Template",
7
+ "subtype": "SUMMARY",
8
+ "properties": []
9
+ }
@@ -178,7 +178,7 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {
178
178
  const actionsAPI = thePConn.getActionsApi();
179
179
  const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);
180
180
 
181
- openLocalAction(editAction.ID, { ...editAction });
181
+ openLocalAction(editAction.ID, { ...editAction, containerName: 'modal', type: 'express' });
182
182
  }
183
183
 
184
184
  function getActionButtonsHtml(): any {
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "CaseView",
3
- "name": "CaseView",
4
- "label": "Object page",
5
- "description": "Standard case page",
6
- "type": "Template",
7
- "subtype": "CASEVIEW",
8
- "properties": []
9
- }
2
+ "componentKey": "CaseView",
3
+ "name": "CaseView",
4
+ "label": "Object page",
5
+ "description": "Standard case page",
6
+ "type": "Template",
7
+ "subtype": "CASEVIEW",
8
+ "properties": []
9
+ }
@@ -4,6 +4,9 @@ import Menu from '@material-ui/core/Menu';
4
4
  import MenuItem from '@material-ui/core/MenuItem';
5
5
 
6
6
  import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+ import Snackbar from '@material-ui/core/Snackbar';
8
+ import IconButton from '@material-ui/core/IconButton';
9
+ import CloseIcon from '@material-ui/icons/Close';
7
10
 
8
11
  interface CaseViewActionsMenuProps extends PConnProps {
9
12
  // If any, enter additional props that only exist on this component
@@ -23,6 +26,9 @@ export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
23
26
 
24
27
  const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
25
28
 
29
+ const [showSnackbar, setShowSnackbar] = useState(false);
30
+ const [snackbarMessage, setSnackbarMessage]: any = useState('');
31
+
26
32
  const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
27
33
  setAnchorEl(event.currentTarget);
28
34
  };
@@ -33,6 +39,18 @@ export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
33
39
 
34
40
  const arMenuItems: any[] = [];
35
41
 
42
+ function showToast(message: string) {
43
+ setSnackbarMessage(message);
44
+ setShowSnackbar(true);
45
+ }
46
+
47
+ function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {
48
+ if (reason === 'clickaway') {
49
+ return;
50
+ }
51
+ setShowSnackbar(false);
52
+ }
53
+
36
54
  function _actionMenuActionsClick(data) {
37
55
  const actionsAPI = thePConn.getActionsApi();
38
56
  const openLocalAction = actionsAPI.openLocalAction.bind(actionsAPI);
@@ -51,7 +69,11 @@ export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
51
69
  const openProcessAction = actionsAPI.openProcessAction.bind(actionsAPI);
52
70
  openProcessAction(process.ID, {
53
71
  ...process
54
- });
72
+ })
73
+ .then(() => {})
74
+ .catch(() => {
75
+ showToast(`${process.name} Submit failed!`);
76
+ });
55
77
  handleClose();
56
78
  }
57
79
 
@@ -79,6 +101,17 @@ export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
79
101
  <Menu id='simple-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
80
102
  {arMenuItems}
81
103
  </Menu>
104
+ <Snackbar
105
+ open={showSnackbar}
106
+ autoHideDuration={3000}
107
+ onClose={handleSnackbarClose}
108
+ message={snackbarMessage}
109
+ action={
110
+ <IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>
111
+ <CloseIcon fontSize='small' />
112
+ </IconButton>
113
+ }
114
+ />
82
115
  </>
83
116
  );
84
117
  }
@@ -1,12 +1,12 @@
1
1
  {
2
- "componentKey": "Confirmation",
3
- "name": "Confirmation",
4
- "label": "Confirmation",
5
- "description": "Confirmation template",
6
- "type": "Template",
7
- "subtype": "CASE",
8
- "icon": "confirm-view.svg",
9
- "hideTemplateEdit": true,
10
- "hideViewName": true,
11
- "properties": []
12
- }
2
+ "componentKey": "Confirmation",
3
+ "name": "Confirmation",
4
+ "label": "Confirmation",
5
+ "description": "Confirmation template",
6
+ "type": "Template",
7
+ "subtype": "CASE",
8
+ "icon": "confirm-view.svg",
9
+ "hideTemplateEdit": true,
10
+ "hideViewName": true,
11
+ "properties": []
12
+ }
@@ -1,10 +1,10 @@
1
1
  {
2
- "label": "DataReference",
3
- "componentKey": "DataReference",
4
- "name": "DataReference",
5
- "description": "Data Reference Template",
6
- "type": "Template",
7
- "icon": "DataReference.svg",
8
- "subtype": "DATAVIEW",
9
- "properties": []
10
- }
2
+ "label": "DataReference",
3
+ "componentKey": "DataReference",
4
+ "name": "DataReference",
5
+ "description": "Data Reference Template",
6
+ "type": "Template",
7
+ "icon": "DataReference.svg",
8
+ "subtype": "DATAVIEW",
9
+ "properties": []
10
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "DefaultForm",
3
- "name": "DefaultForm",
4
- "label": "Default form",
5
- "description": "DefaultForm Template",
6
- "type": "Template",
7
- "subtype": "FORM",
8
- "properties": []
9
- }
2
+ "componentKey": "DefaultForm",
3
+ "name": "DefaultForm",
4
+ "label": "Default form",
5
+ "description": "DefaultForm Template",
6
+ "type": "Template",
7
+ "subtype": "FORM",
8
+ "properties": []
9
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
- "componentKey": "DetailsSubTabs",
3
- "name": "DetailsSubTabs",
4
- "label": "Details (Sub tabs)",
5
- "description": "Details (Sub tabs)",
6
- "type": "Template",
7
- "subtype": "DETAILS",
8
- "properties": []
9
- }
2
+ "componentKey": "DetailsSubTabs",
3
+ "name": "DetailsSubTabs",
4
+ "label": "Details (Sub tabs)",
5
+ "description": "Details (Sub tabs)",
6
+ "type": "Template",
7
+ "subtype": "DETAILS",
8
+ "properties": []
9
+ }