@pega/custom-dx-components 25.1.14 → 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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/tasks/create/index.js +3 -11
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +7 -7
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +16 -12
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +15 -5
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +5 -5
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +6 -6
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +6 -6
- package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +5 -5
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +6 -6
- package/src/tasks/create-all/index.js +2 -11
- package/src/tasks/init/template/README.md +1 -1
- package/src/tasks/init/template/package.json.mustache +15 -16
- package/src/tasks/list-pub/index.js +1 -1
- package/src/util.js +6 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +7 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +5 -5
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +7 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +7 -7
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +7 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +7 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +6 -6
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +7 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +16 -12
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +7 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +15 -5
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +7 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
- package/tests/assets/original/components/create/shared/PConnProps.d.ts +46 -0
- package/tests/assets/original/components/create/shared/create-nonce.ts +5 -0
- package/tests/assets/original/components/create/shared/suggestions-handler.ts +9 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +5 -5
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +7 -7
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +1 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +6 -6
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +16 -12
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +15 -5
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
- package/tests/assets/original/components/createAll/Constellation/shared/PConnProps.d.ts +46 -0
- package/tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts +5 -0
- package/tests/assets/original/components/createAll/Constellation/shared/suggestions-handler.ts +9 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/index.tsx +5 -5
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/index.tsx +6 -6
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +1 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +6 -6
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +16 -12
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/index.tsx +15 -5
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.stories.tsx +7 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +1 -1
- package/tests/assets/original/components/createAll/Launchpad/shared/PConnProps.d.ts +46 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts +5 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/suggestions-handler.ts +9 -0
package/src/util.js
CHANGED
|
@@ -2653,10 +2653,14 @@ if (showDebug) addDebugLog("deleteArchives", ``, "");
|
|
|
2653
2653
|
}
|
|
2654
2654
|
}
|
|
2655
2655
|
|
|
2656
|
-
export const checkLibraryAndArchives = async () => {
|
|
2656
|
+
export const checkLibraryAndArchives = async (checkArch = true) => {
|
|
2657
2657
|
if (showDebug) addDebugLog("checkLibraryAndArchives", ``, "");
|
|
2658
2658
|
const isLibraryBased = getLibraryBased();
|
|
2659
|
-
|
|
2659
|
+
let hasArch = true;
|
|
2660
|
+
if (checkArch) {
|
|
2661
|
+
hasArch = await hasArchives();
|
|
2662
|
+
|
|
2663
|
+
}
|
|
2660
2664
|
|
|
2661
2665
|
if (isLibraryBased && !hasArch) {
|
|
2662
2666
|
console.log(chalk.yellow('\nPlease create/import a library before proceeding.'));
|
|
@@ -56,6 +56,13 @@ export const BasePegaDxilMyCaseWidget: 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
|
},
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx
CHANGED
|
@@ -26,9 +26,9 @@ function PegaDxilMyCaseWidget(props: PegaDxilMyCaseWidgetProps) {
|
|
|
26
26
|
const context = pConn.getContextName();
|
|
27
27
|
|
|
28
28
|
const columns = [
|
|
29
|
-
{ renderer: 'date', label: pConn.
|
|
30
|
-
{ renderer: 'description', label: pConn.
|
|
31
|
-
{ renderer: 'user', label: pConn.
|
|
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(() => {
|
|
@@ -60,11 +60,11 @@ function PegaDxilMyCaseWidget(props: PegaDxilMyCaseWidgetProps) {
|
|
|
60
60
|
return (
|
|
61
61
|
<StyledPegaDxilMyCaseWidgetWrapper>
|
|
62
62
|
<Table
|
|
63
|
-
title={pConn.
|
|
63
|
+
title={pConn.getLocalizationService().getLocalizedText(label)}
|
|
64
64
|
columns={columns}
|
|
65
65
|
data={history}
|
|
66
66
|
loading={isLoading}
|
|
67
|
-
loadingMessage={pConn.
|
|
67
|
+
loadingMessage={pConn.getLocalizationService().getLocalizedText('Loading case history')}
|
|
68
68
|
/>
|
|
69
69
|
</StyledPegaDxilMyCaseWidgetWrapper>
|
|
70
70
|
);
|
|
@@ -62,6 +62,13 @@ export const BasePegaDxilMyIconButtonUrl: 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
|
},
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx
CHANGED
|
@@ -78,8 +78,8 @@ function PegaDxilMyIconButtonUrl(props: PegaDxilMyIconButtonUrlProps) {
|
|
|
78
78
|
|
|
79
79
|
// setting up columns for the work list table
|
|
80
80
|
const columns = [
|
|
81
|
-
{ renderer: 'stateName', label: PConnect.
|
|
82
|
-
{ renderer: 'stateCode', label: PConnect.
|
|
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
|
|
@@ -170,12 +170,12 @@ function PegaDxilMyIconButtonUrl(props: PegaDxilMyIconButtonUrlProps) {
|
|
|
170
170
|
/>
|
|
171
171
|
<Label style={{ margin: '0.1rem' }}>
|
|
172
172
|
{' '}
|
|
173
|
-
{PConnect.
|
|
174
|
-
{PConnect.
|
|
173
|
+
{PConnect.getLocalizationService().getLocalizedText('State list for')}{' '}
|
|
174
|
+
{PConnect.getLocalizationService().getLocalizedText(`${countryCode}`)}{' '}
|
|
175
175
|
</Label>
|
|
176
176
|
<Button
|
|
177
177
|
icon
|
|
178
|
-
label={PConnect.
|
|
178
|
+
label={PConnect.getLocalizationService().getLocalizedText('Click to show/hide state list')}
|
|
179
179
|
variant='link'
|
|
180
180
|
compact={false}
|
|
181
181
|
onClick={showHideTable}
|
|
@@ -200,11 +200,11 @@ function PegaDxilMyIconButtonUrl(props: PegaDxilMyIconButtonUrlProps) {
|
|
|
200
200
|
</div>
|
|
201
201
|
{showTable && (
|
|
202
202
|
<Table
|
|
203
|
-
title={PConnect.
|
|
203
|
+
title={PConnect.getLocalizationService().getLocalizedText('State list')}
|
|
204
204
|
columns={columns}
|
|
205
205
|
data={statelist}
|
|
206
206
|
loading={isLoading}
|
|
207
|
-
loadingMessage={PConnect.
|
|
207
|
+
loadingMessage={PConnect.getLocalizationService().getLocalizedText('Loading state list')}
|
|
208
208
|
/>
|
|
209
209
|
)}
|
|
210
210
|
</StyledPegaDxilMyIconButtonUrlWrapper>
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx
CHANGED
|
@@ -38,7 +38,7 @@ export default function GetNextWork(props: PegaDxilMyPageWorkProps) {
|
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
40
|
<Button variant={variant} onClick={getNextWork}>
|
|
41
|
-
{getPConnect().
|
|
41
|
+
{getPConnect().getLocalizationService().getLocalizedText('Get next work')}
|
|
42
42
|
</Button>
|
|
43
43
|
);
|
|
44
44
|
}
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx
CHANGED
|
@@ -61,6 +61,13 @@ export const BasePegaDxilMyPage: 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
|
},
|
|
@@ -74,6 +74,13 @@ export const BasePegaDxilMyPageWidget: 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
|
},
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx
CHANGED
|
@@ -36,10 +36,10 @@ function PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
|
|
|
36
36
|
|
|
37
37
|
// setting up columns for the work list table
|
|
38
38
|
const columns = [
|
|
39
|
-
{ renderer: 'caseType', label: PConnect.
|
|
40
|
-
{ renderer: 'insKey', label: PConnect.
|
|
41
|
-
{ renderer: 'status', label: PConnect.
|
|
42
|
-
{ renderer: 'stage', label: PConnect.
|
|
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 PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
|
|
|
96
96
|
/>
|
|
97
97
|
<br />
|
|
98
98
|
<Table
|
|
99
|
-
title={PConnect.
|
|
99
|
+
title={PConnect.getLocalizationService().getLocalizedText('Work list')}
|
|
100
100
|
columns={columns}
|
|
101
101
|
data={worklist}
|
|
102
102
|
loading={isLoading}
|
|
103
|
-
loadingMessage={PConnect.
|
|
103
|
+
loadingMessage={PConnect.getLocalizationService().getLocalizedText('Loading Work list')}
|
|
104
104
|
/>
|
|
105
105
|
</StyledPegaDxilMyPageWidgetWrapper>
|
|
106
106
|
);
|
|
@@ -31,6 +31,13 @@ export const BasePegaDxilMyPicklist: 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
|
},
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx
CHANGED
|
@@ -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.
|
|
97
|
+
{pConnect.getLocalizationService().getLocalizedText(placeholder)}
|
|
98
98
|
</Option>
|
|
99
99
|
);
|
|
100
100
|
} else if (!listSourceItems) {
|
|
@@ -167,6 +167,8 @@ function PegaDxilMyPicklist(props: PegaDxilMyPicklistProps) {
|
|
|
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 PegaDxilMyPicklist(props: PegaDxilMyPicklistProps) {
|
|
|
202
204
|
items.push(
|
|
203
205
|
// @ts-ignore
|
|
204
206
|
<Option key={item.key} value={item.key}>
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
});
|
|
@@ -34,6 +34,13 @@ export const BasePegaDxilMyRadiobuttons: 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
|
},
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx
CHANGED
|
@@ -106,6 +106,8 @@ function PegaDxilMyRadiobuttons(props: PegaDxilMyRadiobuttonsProps) {
|
|
|
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 PegaDxilMyRadiobuttons(props: PegaDxilMyRadiobuttonsProps) {
|
|
|
138
140
|
id={`${fullReference}.${item.key}`}
|
|
139
141
|
value={item.key}
|
|
140
142
|
key={`${fullReference}.${item.key}`}
|
|
141
|
-
label={
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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,6 +38,13 @@ export const BasePegaDxilMySearchbox: 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
|
},
|
package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx
CHANGED
|
@@ -1126,7 +1126,7 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
1126
1126
|
selected: item.items ? undefined : !!item.selected || item.id === selected?.id
|
|
1127
1127
|
})),
|
|
1128
1128
|
onItemClick: selectItem,
|
|
1129
|
-
emptyText: pConn.
|
|
1129
|
+
emptyText: pConn.getLocalizationService().getLocalizedText('No items'),
|
|
1130
1130
|
loading,
|
|
1131
1131
|
loadMore,
|
|
1132
1132
|
footer: createNewRecord ? (
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {PConnect } from '@pega/pcore-pconnect-typedefs';
|
|
2
|
+
|
|
3
|
+
// PConnProps.d.ts
|
|
4
|
+
// This gives us a place to have each component (which is most DX Components) that is
|
|
5
|
+
// expected to have a getPConnect extend its props (from BaseProps)
|
|
6
|
+
// such that every component will be expected to have a getPConnect() function
|
|
7
|
+
// that returns a PConnect object. (new/better way of doing .propTypes).
|
|
8
|
+
// This PConnProps can be extended to include other props that we know are in every component
|
|
9
|
+
export interface PConnProps {
|
|
10
|
+
// getPConnect should exist for every C11n component. (add @ts-ignore in special cases where it isn't)
|
|
11
|
+
getPConnect: () => typeof PConnect;
|
|
12
|
+
|
|
13
|
+
// Allow any/all other key/value pairs in the BaseProps for now
|
|
14
|
+
// TODO: refine which other props are always expected for various component
|
|
15
|
+
// types and consider further interface "subclassing". For example, we may
|
|
16
|
+
// want to create a "BasePropsForm" that gives guidance on required, readonly, etc.
|
|
17
|
+
// and any other props that every Form component expects.
|
|
18
|
+
// For example, see the PConnFieldProps below.
|
|
19
|
+
// NOTE: if you uncomment the line below, the PConnProps type will allow
|
|
20
|
+
// otherwise undefined types to appear. This can be helpful for debugging
|
|
21
|
+
// or when adding new components whose types aren't yet known.
|
|
22
|
+
// [key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
// PConnFieldProps extends PConnProps to bring in the common properties that are
|
|
27
|
+
// associated with most field components (ex: Dropdown, TextInput, etc.) in the
|
|
28
|
+
// components/field directory
|
|
29
|
+
export interface PConnFieldProps extends PConnProps {
|
|
30
|
+
label: string,
|
|
31
|
+
required: boolean,
|
|
32
|
+
disabled: boolean,
|
|
33
|
+
value: any,
|
|
34
|
+
validatemessage: string,
|
|
35
|
+
status?: string,
|
|
36
|
+
onChange?: any,
|
|
37
|
+
onBlur?: any,
|
|
38
|
+
readOnly: boolean,
|
|
39
|
+
testId: string,
|
|
40
|
+
helperText: string,
|
|
41
|
+
displayMode?: string,
|
|
42
|
+
hideLabel: boolean,
|
|
43
|
+
placeholder?: string,
|
|
44
|
+
fieldMetadata?: any,
|
|
45
|
+
additionalProps?: any
|
|
46
|
+
}
|
|
@@ -56,6 +56,13 @@ export const BasePegaDxilMyCaseWidget: 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
|
},
|
package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx
CHANGED
|
@@ -26,9 +26,9 @@ function PegaDxilMyCaseWidget(props: PegaDxilMyCaseWidgetProps) {
|
|
|
26
26
|
const context = pConn.getContextName();
|
|
27
27
|
|
|
28
28
|
const columns = [
|
|
29
|
-
{ renderer: 'date', label: pConn.
|
|
30
|
-
{ renderer: 'description', label: pConn.
|
|
31
|
-
{ renderer: 'user', label: pConn.
|
|
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(() => {
|
|
@@ -60,11 +60,11 @@ function PegaDxilMyCaseWidget(props: PegaDxilMyCaseWidgetProps) {
|
|
|
60
60
|
return (
|
|
61
61
|
<StyledPegaDxilMyCaseWidgetWrapper>
|
|
62
62
|
<Table
|
|
63
|
-
title={pConn.
|
|
63
|
+
title={pConn.getLocalizationService().getLocalizedText(label)}
|
|
64
64
|
columns={columns}
|
|
65
65
|
data={history}
|
|
66
66
|
loading={isLoading}
|
|
67
|
-
loadingMessage={pConn.
|
|
67
|
+
loadingMessage={pConn.getLocalizationService().getLocalizedText('Loading case history')}
|
|
68
68
|
/>
|
|
69
69
|
</StyledPegaDxilMyCaseWidgetWrapper>
|
|
70
70
|
);
|
|
@@ -62,6 +62,13 @@ export const BasePegaDxilMyIconButtonUrl: 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
|
},
|
package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx
CHANGED
|
@@ -78,8 +78,8 @@ function PegaDxilMyIconButtonUrl(props: PegaDxilMyIconButtonUrlProps) {
|
|
|
78
78
|
|
|
79
79
|
// setting up columns for the work list table
|
|
80
80
|
const columns = [
|
|
81
|
-
{ renderer: 'stateName', label: PConnect.
|
|
82
|
-
{ renderer: 'stateCode', label: PConnect.
|
|
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
|
|
@@ -170,12 +170,12 @@ function PegaDxilMyIconButtonUrl(props: PegaDxilMyIconButtonUrlProps) {
|
|
|
170
170
|
/>
|
|
171
171
|
<Label style={{ margin: '0.1rem' }}>
|
|
172
172
|
{' '}
|
|
173
|
-
{PConnect.
|
|
174
|
-
{PConnect.
|
|
173
|
+
{PConnect.getLocalizationService().getLocalizedText('State list for')}{' '}
|
|
174
|
+
{PConnect.getLocalizationService().getLocalizedText(`${countryCode}`)}{' '}
|
|
175
175
|
</Label>
|
|
176
176
|
<Button
|
|
177
177
|
icon
|
|
178
|
-
label={PConnect.
|
|
178
|
+
label={PConnect.getLocalizationService().getLocalizedText('Click to show/hide state list')}
|
|
179
179
|
variant='link'
|
|
180
180
|
compact={false}
|
|
181
181
|
onClick={showHideTable}
|
|
@@ -200,11 +200,11 @@ function PegaDxilMyIconButtonUrl(props: PegaDxilMyIconButtonUrlProps) {
|
|
|
200
200
|
</div>
|
|
201
201
|
{showTable && (
|
|
202
202
|
<Table
|
|
203
|
-
title={PConnect.
|
|
203
|
+
title={PConnect.getLocalizationService().getLocalizedText('State list')}
|
|
204
204
|
columns={columns}
|
|
205
205
|
data={statelist}
|
|
206
206
|
loading={isLoading}
|
|
207
|
-
loadingMessage={PConnect.
|
|
207
|
+
loadingMessage={PConnect.getLocalizationService().getLocalizedText('Loading state list')}
|
|
208
208
|
/>
|
|
209
209
|
)}
|
|
210
210
|
</StyledPegaDxilMyIconButtonUrlWrapper>
|
package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx
CHANGED
|
@@ -38,7 +38,7 @@ export default function GetNextWork(props: PegaDxilMyPageWorkProps) {
|
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
40
|
<Button variant={variant} onClick={getNextWork}>
|
|
41
|
-
{getPConnect().
|
|
41
|
+
{getPConnect().getLocalizationService().getLocalizedText('Get next work')}
|
|
42
42
|
</Button>
|
|
43
43
|
);
|
|
44
44
|
}
|
package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx
CHANGED
|
@@ -61,6 +61,13 @@ export const BasePegaDxilMyPage: 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
|
},
|
|
@@ -74,6 +74,13 @@ export const BasePegaDxilMyPageWidget: 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
|
},
|
package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx
CHANGED
|
@@ -36,10 +36,10 @@ function PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
|
|
|
36
36
|
|
|
37
37
|
// setting up columns for the work list table
|
|
38
38
|
const columns = [
|
|
39
|
-
{ renderer: 'caseType', label: PConnect.
|
|
40
|
-
{ renderer: 'insKey', label: PConnect.
|
|
41
|
-
{ renderer: 'status', label: PConnect.
|
|
42
|
-
{ renderer: 'stage', label: PConnect.
|
|
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 PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
|
|
|
96
96
|
/>
|
|
97
97
|
<br />
|
|
98
98
|
<Table
|
|
99
|
-
title={PConnect.
|
|
99
|
+
title={PConnect.getLocalizationService().getLocalizedText('Work list')}
|
|
100
100
|
columns={columns}
|
|
101
101
|
data={worklist}
|
|
102
102
|
loading={isLoading}
|
|
103
|
-
loadingMessage={PConnect.
|
|
103
|
+
loadingMessage={PConnect.getLocalizationService().getLocalizedText('Loading Work list')}
|
|
104
104
|
/>
|
|
105
105
|
</StyledPegaDxilMyPageWidgetWrapper>
|
|
106
106
|
);
|
|
@@ -31,6 +31,13 @@ export const BasePegaDxilMyPicklist: 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
|
},
|
package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx
CHANGED
|
@@ -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.
|
|
97
|
+
{pConnect.getLocalizationService().getLocalizedText(placeholder)}
|
|
98
98
|
</Option>
|
|
99
99
|
);
|
|
100
100
|
} else if (!listSourceItems) {
|
|
@@ -167,6 +167,8 @@ function PegaDxilMyPicklist(props: PegaDxilMyPicklistProps) {
|
|
|
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 PegaDxilMyPicklist(props: PegaDxilMyPicklistProps) {
|
|
|
202
204
|
items.push(
|
|
203
205
|
// @ts-ignore
|
|
204
206
|
<Option key={item.key} value={item.key}>
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
});
|
|
@@ -34,6 +34,13 @@ export const BasePegaDxilMyRadiobuttons: 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
|
},
|