@pega/custom-dx-components 25.1.13 → 26.1.10-alpha-0.1

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 (81) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/cli.js +7 -1
  4. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +7 -0
  5. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +7 -7
  6. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +7 -0
  7. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +16 -12
  8. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +7 -0
  9. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +1 -1
  10. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +7 -0
  11. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +15 -5
  12. package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +1 -1
  13. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +7 -0
  14. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +7 -0
  15. package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +5 -5
  16. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +7 -0
  17. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +6 -6
  18. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +7 -0
  19. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +6 -6
  20. package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.tsx.mustache +7 -0
  21. package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +5 -5
  22. package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +7 -0
  23. package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +6 -6
  24. package/src/tasks/export-rc/helper.js +356 -0
  25. package/src/tasks/export-rc/index.js +268 -0
  26. package/src/tasks/index.js +1 -0
  27. package/src/tasks/init/template/README.md +1 -1
  28. package/src/tasks/init/template/package.json.mustache +15 -15
  29. package/src/tasks/list-pub/index.js +1 -1
  30. package/src/util.js +15 -4
  31. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +7 -0
  32. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +5 -5
  33. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +7 -0
  34. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +7 -7
  35. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +1 -1
  36. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +7 -0
  37. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +7 -0
  38. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +6 -6
  39. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +7 -0
  40. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +16 -12
  41. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +7 -0
  42. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +15 -5
  43. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +7 -0
  44. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
  45. package/tests/assets/original/components/create/shared/PConnProps.d.ts +46 -0
  46. package/tests/assets/original/components/create/shared/create-nonce.ts +5 -0
  47. package/tests/assets/original/components/create/shared/suggestions-handler.ts +9 -0
  48. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +7 -0
  49. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +5 -5
  50. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +7 -0
  51. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +7 -7
  52. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +1 -1
  53. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +7 -0
  54. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +7 -0
  55. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +6 -6
  56. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +7 -0
  57. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +16 -12
  58. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +7 -0
  59. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +15 -5
  60. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +7 -0
  61. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
  62. package/tests/assets/original/components/createAll/Constellation/shared/PConnProps.d.ts +46 -0
  63. package/tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts +5 -0
  64. package/tests/assets/original/components/createAll/Constellation/shared/suggestions-handler.ts +9 -0
  65. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.stories.tsx +7 -0
  66. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/index.tsx +5 -5
  67. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +7 -0
  68. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/index.tsx +6 -6
  69. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +1 -1
  70. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +7 -0
  71. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +7 -0
  72. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +6 -6
  73. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.tsx +7 -0
  74. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +16 -12
  75. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +7 -0
  76. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/index.tsx +15 -5
  77. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.stories.tsx +7 -0
  78. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +1 -1
  79. package/tests/assets/original/components/createAll/Launchpad/shared/PConnProps.d.ts +46 -0
  80. package/tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts +5 -0
  81. package/tests/assets/original/components/createAll/Launchpad/shared/suggestions-handler.ts +9 -0
package/README.md CHANGED
@@ -33,7 +33,7 @@ For more info [here](https://pega-dev.zoominsoftware.io/bundle/constellation-dx-
33
33
 
34
34
  Ensure you have access to the following in your system:
35
35
 
36
- - Pega Infinity Server version 25.1 or later
36
+ - Pega Infinity Server version 26.1 or later
37
37
 
38
38
  - Git version 2.30 or later
39
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "25.1.13",
3
+ "version": "26.1.10-alpha-0.1",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "keywords": [
package/src/cli.js CHANGED
@@ -19,6 +19,7 @@ import {
19
19
  deleteVersion,
20
20
  importArchive,
21
21
  exportArchive,
22
+ exportRC,
22
23
  importComponent,
23
24
  initProject,
24
25
  listComponents,
@@ -84,6 +85,7 @@ const TASKS = {
84
85
  DELETE_VERSION: 'deleteVersion',
85
86
  IMPORT_ARCHIVE: 'importArchive',
86
87
  EXPORT_ARCHIVE: 'exportArchive',
88
+ EXPORT_RC: 'exportRC',
87
89
  IMPORT_COMP: 'importComponent',
88
90
  AUTHENTICATE: 'authenticate',
89
91
  UPGRADE: 'upgrade',
@@ -234,6 +236,10 @@ export default async (args = []) => {
234
236
  exportArchive(options);
235
237
  break;
236
238
  }
239
+ case TASKS.EXPORT_RC: {
240
+ exportRC(options);
241
+ break;
242
+ }
237
243
  case TASKS.IMPORT_COMP: {
238
244
  importComponent(options);
239
245
  break;
@@ -287,4 +293,4 @@ export default async (args = []) => {
287
293
  break;
288
294
  }
289
295
  }
290
- };
296
+ }
@@ -62,6 +62,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
62
62
  getContextName: () => {
63
63
  return 'app/primary_1';
64
64
  },
65
+ getLocalizationService:() => {
66
+ return {
67
+ getLocalizedText: (value: any) => {
68
+ return value;
69
+ }
70
+ }
71
+ },
65
72
  getLocalizedValue: (value: any) => {
66
73
  return value;
67
74
  },
@@ -78,8 +78,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
78
78
 
79
79
  // setting up columns for the work list table
80
80
  const columns = [
81
- { renderer: 'stateName', label: PConnect.getLocalizedValue('State name', '', '') },
82
- { renderer: 'stateCode', label: PConnect.getLocalizedValue('State code', '', '') }
81
+ { renderer: 'stateName', label: PConnect.getLocalizationService().getLocalizedText('State name') },
82
+ { renderer: 'stateCode', label: PConnect.getLocalizationService().getLocalizedText('State code') }
83
83
  ];
84
84
 
85
85
  // toggle showing table and getting table data
@@ -172,12 +172,12 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
172
172
  />
173
173
  <Label style={{ margin: '0.1rem' }}>
174
174
  {' '}
175
- {PConnect.getLocalizedValue('State list for', '', '')}{' '}
176
- {PConnect.getLocalizedValue(`${countryCode}`, '', '')}{' '}
175
+ {PConnect.getLocalizationService().getLocalizedText('State list for')}{' '}
176
+ {PConnect.getLocalizationService().getLocalizedText(`${countryCode}`)}{' '}
177
177
  </Label>
178
178
  <Button
179
179
  icon
180
- label={PConnect.getLocalizedValue('Click to show/hide state list', '', '')}
180
+ label={PConnect.getLocalizationService().getLocalizedText('Click to show/hide state list')}
181
181
  variant='link'
182
182
  compact={false}
183
183
  onClick={showHideTable}
@@ -202,11 +202,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
202
202
  </div>
203
203
  {showTable && (
204
204
  <Table
205
- title={PConnect.getLocalizedValue('State list', '', '')}
205
+ title={PConnect.getLocalizationService().getLocalizedText('State list')}
206
206
  columns={columns}
207
207
  data={statelist}
208
208
  loading={isLoading}
209
- loadingMessage={PConnect.getLocalizedValue('Loading state list', '', '')}
209
+ loadingMessage={PConnect.getLocalizationService().getLocalizedText('Loading state list')}
210
210
  />
211
211
  )}
212
212
  <%={{ }}=%> {{! revert delimiters for mustache }}
@@ -31,6 +31,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
31
31
  getStateProps: () => {
32
32
  return stateProps;
33
33
  },
34
+ getLocalizationService:() => {
35
+ return {
36
+ getLocalizedText: (value: any) => {
37
+ return value;
38
+ }
39
+ }
40
+ },
34
41
  getLocalizedValue: (val: any) => {
35
42
  return val;
36
43
  },
@@ -94,7 +94,7 @@ const pushPlaceholderOption = (placeholder: string, listSourceItems: Array<any>,
94
94
  if (placeholder) {
95
95
  items.push(
96
96
  <Option key={placeholder} value=''>
97
- {pConnect.getLocalizedValue(placeholder)}
97
+ {pConnect.getLocalizationService().getLocalizedText(placeholder)}
98
98
  </Option>
99
99
  );
100
100
  } else if (!listSourceItems) {
@@ -167,6 +167,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
167
167
  const configProps = pConnect.getConfigProps();
168
168
  const items: Array<any> = [];
169
169
  const isDatapage = listType === 'datapage';
170
+ const isDatapageLocale = localeContext === 'datapage';
171
+
170
172
  let listSourceItems = isDatapage ? configProps.listOutput : datasource;
171
173
 
172
174
  if (isDatapage && typeof datasource === 'object' && !Array.isArray(listSourceItems)) {
@@ -202,17 +204,19 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
202
204
  items.push(
203
205
  // @ts-ignore
204
206
  <Option key={item.key} value={item.key}>
205
- {isDatapage
206
- ? pConnect.getLocalizedValue(
207
- item.text,
208
- localePath,
209
- pConnect.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
210
- )
211
- : pConnect.getLocalizedValue(
212
- item.value,
213
- localePath,
214
- pConnect.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
215
- )}
207
+ {isDatapageLocale
208
+ ? pConnect
209
+ .getLocalizationService()
210
+ .getLocalizedDataPage(
211
+ item.value ? item.value.toString() : '',
212
+ localeName,
213
+ localePath
214
+ )
215
+ : pConnect
216
+ .getLocalizationService(
217
+ pConnect.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
218
+ )
219
+ .getLocalizedText(item.value ? item.value.toString() : '')}
216
220
  </Option>
217
221
  );
218
222
  });
@@ -38,6 +38,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
38
38
  getContextName: () => {
39
39
  return 'app/primary_1';
40
40
  },
41
+ getLocalizationService:() => {
42
+ return {
43
+ getLocalizedText: (value: any) => {
44
+ return value;
45
+ }
46
+ }
47
+ },
41
48
  getLocalizedValue: (val: any) => {
42
49
  return val;
43
50
  },
@@ -1128,7 +1128,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1128
1128
  selected: item.items ? undefined : !!item.selected || item.id === selected?.id
1129
1129
  })),
1130
1130
  onItemClick: selectItem,
1131
- emptyText: pConn.getLocalizedValue('No items'),
1131
+ emptyText: pConn.getLocalizationService().getLocalizedText('No items'),
1132
1132
  loading,
1133
1133
  loadMore,
1134
1134
  footer: createNewRecord ? (
@@ -34,6 +34,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
34
34
  getPageReference: () => {
35
35
  return 'caseInfo.content';
36
36
  },
37
+ getLocalizationService:() => {
38
+ return {
39
+ getLocalizedText: (value: any) => {
40
+ return value;
41
+ }
42
+ }
43
+ },
37
44
  getLocalizedValue: (val: any) => {
38
45
  return val;
39
46
  },
@@ -106,6 +106,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
106
106
 
107
107
  const items: Array<any> = [];
108
108
  const isDatapage = listType === 'datapage';
109
+ const isDatapageLocale = localeContext === 'datapage';
110
+
109
111
  const listSource = isDatapage ? configProps.listOutput : datasource;
110
112
  let autoFocusProp = additionalProps?.autoFocus
111
113
  ? {
@@ -138,11 +140,19 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
138
140
  id={`${fullReference}.${item.key}`}
139
141
  value={item.key}
140
142
  key={`${fullReference}.${item.key}`}
141
- label={pConn.getLocalizedValue(
142
- isDatapage ? item.text : item.value,
143
- localePath,
144
- pConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
145
- )}
143
+ label={isDatapageLocale
144
+ ? pConn
145
+ .getLocalizationService()
146
+ .getLocalizedDataPage(
147
+ item.value ? item.value.toString() : '',
148
+ localeName,
149
+ localePath
150
+ )
151
+ : pConn
152
+ .getLocalizationService(
153
+ pConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
154
+ )
155
+ .getLocalizedText(item.value ? item.value.toString() : '')}
146
156
  name={fullReference}
147
157
  />
148
158
  );
@@ -38,7 +38,7 @@ export default function GetNextWork(props: {{COMPONENT_CLASS_NAME}}WorkProps) {
38
38
 
39
39
  return (
40
40
  <Button variant={variant} onClick={getNextWork}>
41
- {getPConnect().getLocalizedValue('Get next work', '', '')}
41
+ {getPConnect().getLocalizationService().getLocalizedText('Get next work')}
42
42
  </Button>
43
43
  );
44
44
  }
@@ -61,6 +61,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
61
61
  getComponentName: () => {
62
62
  return '';
63
63
  },
64
+ getLocalizationService:() => {
65
+ return {
66
+ getLocalizedText: (value: any) => {
67
+ return value;
68
+ }
69
+ }
70
+ },
64
71
  getLocalizedValue: (value: any) => {
65
72
  return value;
66
73
  },
@@ -56,6 +56,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
56
56
  getContextName: () => {
57
57
  return 'app/primary_1';
58
58
  },
59
+ getLocalizationService:() => {
60
+ return {
61
+ getLocalizedText: (value: any) => {
62
+ return value;
63
+ }
64
+ }
65
+ },
59
66
  getLocalizedValue: (value: any) => {
60
67
  return value;
61
68
  },
@@ -26,9 +26,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
26
26
  const context = pConn.getContextName();
27
27
 
28
28
  const columns = [
29
- { renderer: 'date', label: pConn.getLocalizedValue('Date', '', '') },
30
- { renderer: 'description', label: pConn.getLocalizedValue('Description', '', '') },
31
- { renderer: 'user', label: pConn.getLocalizedValue('Performed by', '','') }
29
+ { renderer: 'date', label: pConn.getLocalizationService().getLocalizedText('Date') },
30
+ { renderer: 'description', label: pConn.getLocalizationService().getLocalizedText('Description') },
31
+ { renderer: 'user', label: pConn.getLocalizationService().getLocalizedText('Performed by') }
32
32
  ];
33
33
 
34
34
  useEffect(() => {
@@ -63,11 +63,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
63
63
  return (
64
64
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
65
65
  <Table
66
- title={pConn.getLocalizedValue(label, '', '')}
66
+ title={pConn.getLocalizationService().getLocalizedText(label)}
67
67
  columns={columns}
68
68
  data={history}
69
69
  loading={isLoading}
70
- loadingMessage={pConn.getLocalizedValue('Loading case history', '', '')}
70
+ loadingMessage={pConn.getLocalizationService().getLocalizedText('Loading case history')}
71
71
  />
72
72
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
73
73
  );
@@ -74,6 +74,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
74
74
  getContextName: () => {
75
75
  return 'app/primary_1';
76
76
  },
77
+ getLocalizationService:() => {
78
+ return {
79
+ getLocalizedText: (value: any) => {
80
+ return value;
81
+ }
82
+ }
83
+ },
77
84
  getLocalizedValue: (value: any) => {
78
85
  return value;
79
86
  },
@@ -36,10 +36,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
36
36
 
37
37
  // setting up columns for the work list table
38
38
  const columns = [
39
- { renderer: 'caseType', label: PConnect.getLocalizedValue('Case type', '', '') },
40
- { renderer: 'insKey', label: PConnect.getLocalizedValue('Key', '', '') },
41
- { renderer: 'status', label: PConnect.getLocalizedValue('Status', '', '') },
42
- { renderer: 'stage', label: PConnect.getLocalizedValue('Stage', '', '') }
39
+ { renderer: 'caseType', label: PConnect.getLocalizationService().getLocalizedText('Case type') },
40
+ { renderer: 'insKey', label: PConnect.getLocalizationService().getLocalizedText('Key') },
41
+ { renderer: 'status', label: PConnect.getLocalizationService().getLocalizedText('Status') },
42
+ { renderer: 'stage', label: PConnect.getLocalizationService().getLocalizedText('Stage') }
43
43
  ];
44
44
 
45
45
  const myRef = useRef(null);
@@ -96,11 +96,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
96
96
  />
97
97
  <br />
98
98
  <Table
99
- title={PConnect.getLocalizedValue('Work list', '', '')}
99
+ title={PConnect.getLocalizationService().getLocalizedText('Work list')}
100
100
  columns={columns}
101
101
  data={worklist}
102
102
  loading={isLoading}
103
- loadingMessage={PConnect.getLocalizedValue('Loading Work list', '', '')}
103
+ loadingMessage={PConnect.getLocalizationService().getLocalizedText('Loading Work list')}
104
104
  />
105
105
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
106
106
  );
@@ -62,6 +62,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
62
62
  getContextName: () => {
63
63
  return 'app/primary_1';
64
64
  },
65
+ getLocalizationService:() => {
66
+ return {
67
+ getLocalizedText: (value: any) => {
68
+ return value;
69
+ }
70
+ }
71
+ },
65
72
  getLocalizedValue: (value: any) => {
66
73
  return value;
67
74
  },
@@ -75,8 +75,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
75
75
 
76
76
  // setting up columns for the work list table
77
77
  const columns = [
78
- { renderer: 'countryName', label: PConnect.getLocalizedValue('Country Name', '', '') },
79
- { renderer: 'shortName', label: PConnect.getLocalizedValue('Abbreviation', '', '') }
78
+ { renderer: 'countryName', label: PConnect.getLocalizationService().getLocalizedText('Country Name') },
79
+ { renderer: 'shortName', label: PConnect.getLocalizationService().getLocalizedText('Abbreviation') }
80
80
  ];
81
81
 
82
82
  // toggle showing table and getting table data
@@ -171,11 +171,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
171
171
  />
172
172
  <Label style={{ margin: '0.1rem' }}>
173
173
  {' '}
174
- {PConnect.getLocalizedValue('List of countries', '', '')}{' '}
174
+ {PConnect.getLocalizationService().getLocalizedText('List of countries')}{' '}
175
175
  </Label>
176
176
  <Button
177
177
  icon
178
- label={PConnect.getLocalizedValue('Click to show/hide country list', '', '')}
178
+ label={PConnect.getLocalizationService().getLocalizedText('Click to show/hide country list')}
179
179
  variant='link'
180
180
  compact={false}
181
181
  onClick={showHideTable}
@@ -200,11 +200,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
200
200
  </div>
201
201
  {showTable && (
202
202
  <Table
203
- title={PConnect.getLocalizedValue('State list', '', '')}
203
+ title={PConnect.getLocalizationService().getLocalizedText('State list')}
204
204
  columns={columns}
205
205
  data={countrylist}
206
206
  loading={isLoading}
207
- loadingMessage={PConnect.getLocalizedValue('Loading country list', '', '')}
207
+ loadingMessage={PConnect.getLocalizationService().getLocalizedText('Loading country list')}
208
208
  />
209
209
  )}
210
210
  <%={{ }}=%> {{! revert delimiters for mustache }}
@@ -58,6 +58,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
58
58
  getContextName: () => {
59
59
  return 'app/primary_1';
60
60
  },
61
+ getLocalizationService:() => {
62
+ return {
63
+ getLocalizedText: (value: any) => {
64
+ return value;
65
+ }
66
+ }
67
+ },
61
68
  getLocalizedValue: (value: any) => {
62
69
  return value;
63
70
  },
@@ -24,9 +24,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
24
24
  const context = pConn.getContextName();
25
25
 
26
26
  const columns = [
27
- { renderer: 'date', label: pConn.getLocalizedValue('Date', '', '') },
28
- { renderer: 'description', label: pConn.getLocalizedValue('Description', '', '') },
29
- { renderer: 'user', label: pConn.getLocalizedValue('Performed by', '','') }
27
+ { renderer: 'date', label: pConn.getLocalizationService().getLocalizedText('Date') },
28
+ { renderer: 'description', label: pConn.getLocalizationService().getLocalizedText('Description') },
29
+ { renderer: 'user', label: pConn.getLocalizationService().getLocalizedText('Performed by') }
30
30
  ];
31
31
 
32
32
  useEffect(() => {
@@ -61,11 +61,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
61
61
  return (
62
62
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
63
63
  <Table
64
- title={pConn.getLocalizedValue(label, '', '')}
64
+ title={pConn.getLocalizationService().getLocalizedText(label)}
65
65
  columns={columns}
66
66
  data={history}
67
67
  loading={isLoading}
68
- loadingMessage={pConn.getLocalizedValue('Loading case history', '', '')}
68
+ loadingMessage={pConn.getLocalizationService().getLocalizedText('Loading case history')}
69
69
  />
70
70
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
71
71
  );
@@ -76,6 +76,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
76
76
  getContextName: () => {
77
77
  return 'app/primary_1';
78
78
  },
79
+ getLocalizationService:() => {
80
+ return {
81
+ getLocalizedText: (value: any) => {
82
+ return value;
83
+ }
84
+ }
85
+ },
79
86
  getLocalizedValue: (value: any) => {
80
87
  return value;
81
88
  },
@@ -36,10 +36,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
36
36
 
37
37
  // setting up columns for the work list table
38
38
  const columns = [
39
- { renderer: 'caseType', label: PConnect.getLocalizedValue('Case type', '', '') },
40
- { renderer: 'insKey', label: PConnect.getLocalizedValue('Key', '', '') },
41
- { renderer: 'status', label: PConnect.getLocalizedValue('Status', '', '') },
42
- { renderer: 'stage', label: PConnect.getLocalizedValue('Stage', '', '') }
39
+ { renderer: 'caseType', label: PConnect.getLocalizationService().getLocalizedText('Case type') },
40
+ { renderer: 'insKey', label: PConnect.getLocalizationService().getLocalizedText('Key') },
41
+ { renderer: 'status', label: PConnect.getLocalizationService().getLocalizedText('Status') },
42
+ { renderer: 'stage', label: PConnect.getLocalizationService().getLocalizedText('Stage') }
43
43
  ];
44
44
 
45
45
  // going to get data for worklist to put into a table
@@ -93,11 +93,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
93
93
  />
94
94
  <br />
95
95
  <Table
96
- title={PConnect.getLocalizedValue('Work list', '', '')}
96
+ title={PConnect.getLocalizationService().getLocalizedText('Work list')}
97
97
  columns={columns}
98
98
  data={worklist}
99
99
  loading={isLoading}
100
- loadingMessage={PConnect.getLocalizedValue('Loading Work list', '', '')}
100
+ loadingMessage={PConnect.getLocalizationService().getLocalizedText('Loading Work list')}
101
101
  />
102
102
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
103
103
  );