@pega/dx-component-builder-sdk 23.1.12 → 23.1.14
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 +4 -4
- package/package.json +1 -1
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -2
- package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +8 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +3 -9
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +7 -15
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/demo.stories.tsx.mustache +20 -0
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +38 -37
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +5 -3
- package/src/tasks/map/map.js +29 -8
- package/src/tasks/publish/index.js +3 -1
- package/src/tasks/publish-all/index.js +7 -5
- package/tests/assets/sdk-a/components/create/override-sdk/template/list-view/utils.ts +4 -2
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/list-view/utils.ts +4 -2
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
- package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
- package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
- package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +10 -16
- package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +6 -10
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +41 -36
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +21 -7
- package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +5 -3
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +2 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +3 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +28 -12
- package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +12 -2
- package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +7 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +8 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +3 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/demo.stories.tsx +20 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +38 -37
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +7 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +5 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +10 -16
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +6 -10
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +41 -36
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +21 -7
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +5 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +3 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +28 -12
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +12 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/PConnProps.d.ts +0 -46
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -54
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +0 -73
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/mock.ts +0 -15
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/styles.ts +0 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/config.json +0 -83
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -59
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -101
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +0 -16
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/styles.js +0 -7
- /package/src/tasks/create/templates/Constellation/field/Boolean/{demo.stories.jsx.mustache → demo.stories.tsx.mustache} +0 -0
- /package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/{demo.stories.jsx → demo.stories.tsx} +0 -0
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
This project provides you with an environment to extend SDK-R by giving you tools to create and publish custom components that are not available from the SDK-R release.
|
|
5
|
+
This project provides you with an environment to extend SDK-R/SDK-A by giving you tools to create and publish custom components that are not available from the SDK-R/SDK-A release.
|
|
6
6
|
|
|
7
7
|
## Prerequisites
|
|
8
8
|
|
|
9
9
|
Ensure you have access to the following in your system:
|
|
10
10
|
|
|
11
|
-
- Pega Infinity Server version
|
|
11
|
+
- Pega Infinity Server version 23
|
|
12
12
|
|
|
13
13
|
- Git version 2.30 or later
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ Ensure you have access to the following in your system:
|
|
|
16
16
|
|
|
17
17
|
- System npm version 8
|
|
18
18
|
|
|
19
|
-
- Installed SDK-R, as the below commands live in the package.json of the SDK-R an NOT in this npm module
|
|
19
|
+
- Installed SDK-R or SDK-A, as the below commands live in the package.json of the SDK-R/SDK-A an NOT in this npm module
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
## Create custom components
|
|
@@ -79,7 +79,7 @@ The *config.json* file contains the mapping of properties for configuring the au
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
2. Enter the following command to start the storybook to view the demo.
|
|
82
|
-
`npm
|
|
82
|
+
`npm run startStorybook (Angular) npm run storybookSDK (React) or npm run storybookConstellation (React)`
|
|
83
83
|
|
|
84
84
|
3. Modify the source files to build your own component. You can also install and import third-party libraries if required for your component.
|
|
85
85
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';
|
|
2
|
+
import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel } from '@material-ui/core';
|
|
3
3
|
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
@@ -24,6 +24,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
24
24
|
|
|
25
25
|
const {
|
|
26
26
|
getPConnect,
|
|
27
|
+
label,
|
|
27
28
|
value = false,
|
|
28
29
|
readOnly,
|
|
29
30
|
testId,
|
|
@@ -78,6 +79,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
78
79
|
return (
|
|
79
80
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
80
81
|
<FormControl required={required} error={status === 'error'}>
|
|
82
|
+
{!hideLabel && <FormLabel component='legend'>{label}</FormLabel>}
|
|
81
83
|
<FormGroup>
|
|
82
84
|
<FormControlLabel
|
|
83
85
|
control={theCheckbox}
|
|
@@ -94,4 +96,3 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
94
96
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
95
97
|
);
|
|
96
98
|
}
|
|
97
|
-
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
1
|
import CurrencyTextField from '@unicef/material-ui-currency-textfield';
|
|
3
2
|
|
|
4
3
|
import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils.js';
|
|
@@ -49,14 +48,9 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
49
48
|
const propName = (pConn.getStateProps() as any).value;
|
|
50
49
|
const helperTextToDisplay = validatemessage || helperText;
|
|
51
50
|
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
57
|
-
setCurrDec(theSymbols.theDecimalIndicator);
|
|
58
|
-
setCurrSep(theSymbols.theDigitGroupSeparator);
|
|
59
|
-
}, [currencyISOCode]);
|
|
51
|
+
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
52
|
+
const theCurrDec = theSymbols.theDecimalIndicator;
|
|
53
|
+
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
60
54
|
|
|
61
55
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
62
56
|
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
1
|
import CurrencyTextField from '@unicef/material-ui-currency-textfield';
|
|
3
2
|
|
|
4
|
-
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
|
-
import { format } from "@pega/react-sdk-components/lib/components/helpers/formatters";
|
|
6
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
4
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
-
|
|
5
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
6
|
+
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
9
7
|
import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils.js';
|
|
10
8
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
11
9
|
|
|
@@ -52,17 +50,11 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
52
50
|
'data-test-id': testId
|
|
53
51
|
};
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
|
|
61
|
-
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
62
|
-
setCurrSym(theSymbols.theCurrencySymbol);
|
|
63
|
-
setCurrDec(theSymbols.theDecimalIndicator);
|
|
64
|
-
setCurrSep(theSymbols.theDigitGroupSeparator);
|
|
65
|
-
}, [currencyISOCode]);
|
|
53
|
+
// currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
|
|
54
|
+
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
55
|
+
const theCurrSym = theSymbols.theCurrencySymbol;
|
|
56
|
+
const theCurrDec = theSymbols.theDecimalIndicator;
|
|
57
|
+
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
66
58
|
|
|
67
59
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
68
60
|
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/demo.stories.tsx.mustache
CHANGED
|
@@ -10,6 +10,20 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
|
|
|
10
10
|
excludeStories: /.*Data$/
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
window.PCore = {
|
|
14
|
+
...window.PCore,
|
|
15
|
+
getEnvironmentInfo: (): any => {
|
|
16
|
+
return {
|
|
17
|
+
getUseLocale: () => {
|
|
18
|
+
return 'en-GB';
|
|
19
|
+
},
|
|
20
|
+
getLocale: () => {
|
|
21
|
+
return 'en-GB';
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
13
27
|
export default meta;
|
|
14
28
|
type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
|
|
15
29
|
|
|
@@ -22,10 +36,16 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
22
36
|
fieldMetadata,
|
|
23
37
|
getPConnect: () => {
|
|
24
38
|
return {
|
|
39
|
+
getComponentName: () => {
|
|
40
|
+
return 'Percentage';
|
|
41
|
+
},
|
|
25
42
|
getActionsApi: () => {
|
|
26
43
|
return {
|
|
27
44
|
updateFieldValue: (propName, theValue) => {
|
|
28
45
|
setValue(theValue);
|
|
46
|
+
},
|
|
47
|
+
triggerFieldChange: (propName, theValue) => {
|
|
48
|
+
setValue(theValue);
|
|
29
49
|
}
|
|
30
50
|
};
|
|
31
51
|
},
|
|
@@ -1,69 +1,57 @@
|
|
|
1
|
-
import
|
|
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';
|
|
5
|
+
import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils.js';
|
|
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';
|
|
6
8
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
7
9
|
|
|
8
|
-
// Inspired by https://stackoverflow.com/questions/50823182/material-ui-remove-up-down-arrow-dials-from-textview
|
|
9
|
-
const useStyles = makeStyles((/* theme */) => ({
|
|
10
|
-
input: {
|
|
11
|
-
'& input[type=number]': {
|
|
12
|
-
'-moz-appearance': 'textfield'
|
|
13
|
-
},
|
|
14
|
-
'& input[type=number]::-webkit-outer-spin-button': {
|
|
15
|
-
'-webkit-appearance': 'none',
|
|
16
|
-
margin: 0
|
|
17
|
-
},
|
|
18
|
-
'& input[type=number]::-webkit-inner-spin-button': {
|
|
19
|
-
'-webkit-appearance': 'none',
|
|
20
|
-
margin: 0
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
10
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
26
11
|
// If any, enter additional props that only exist on this componentName
|
|
12
|
+
currencyISOCode: string;
|
|
27
13
|
}
|
|
28
14
|
|
|
29
15
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
30
16
|
export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
31
17
|
// Get emitted components from map (so we can get any override that may exist)
|
|
32
|
-
const TextInput = getComponentFromMap('TextInput');
|
|
33
18
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
34
19
|
|
|
35
|
-
const classes = useStyles();
|
|
36
|
-
|
|
37
20
|
const {
|
|
21
|
+
getPConnect,
|
|
38
22
|
label,
|
|
39
23
|
required,
|
|
40
24
|
disabled,
|
|
41
25
|
value = '',
|
|
42
26
|
validatemessage,
|
|
43
27
|
status,
|
|
44
|
-
onChange,
|
|
45
|
-
onBlur,
|
|
28
|
+
// onChange,
|
|
29
|
+
// onBlur,
|
|
46
30
|
readOnly,
|
|
31
|
+
currencyISOCode = 'USD',
|
|
47
32
|
testId,
|
|
48
33
|
helperText,
|
|
49
34
|
displayMode,
|
|
50
35
|
hideLabel,
|
|
51
36
|
placeholder
|
|
52
37
|
} = props;
|
|
38
|
+
|
|
39
|
+
const pConn = getPConnect();
|
|
40
|
+
const actions = pConn.getActionsApi();
|
|
41
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
53
42
|
const helperTextToDisplay = validatemessage || helperText;
|
|
54
43
|
|
|
44
|
+
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
45
|
+
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
46
|
+
|
|
55
47
|
// console.log(`Percentage: label: ${label} value: ${value}`);
|
|
56
48
|
|
|
57
49
|
if (displayMode === 'LABELS_LEFT') {
|
|
58
|
-
return <FieldValueList name={hideLabel ? '' : label} value={
|
|
50
|
+
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
|
|
59
51
|
}
|
|
60
52
|
|
|
61
53
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
62
|
-
return <FieldValueList name={hideLabel ? '' : label} value={
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (readOnly) {
|
|
66
|
-
return <TextInput {...props} />;
|
|
54
|
+
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
|
|
67
55
|
}
|
|
68
56
|
|
|
69
57
|
let testProp = {};
|
|
@@ -72,10 +60,17 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
72
60
|
'data-test-id': testId
|
|
73
61
|
};
|
|
74
62
|
|
|
63
|
+
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
64
|
+
const theCurrDec = theSymbols.theDecimalIndicator;
|
|
65
|
+
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
66
|
+
|
|
67
|
+
function PercentageOnBlur(event, inValue) {
|
|
68
|
+
handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);
|
|
69
|
+
}
|
|
70
|
+
|
|
75
71
|
return (
|
|
76
72
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
77
|
-
<
|
|
78
|
-
className={classes.input}
|
|
73
|
+
<CurrencyTextField
|
|
79
74
|
fullWidth
|
|
80
75
|
variant={readOnly ? 'standard' : 'outlined'}
|
|
81
76
|
helperText={helperTextToDisplay}
|
|
@@ -83,18 +78,24 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
83
78
|
size='small'
|
|
84
79
|
required={required}
|
|
85
80
|
disabled={disabled}
|
|
86
|
-
|
|
87
|
-
onBlur={!readOnly ? onBlur : undefined}
|
|
81
|
+
readOnly={!!readOnly}
|
|
88
82
|
error={status === 'error'}
|
|
89
83
|
label={label}
|
|
90
84
|
value={value}
|
|
91
|
-
type='
|
|
85
|
+
type='text'
|
|
86
|
+
outputFormat='number'
|
|
87
|
+
textAlign='left'
|
|
92
88
|
{{! pick new delimiters for mustache }}
|
|
93
89
|
{{=<% %>=}}
|
|
94
|
-
|
|
90
|
+
InputProps={{
|
|
91
|
+
inputProps: { ...testProp }
|
|
92
|
+
}}
|
|
95
93
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
94
|
+
currencySymbol=''
|
|
95
|
+
decimalCharacter={theCurrDec}
|
|
96
|
+
digitGroupSeparator={theCurrSep}
|
|
97
|
+
onBlur={!readOnly ? PercentageOnBlur : undefined}
|
|
96
98
|
/>
|
|
97
99
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
98
100
|
);
|
|
99
101
|
}
|
|
100
|
-
|
|
@@ -151,9 +151,9 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
151
151
|
const theKey = `CaseHistory-${index}`;
|
|
152
152
|
theDataRows.push(
|
|
153
153
|
<TableRow key={theKey}>
|
|
154
|
-
<StyledTableCell>{dataRow[0] ? dataRow[0] : '---'}</StyledTableCell>
|
|
155
|
-
<StyledTableCell>{dataRow[1] ? dataRow[1] : '---'}</StyledTableCell>
|
|
156
|
-
<StyledTableCell>{dataRow[2] ? dataRow[2] : '---'}</StyledTableCell>
|
|
154
|
+
<StyledTableCell>{dataRow[0] ? dataRow[0] as any : '---'}</StyledTableCell>
|
|
155
|
+
<StyledTableCell>{dataRow[1] ? dataRow[1] as any : '---'}</StyledTableCell>
|
|
156
|
+
<StyledTableCell>{dataRow[2] ? dataRow[2] as any : '---'}</StyledTableCell>
|
|
157
157
|
</TableRow>
|
|
158
158
|
);
|
|
159
159
|
});
|
|
@@ -20,6 +20,7 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
|
|
|
20
20
|
updateDateTime: string;
|
|
21
21
|
updateLabel: string;
|
|
22
22
|
updateOperator: { userName: string; userId: string };
|
|
23
|
+
displayLabel?: any;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
const useStyles = makeStyles(theme => ({
|
|
@@ -42,18 +43,19 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
42
43
|
// const componentName = "Operator";
|
|
43
44
|
const classes = useStyles();
|
|
44
45
|
|
|
45
|
-
const fieldLabel = props
|
|
46
|
+
const fieldLabel = props?.label?.toLowerCase();
|
|
47
|
+
const displayLabel = props?.displayLabel?.toLowerCase();
|
|
46
48
|
let caseOpLabel = '---';
|
|
47
49
|
let caseOpName = '---';
|
|
48
50
|
let caseOpId = '';
|
|
49
51
|
let caseTime = '';
|
|
50
52
|
|
|
51
|
-
if (fieldLabel === 'create operator') {
|
|
53
|
+
if (fieldLabel === 'create operator' || displayLabel === 'create operator') {
|
|
52
54
|
caseOpLabel = props.createLabel;
|
|
53
55
|
caseOpName = props.createOperator.userName;
|
|
54
56
|
caseTime = props.createDateTime;
|
|
55
57
|
caseOpId = props.createOperator.userId;
|
|
56
|
-
} else if (fieldLabel === 'update operator') {
|
|
58
|
+
} else if (fieldLabel === 'update operator' || displayLabel === 'update operator') {
|
|
57
59
|
caseOpLabel = props.updateLabel;
|
|
58
60
|
caseOpName = props.updateOperator.userName;
|
|
59
61
|
caseTime = props.updateDateTime;
|
package/src/tasks/map/map.js
CHANGED
|
@@ -50,6 +50,27 @@ export const getPrettierFormattedString = async (content) => {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
//
|
|
54
|
+
// some components reference have a slightly different case/spelling than the component name, class, etc.
|
|
55
|
+
//
|
|
56
|
+
export const getSpecialCase = (componentKey, framework) => {
|
|
57
|
+
|
|
58
|
+
switch (framework) {
|
|
59
|
+
case 'SDK-React':
|
|
60
|
+
switch(componentKey) {
|
|
61
|
+
case "ToDo":
|
|
62
|
+
return "Todo";
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
case 'SDK-Angular':
|
|
66
|
+
break;
|
|
67
|
+
case 'SDK-WebComponents' :
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return componentKey;
|
|
72
|
+
}
|
|
73
|
+
|
|
53
74
|
export const updateComponentMap = async (componentKey, category = CATEGORY_CUSTOM) => {
|
|
54
75
|
|
|
55
76
|
const framework = await getFramework();
|
|
@@ -73,7 +94,7 @@ export const updateComponentMap = async (componentKey, category = CATEGORY_CUSTO
|
|
|
73
94
|
importComponent = "./".concat(importComponent).split(path.sep).join("/");
|
|
74
95
|
|
|
75
96
|
let importFull = "import ".concat(componentName).concat(" from '").concat(importComponent).concat("/';");
|
|
76
|
-
let mapFull = "\"".concat(componentNameNoPrefix).concat("\" : " ).concat(componentName).concat(",");
|
|
97
|
+
let mapFull = "\"".concat(getSpecialCase(componentNameNoPrefix, framework)).concat("\" : " ).concat(componentName).concat(",");
|
|
77
98
|
|
|
78
99
|
if (mapData.indexOf(importComponent.concat("/")) < 0) {
|
|
79
100
|
// not present so we can add
|
|
@@ -141,7 +162,7 @@ export const updateComponentMap = async (componentKey, category = CATEGORY_CUSTO
|
|
|
141
162
|
importComponentAng = "./".concat(importComponentAng).split(path.sep).join("/");
|
|
142
163
|
|
|
143
164
|
let importFullAng = "import { ".concat(componentComponentNameAng).concat(" } from '").concat(importComponentAng).concat(".component';");
|
|
144
|
-
let mapFullAng = "\"".concat(originalComponentName).concat("\" : " ).concat(componentComponentNameAng).concat(",");
|
|
165
|
+
let mapFullAng = "\"".concat(getSpecialCase(originalComponentName, framework)).concat("\" : " ).concat(componentComponentNameAng).concat(",");
|
|
145
166
|
|
|
146
167
|
if (mapDataAng.indexOf(importComponentAng.concat(".component")) < 0) {
|
|
147
168
|
// not present so we can add
|
|
@@ -222,8 +243,8 @@ export const deleteFromComponentMap = async (componentKey, category = CATEGORY_C
|
|
|
222
243
|
|
|
223
244
|
|
|
224
245
|
let importFull = "import ".concat(componentName).concat(" from '").concat(importComponent).concat("/';");
|
|
225
|
-
let mapFull = "\"".concat(componentNameNoPrefix).concat("\" : " ).concat(componentName).concat(",");
|
|
226
|
-
let mapFullPretty = componentNameNoPrefix.concat(": ").concat(componentName);
|
|
246
|
+
let mapFull = "\"".concat(getSpecialCase(componentNameNoPrefix, framework)).concat("\" : " ).concat(componentName).concat(",");
|
|
247
|
+
let mapFullPretty = getSpecialCase(componentNameNoPrefix, framework).concat(": ").concat(componentName);
|
|
227
248
|
|
|
228
249
|
if (mapData.indexOf(importFull) >= 0) {
|
|
229
250
|
|
|
@@ -267,9 +288,9 @@ export const deleteFromComponentMap = async (componentKey, category = CATEGORY_C
|
|
|
267
288
|
|
|
268
289
|
|
|
269
290
|
let importFullAng = "import { ".concat(componentComponentNameAng).concat(" } from '").concat(importComponentAng).concat(".component';");
|
|
270
|
-
let mapFullAng = "\"".concat(originalComponentName).concat("\" : " ).concat(componentComponentNameAng).concat(",");
|
|
291
|
+
let mapFullAng = "\"".concat(getSpecialCase(originalComponentName, framework)).concat("\" : " ).concat(componentComponentNameAng).concat(",");
|
|
271
292
|
|
|
272
|
-
let mapFullAngPretty = originalComponentName.concat(": ").concat(componentComponentNameAng);
|
|
293
|
+
let mapFullAngPretty = getSpecialCase(originalComponentName, framework).concat(": ").concat(componentComponentNameAng);
|
|
273
294
|
|
|
274
295
|
if (mapDataAng.indexOf(importFullAng) >= 0) {
|
|
275
296
|
|
|
@@ -332,7 +353,7 @@ export const renameComponentInMap = async (oldComponentKey, newComponentKey) =>
|
|
|
332
353
|
mapData = mapData.replaceAll( '"' + oldComponentNameNoPrefix + '"' , '"' + newComponentNameNoPrefix + '"');
|
|
333
354
|
|
|
334
355
|
// pretty
|
|
335
|
-
mapData = mapData.replaceAll( oldComponentNameNoPrefix + ':' , newComponentNameNoPrefix + ':');
|
|
356
|
+
mapData = mapData.replaceAll( getSpecialCase(oldComponentNameNoPrefix, framework) + ':' , getSpecialCase(newComponentNameNoPrefix, framework) + ':');
|
|
336
357
|
|
|
337
358
|
// prettier
|
|
338
359
|
mapData = await getPrettierFormattedString(mapData);
|
|
@@ -369,7 +390,7 @@ export const renameComponentInMap = async (oldComponentKey, newComponentKey) =>
|
|
|
369
390
|
mapDataAng = mapDataAng.replaceAll( oldComponentNameAng + 'Component' , newComponentNameAng + 'Component');
|
|
370
391
|
|
|
371
392
|
// pretty
|
|
372
|
-
mapDataAng = mapDataAng.replaceAll( oldComponentNameNoPrefixAng + ':' , newComponentNameNoPrefixAng + ':');
|
|
393
|
+
mapDataAng = mapDataAng.replaceAll( getSpecialCase(oldComponentNameNoPrefixAng, framework) + ':' , getSpecialCase(newComponentNameNoPrefixAng, framework) + ':');
|
|
373
394
|
|
|
374
395
|
// prettier
|
|
375
396
|
mapDataAng = await getPrettierFormattedString(mapDataAng);
|
|
@@ -38,7 +38,9 @@ export default async options => {
|
|
|
38
38
|
const rulesetVersion = options.params[6];
|
|
39
39
|
const dBuild = options.params[7];
|
|
40
40
|
devBuild = dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true';
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line no-unneeded-ternary,no-nested-ternary
|
|
43
|
+
doFetch = options.params.length >= 9 ? (options.params[8] === 'noFetch' ? false : true) : true;
|
|
42
44
|
|
|
43
45
|
content = { componentKey, rulesetName, rulesetVersion, devBuild };
|
|
44
46
|
} else {
|
|
@@ -24,8 +24,9 @@ export function getCustomTasks(componentKey, category, sourceMap, devBuild, cont
|
|
|
24
24
|
const sDevBuild = devBuild ? '(dev build)' : '';
|
|
25
25
|
const sFramework = framework.split("-")[1];
|
|
26
26
|
|
|
27
|
-
//
|
|
28
|
-
const doFetch = options.params.length >=
|
|
27
|
+
// eslint-disable no-unneeded-ternary,no-nested-ternary
|
|
28
|
+
const doFetch = options.params.length >= 8 ? options.params[7] !== 'noFetch' : true;
|
|
29
|
+
|
|
29
30
|
|
|
30
31
|
return new Listr(
|
|
31
32
|
[
|
|
@@ -112,8 +113,9 @@ export function getOverrideTasks(componentKey, category, sourceMap, devBuild, co
|
|
|
112
113
|
const sDevBuild = devBuild ? '(dev build)' : '';
|
|
113
114
|
const sFramework = framework.split("-")[1];
|
|
114
115
|
|
|
115
|
-
//
|
|
116
|
-
const doFetch = options.params.length >=
|
|
116
|
+
// eslint-disable no-unneeded-ternary,no-nested-ternary
|
|
117
|
+
const doFetch = options.params.length >= 8 ? options.params[7] !== 'noFetch' : true;
|
|
118
|
+
|
|
117
119
|
|
|
118
120
|
return new Listr(
|
|
119
121
|
[
|
|
@@ -194,7 +196,7 @@ export default async options => {
|
|
|
194
196
|
|
|
195
197
|
components = await getComponentsObj(false, category);
|
|
196
198
|
|
|
197
|
-
// end if find no
|
|
199
|
+
// end if find no components
|
|
198
200
|
if (components.length == 0) {
|
|
199
201
|
console.log(chalk.redBright("No components to publish"));
|
|
200
202
|
process.exit(1);
|
|
@@ -680,10 +680,12 @@ export const readContextResponse = async (context, params) => {
|
|
|
680
680
|
const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
|
|
681
681
|
const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
|
|
682
682
|
dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)));
|
|
683
|
-
if (compositeKeys.length) {
|
|
683
|
+
if (compositeKeys.length && otherContext) {
|
|
684
684
|
otherContext.setCompositeKeys(compositeKeys);
|
|
685
685
|
}
|
|
686
|
-
otherContext
|
|
686
|
+
if (otherContext) {
|
|
687
|
+
otherContext.fetchRowActionDetails = null;
|
|
688
|
+
}
|
|
687
689
|
}
|
|
688
690
|
|
|
689
691
|
const presetArray = [];
|
|
@@ -680,10 +680,12 @@ export const readContextResponse = async (context, params) => {
|
|
|
680
680
|
const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
|
|
681
681
|
const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
|
|
682
682
|
dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)));
|
|
683
|
-
if (compositeKeys.length) {
|
|
683
|
+
if (compositeKeys.length && otherContext) {
|
|
684
684
|
otherContext.setCompositeKeys(compositeKeys);
|
|
685
685
|
}
|
|
686
|
-
otherContext
|
|
686
|
+
if (otherContext) {
|
|
687
|
+
otherContext.fetchRowActionDetails = null;
|
|
688
|
+
}
|
|
687
689
|
}
|
|
688
690
|
|
|
689
691
|
const presetArray = [];
|
|
@@ -19,6 +19,7 @@ interface OperatorProps extends PConnProps {
|
|
|
19
19
|
updateDateTime: string;
|
|
20
20
|
updateLabel: string;
|
|
21
21
|
updateOperator: { userName: string; userId: string };
|
|
22
|
+
displayLabel?: any;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const useStyles = makeStyles(theme => ({
|
|
@@ -36,18 +37,19 @@ export default function Operator(props: OperatorProps) {
|
|
|
36
37
|
// const componentName = "Operator";
|
|
37
38
|
const classes = useStyles();
|
|
38
39
|
|
|
39
|
-
const fieldLabel = props
|
|
40
|
+
const fieldLabel = props?.label?.toLowerCase();
|
|
41
|
+
const displayLabel = props?.displayLabel?.toLowerCase();
|
|
40
42
|
let caseOpLabel = '---';
|
|
41
43
|
let caseOpName = '---';
|
|
42
44
|
let caseOpId = '';
|
|
43
45
|
let caseTime = '';
|
|
44
46
|
|
|
45
|
-
if (fieldLabel === 'create operator') {
|
|
47
|
+
if (fieldLabel === 'create operator' || displayLabel === 'create operator') {
|
|
46
48
|
caseOpLabel = props.createLabel;
|
|
47
49
|
caseOpName = props.createOperator.userName;
|
|
48
50
|
caseTime = props.createDateTime;
|
|
49
51
|
caseOpId = props.createOperator.userId;
|
|
50
|
-
} else if (fieldLabel === 'update operator') {
|
|
52
|
+
} else if (fieldLabel === 'update operator' || displayLabel === 'update operator') {
|
|
51
53
|
caseOpLabel = props.updateLabel;
|
|
52
54
|
caseOpName = props.updateOperator.userName;
|
|
53
55
|
caseTime = props.updateDateTime;
|