@pega/custom-dx-components 8.8.20 → 23.1.10
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/.prettierrc.json +1 -7
- package/package.json +5 -5
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +3 -3
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +5 -1
- package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +3 -3
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +3 -3
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +6 -5
- package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +4 -3
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Text/index.jsx.mustache +5 -4
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/index.jsx.mustache +5 -4
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +3 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +3 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +5 -2
- package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +18 -12
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +5 -2
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +14 -11
- package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Launchpad/Widget/CASE/config.json.mustache +1 -1
- package/src/tasks/create/templates/Launchpad/Widget/CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Operator.jsx.mustache +2 -2
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.jsx.mustache +2 -2
- package/src/tasks/create-all/index.js +105 -98
- package/src/tasks/delete/helper.js +32 -24
- package/src/tasks/delete-all/helper.js +15 -12
- package/src/tasks/init/template/jest.config.cjs +21 -0
- package/src/tasks/init/template/package.json.mustache +9 -4
- package/src/tasks/list/helper.js +14 -19
- package/tests/assets/components/create/Pega_DXIL_MyTestText/index.jsx +5 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.jsx +3 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.jsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +5 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.jsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.jsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.jsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.jsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.jsx +15 -9
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.jsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.jsx +1 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.jsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.jsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.jsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.jsx +5 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.jsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.jsx +5 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.jsx +12 -9
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.jsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.jsx +3 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/config.json +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.jsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/config.json +5 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.jsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.jsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.jsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.jsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.jsx +15 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.jsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.jsx +1 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.jsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.jsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.jsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.jsx +5 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.jsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.jsx +5 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.jsx +12 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.jsx +1 -1
- package/tests/functional/localCreateBuildAllDeleteAll.test.js +15 -6
- package/tests/functional/localCreateBuildDelete.test.js +1 -1
- package/tests/functional/localCreatePublishAllDeleteAll.test.js +15 -6
- package/tests/functional/localCreatePublishDelete.test.js +2 -1
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/config.json.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/demo.stories.jsx.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/mock.stories.js.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/styles.js.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/suggestions-handler.js +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/time-of-day.js.mustache +0 -0
package/src/tasks/list/helper.js
CHANGED
|
@@ -7,15 +7,7 @@ import ora from 'ora';
|
|
|
7
7
|
|
|
8
8
|
import inquirer from 'inquirer';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
LIST_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
12
|
-
LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
13
|
-
TOKEN_PATH,
|
|
14
|
-
COMPONENT_SCHEMA,
|
|
15
|
-
TASKS_CONFIG_JSON_FILENAME,
|
|
16
|
-
COMPONENTS_DIRECTORY_PATH,
|
|
17
|
-
COMPONENTS_PATH
|
|
18
|
-
} from '../../constants.js';
|
|
10
|
+
import { LIST_COMPONENT_SERVICE_REST_ENDPOINT, LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT, TOKEN_PATH, COMPONENT_SCHEMA, TASKS_CONFIG_JSON_FILENAME, COMPONENTS_DIRECTORY_PATH, COMPONENTS_PATH } from '../../constants.js';
|
|
19
11
|
import { constructCompleteUrl, getComponents, getPegaServerConfig, getHttpsAgent, sanitize } from '../../util.js';
|
|
20
12
|
|
|
21
13
|
export const SOURCE_OF_COMPONENT_TYPES = {
|
|
@@ -23,6 +15,8 @@ export const SOURCE_OF_COMPONENT_TYPES = {
|
|
|
23
15
|
LOCAL: 'Local'
|
|
24
16
|
};
|
|
25
17
|
|
|
18
|
+
|
|
19
|
+
|
|
26
20
|
export const getListComponentsQuestions = async (options) => {
|
|
27
21
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
28
22
|
|
|
@@ -49,7 +43,9 @@ export const getLaunchPadFilterQuestions = async () => {
|
|
|
49
43
|
data = data && JSON.parse(data);
|
|
50
44
|
|
|
51
45
|
if (!data[COMPONENTS_DIRECTORY_PATH]) {
|
|
52
|
-
console.error(
|
|
46
|
+
console.error(
|
|
47
|
+
`${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
|
|
48
|
+
);
|
|
53
49
|
process.exit(1);
|
|
54
50
|
}
|
|
55
51
|
|
|
@@ -63,7 +59,7 @@ export const getLaunchPadFilterQuestions = async () => {
|
|
|
63
59
|
name: 'organization',
|
|
64
60
|
message: 'Enter component organization (required)',
|
|
65
61
|
default: organization,
|
|
66
|
-
validate:
|
|
62
|
+
validate: value => {
|
|
67
63
|
if (value) {
|
|
68
64
|
return true;
|
|
69
65
|
}
|
|
@@ -74,7 +70,7 @@ export const getLaunchPadFilterQuestions = async () => {
|
|
|
74
70
|
name: 'library',
|
|
75
71
|
message: 'Enter library name (required)',
|
|
76
72
|
default: library,
|
|
77
|
-
validate:
|
|
73
|
+
validate: value => {
|
|
78
74
|
if (value) {
|
|
79
75
|
return true;
|
|
80
76
|
}
|
|
@@ -82,7 +78,7 @@ export const getLaunchPadFilterQuestions = async () => {
|
|
|
82
78
|
}
|
|
83
79
|
}
|
|
84
80
|
];
|
|
85
|
-
}
|
|
81
|
+
}
|
|
86
82
|
|
|
87
83
|
export const listLocalComponents = async (sourceOfComponents) => {
|
|
88
84
|
let localComponents = await getComponents();
|
|
@@ -173,6 +169,8 @@ export const getComponentsFromServer = async (library, organization) => {
|
|
|
173
169
|
isLaunchpad ? LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT : LIST_COMPONENT_SERVICE_REST_ENDPOINT
|
|
174
170
|
);
|
|
175
171
|
|
|
172
|
+
|
|
173
|
+
|
|
176
174
|
return new Promise((resolve, reject) => {
|
|
177
175
|
try {
|
|
178
176
|
fs.readFile(TOKEN_PATH, 'utf8', (err, data) => {
|
|
@@ -190,12 +188,9 @@ export const getComponentsFromServer = async (library, organization) => {
|
|
|
190
188
|
|
|
191
189
|
fetchComponentsFromLaunchpad(url, headers)
|
|
192
190
|
.then((response) => {
|
|
193
|
-
response = response.filter(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
);
|
|
197
|
-
resolve(response);
|
|
198
|
-
})
|
|
191
|
+
response = response.filter(component => (component.library === library || library === "*" ) && (component.organization === organization || organization === "*"));
|
|
192
|
+
resolve(response); }
|
|
193
|
+
)
|
|
199
194
|
.catch((e) => reject(e));
|
|
200
195
|
} else {
|
|
201
196
|
headers.Authorization = `${tokenType} ${accessToken}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { Input
|
|
2
|
+
import { Input } from '@pega/cosmos-react-core';
|
|
3
3
|
|
|
4
4
|
import StyledPegaDxilMyTestTextWrapper from './styles';
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ import StyledPegaDxilMyTestTextWrapper from './styles';
|
|
|
9
9
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
10
10
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
11
11
|
const PegaDxilMyTestText = props => {
|
|
12
|
-
const { getPConnect, value, placeholder, disabled, readOnly, required, label, testId } = props;
|
|
12
|
+
const { getPConnect, value, placeholder, disabled, readOnly, required, label, hideLabel, testId } = props;
|
|
13
13
|
|
|
14
14
|
const pConn = getPConnect();
|
|
15
15
|
const actions = pConn.getActionsApi();
|
|
@@ -22,10 +22,11 @@ const PegaDxilMyTestText = props => {
|
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<StyledPegaDxilMyTestTextWrapper>
|
|
25
|
-
<Label>{label}</Label>
|
|
26
25
|
<Input
|
|
27
26
|
type='text'
|
|
28
27
|
value={value}
|
|
28
|
+
label={label}
|
|
29
|
+
labelHidden={hideLabel}
|
|
29
30
|
placeholder={placeholder}
|
|
30
31
|
disabled={disabled}
|
|
31
32
|
readOnly={readOnly}
|
|
@@ -43,7 +44,7 @@ PegaDxilMyTestText.defaultProps = {
|
|
|
43
44
|
disabled: false,
|
|
44
45
|
readOnly: false,
|
|
45
46
|
required: false,
|
|
46
|
-
testId:
|
|
47
|
+
testId: ''
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
PegaDxilMyTestText.propTypes = {
|
|
@@ -65,7 +65,7 @@ const PegaDxilMyBoolean = props => {
|
|
|
65
65
|
/>
|
|
66
66
|
);
|
|
67
67
|
|
|
68
|
-
const parentTestId = testId ? `${testId}-parent` : testId;
|
|
68
|
+
const parentTestId = testId === '' ? `${testId}-parent` : testId;
|
|
69
69
|
|
|
70
70
|
let displayComponent;
|
|
71
71
|
if (displayMode) {
|
|
@@ -138,13 +138,13 @@ PegaDxilMyBoolean.defaultProps = {
|
|
|
138
138
|
disabled: false,
|
|
139
139
|
readOnly: false,
|
|
140
140
|
required: false,
|
|
141
|
-
testId:
|
|
141
|
+
testId: '',
|
|
142
142
|
additionalProps: {},
|
|
143
143
|
displayMode: null,
|
|
144
144
|
variant: 'inline',
|
|
145
145
|
displayValue: 'Yes/No',
|
|
146
146
|
trueLabel: '',
|
|
147
|
-
falseLabel: ''
|
|
147
|
+
falseLabel: '',
|
|
148
148
|
};
|
|
149
149
|
|
|
150
150
|
PegaDxilMyBoolean.propTypes = {
|
|
@@ -182,6 +182,7 @@ const PegaDxilMyDate = props => {
|
|
|
182
182
|
</StyledPegaDxilMyDateWrapper>
|
|
183
183
|
);
|
|
184
184
|
} else {
|
|
185
|
+
|
|
185
186
|
dateComponent = (
|
|
186
187
|
<StyledPegaDxilMyDateWrapper>
|
|
187
188
|
<DateInput
|
|
@@ -222,7 +223,7 @@ PegaDxilMyDate.defaultProps = {
|
|
|
222
223
|
showWeekNumber: false,
|
|
223
224
|
nextYearRange: "",
|
|
224
225
|
previousYearRange: "",
|
|
225
|
-
testId:
|
|
226
|
+
testId: "",
|
|
226
227
|
showAsFormattedText: false,
|
|
227
228
|
additionalProps: {},
|
|
228
229
|
displayMode: null,
|
|
@@ -76,6 +76,7 @@ const PegaDxilMyEmail = props => {
|
|
|
76
76
|
const pConn = getPConnect();
|
|
77
77
|
const actions = pConn.getActionsApi();
|
|
78
78
|
const propName = pConn.getStateProps().value;
|
|
79
|
+
|
|
79
80
|
const hasValueChange = useRef(false);
|
|
80
81
|
|
|
81
82
|
|
|
@@ -199,7 +200,7 @@ PegaDxilMyEmail.defaultProps = {
|
|
|
199
200
|
disabled: false,
|
|
200
201
|
readOnly: false,
|
|
201
202
|
required: false,
|
|
202
|
-
testId:
|
|
203
|
+
testId: '',
|
|
203
204
|
displayMode: null,
|
|
204
205
|
additionalProps: {},
|
|
205
206
|
variant: 'inline',
|
|
@@ -133,6 +133,9 @@ export const basePegaDxilMyForm = () => {
|
|
|
133
133
|
getChildren: () => {
|
|
134
134
|
return pyReviewRaw.children;
|
|
135
135
|
},
|
|
136
|
+
getInheritedProps: () => {
|
|
137
|
+
return pyReviewRaw.config.inheritedProps;
|
|
138
|
+
},
|
|
136
139
|
createComponent: config => {
|
|
137
140
|
// eslint-disable-next-line default-case
|
|
138
141
|
switch (config.config.value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Grid } from '@pega/cosmos-react-core';
|
|
1
|
+
import { Grid, FieldGroup } from '@pega/cosmos-react-core';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
import StyledPegaDxilMyFormWrapper from './styles';
|
|
@@ -11,24 +11,30 @@ import StyledPegaDxilMyFormWrapper from './styles';
|
|
|
11
11
|
export default function PegaDxilMyForm(props) {
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
const { children, NumCols } = props;
|
|
14
|
+
const { children, NumCols, label, showLabel, getPConnect } = props;
|
|
15
|
+
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
15
16
|
|
|
16
17
|
const nCols = parseInt(NumCols, 10);
|
|
17
18
|
|
|
18
19
|
// console.log(`Rendering ${getPConnect()?.getComponentName()} with ${template} with ${children?.length} Region(s)`);
|
|
19
20
|
|
|
21
|
+
|
|
22
|
+
|
|
20
23
|
return (
|
|
21
24
|
<StyledPegaDxilMyFormWrapper>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
26
|
+
<Grid container={{
|
|
27
|
+
cols: `repeat(${nCols}, minmax(0, 1fr))`,
|
|
28
|
+
gap: 2,
|
|
29
|
+
wrap: `wrap`
|
|
30
|
+
}}>
|
|
31
|
+
{children}
|
|
32
|
+
</Grid>
|
|
33
|
+
</FieldGroup>
|
|
29
34
|
</StyledPegaDxilMyFormWrapper>
|
|
30
35
|
);
|
|
31
36
|
|
|
37
|
+
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
PegaDxilMyForm.defaultProps = {
|
|
@@ -46,6 +46,7 @@ const PegaDxilMyInteger = props => {
|
|
|
46
46
|
const propName = pConn.getStateProps().value;
|
|
47
47
|
const [integerValue, setIntegerValue] = useState(value?.toString());
|
|
48
48
|
const sliderDefaultValue = !defaultValue && defaultValue !== 0 ? max : defaultValue;
|
|
49
|
+
|
|
49
50
|
const hasValueChange = useRef(false);
|
|
50
51
|
|
|
51
52
|
|
|
@@ -272,7 +273,7 @@ PegaDxilMyInteger.defaultProps = {
|
|
|
272
273
|
disabled: false,
|
|
273
274
|
readOnly: false,
|
|
274
275
|
required: false,
|
|
275
|
-
testId:
|
|
276
|
+
testId: '',
|
|
276
277
|
showGroupSeparators: false,
|
|
277
278
|
displayMode: null,
|
|
278
279
|
displayAs: 'input',
|
|
@@ -80,7 +80,6 @@ const PegaDxilMyParagraph = props => {
|
|
|
80
80
|
const maxLength = fieldMetadata?.maxLength;
|
|
81
81
|
const hasValueChange = useRef(false);
|
|
82
82
|
|
|
83
|
-
|
|
84
83
|
// BUG-547602: Temporary type coercion for 8.5 until DXAPIs are enhanced to pass original pxViewMetadata JSON, respecting boolean primitives
|
|
85
84
|
let { readOnly, required, disabled } = props;
|
|
86
85
|
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
@@ -197,7 +196,7 @@ PegaDxilMyParagraph.defaultProps = {
|
|
|
197
196
|
disabled: false,
|
|
198
197
|
readOnly: false,
|
|
199
198
|
required: false,
|
|
200
|
-
testId:
|
|
199
|
+
testId: '',
|
|
201
200
|
displayMode: null,
|
|
202
201
|
fieldMetadata: {},
|
|
203
202
|
additionalProps: {},
|
|
@@ -42,6 +42,7 @@ const PegaDxilMyPercentage = props => {
|
|
|
42
42
|
const actions = pConn.getActionsApi();
|
|
43
43
|
const propName = pConn.getStateProps().value;
|
|
44
44
|
const [percentageValue, setPercentageValue] = useState(value?.toString());
|
|
45
|
+
|
|
45
46
|
const hasValueChange = useRef(false);
|
|
46
47
|
|
|
47
48
|
let { readOnly, required, disabled } = props;
|
|
@@ -237,7 +238,7 @@ PegaDxilMyPercentage.defaultProps = {
|
|
|
237
238
|
disabled: false,
|
|
238
239
|
readOnly: false,
|
|
239
240
|
required: false,
|
|
240
|
-
testId:
|
|
241
|
+
testId: '',
|
|
241
242
|
decimalPrecision: '',
|
|
242
243
|
showGroupSeparators: false,
|
|
243
244
|
additionalProps: {},
|
|
@@ -262,6 +262,7 @@ const PegaDxilMyPicklist = props => {
|
|
|
262
262
|
suggestionsHandler(accepted, pConnect, setStatus);
|
|
263
263
|
};
|
|
264
264
|
|
|
265
|
+
|
|
265
266
|
return (
|
|
266
267
|
<StyledPegaDxilMyPicklistWrapper>
|
|
267
268
|
<Select
|
|
@@ -305,7 +306,7 @@ PegaDxilMyPicklist.defaultProps = {
|
|
|
305
306
|
disabled: false,
|
|
306
307
|
readOnly: false,
|
|
307
308
|
required: false,
|
|
308
|
-
testId:
|
|
309
|
+
testId: '',
|
|
309
310
|
helperText: '',
|
|
310
311
|
datasource: [],
|
|
311
312
|
listType: '',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { Input
|
|
2
|
+
import { Input } from '@pega/cosmos-react-core';
|
|
3
3
|
|
|
4
4
|
import StyledPegaDxilMyTextWrapper from './styles';
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ import StyledPegaDxilMyTextWrapper from './styles';
|
|
|
9
9
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
10
10
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
11
11
|
const PegaDxilMyText = props => {
|
|
12
|
-
const { getPConnect, value, placeholder, disabled, readOnly, required, label, testId } = props;
|
|
12
|
+
const { getPConnect, value, placeholder, disabled, readOnly, required, label, hideLabel, testId } = props;
|
|
13
13
|
|
|
14
14
|
const pConn = getPConnect();
|
|
15
15
|
const actions = pConn.getActionsApi();
|
|
@@ -22,10 +22,11 @@ const PegaDxilMyText = props => {
|
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<StyledPegaDxilMyTextWrapper>
|
|
25
|
-
<Label>{label}</Label>
|
|
26
25
|
<Input
|
|
27
26
|
type='text'
|
|
28
27
|
value={value}
|
|
28
|
+
label={label}
|
|
29
|
+
labelHidden={hideLabel}
|
|
29
30
|
placeholder={placeholder}
|
|
30
31
|
disabled={disabled}
|
|
31
32
|
readOnly={readOnly}
|
|
@@ -43,7 +44,7 @@ PegaDxilMyText.defaultProps = {
|
|
|
43
44
|
disabled: false,
|
|
44
45
|
readOnly: false,
|
|
45
46
|
required: false,
|
|
46
|
-
testId:
|
|
47
|
+
testId: ''
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
PegaDxilMyText.propTypes = {
|
|
@@ -38,7 +38,6 @@ const PegaDxilMyTimeOfDay = props => {
|
|
|
38
38
|
const actions = pConn.getActionsApi();
|
|
39
39
|
const propName = pConn.getStateProps().value;
|
|
40
40
|
|
|
41
|
-
|
|
42
41
|
// BUG-547602: Temporary type coercion for 8.5 until DXAPIs are enhanced to pass original pxViewMetadata JSON, respecting boolean primitives
|
|
43
42
|
let { readOnly, required, disabled } = props;
|
|
44
43
|
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
@@ -183,11 +182,12 @@ PegaDxilMyTimeOfDay.defaultProps = {
|
|
|
183
182
|
required: false,
|
|
184
183
|
pickerInterval: "30",
|
|
185
184
|
clockFormat: 0,
|
|
186
|
-
testId:
|
|
185
|
+
testId: '',
|
|
187
186
|
additionalProps: {},
|
|
188
187
|
displayMode: null,
|
|
189
188
|
variant: "inline",
|
|
190
|
-
formatter:"defaultTime"
|
|
189
|
+
formatter:"defaultTime",
|
|
190
|
+
hasSuggestions: false
|
|
191
191
|
};
|
|
192
192
|
|
|
193
193
|
PegaDxilMyTimeOfDay.propTypes = {
|
|
@@ -207,7 +207,8 @@ PegaDxilMyTimeOfDay.propTypes = {
|
|
|
207
207
|
additionalProps: PropTypes.objectOf(PropTypes.any),
|
|
208
208
|
displayMode: PropTypes.string,
|
|
209
209
|
variant: PropTypes.string,
|
|
210
|
-
formatter : PropTypes.string
|
|
210
|
+
formatter : PropTypes.string,
|
|
211
|
+
hasSuggestions: PropTypes.bool
|
|
211
212
|
};
|
|
212
213
|
|
|
213
214
|
export default PegaDxilMyTimeOfDay;
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx
CHANGED
|
@@ -138,6 +138,9 @@ export const basePegaDxilMyTwoColumnForm = () => {
|
|
|
138
138
|
getChildren: () => {
|
|
139
139
|
return pyReviewRaw.children;
|
|
140
140
|
},
|
|
141
|
+
getInheritedProps: () => {
|
|
142
|
+
return pyReviewRaw.config.inheritedProps;
|
|
143
|
+
},
|
|
141
144
|
createComponent: config => {
|
|
142
145
|
// eslint-disable-next-line default-case
|
|
143
146
|
switch (config.config.value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Grid, Flex } from '@pega/cosmos-react-core';
|
|
1
|
+
import { Grid, Flex, FieldGroup } from '@pega/cosmos-react-core';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
import StyledPegaDxilMyTwoColumnFormWrapper from './styles';
|
|
@@ -11,7 +11,8 @@ import StyledPegaDxilMyTwoColumnFormWrapper from './styles';
|
|
|
11
11
|
export default function PegaDxilMyTwoColumnForm(props) {
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
const { children } = props;
|
|
14
|
+
const { children, label, showLabel, getPConnect } = props;
|
|
15
|
+
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
15
16
|
|
|
16
17
|
const numRegions = children?.length;
|
|
17
18
|
const gridRepeat = "repeat(".concat(numRegions).concat(", 1fr)");
|
|
@@ -24,13 +25,15 @@ export default function PegaDxilMyTwoColumnForm(props) {
|
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
27
|
<StyledPegaDxilMyTwoColumnFormWrapper>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
29
|
+
<Grid container={gridContainer}>
|
|
30
|
+
{children.map((child, i) => (
|
|
31
|
+
<Flex container={flexContainer} key={`r-${i + 1}`}>
|
|
32
|
+
{child}
|
|
33
|
+
</Flex>
|
|
34
|
+
))}
|
|
35
|
+
</Grid>
|
|
36
|
+
</FieldGroup>
|
|
34
37
|
</StyledPegaDxilMyTwoColumnFormWrapper>
|
|
35
38
|
);
|
|
36
39
|
|
|
@@ -65,7 +65,7 @@ const PegaDxilMyBoolean = props => {
|
|
|
65
65
|
/>
|
|
66
66
|
);
|
|
67
67
|
|
|
68
|
-
const parentTestId = testId ? `${testId}-parent` : testId;
|
|
68
|
+
const parentTestId = testId === '' ? `${testId}-parent` : testId;
|
|
69
69
|
|
|
70
70
|
let displayComponent;
|
|
71
71
|
if (displayMode) {
|
|
@@ -138,13 +138,13 @@ PegaDxilMyBoolean.defaultProps = {
|
|
|
138
138
|
disabled: false,
|
|
139
139
|
readOnly: false,
|
|
140
140
|
required: false,
|
|
141
|
-
testId:
|
|
141
|
+
testId: '',
|
|
142
142
|
additionalProps: {},
|
|
143
143
|
displayMode: null,
|
|
144
144
|
variant: 'inline',
|
|
145
145
|
displayValue: 'Yes/No',
|
|
146
146
|
trueLabel: '',
|
|
147
|
-
falseLabel: ''
|
|
147
|
+
falseLabel: '',
|
|
148
148
|
};
|
|
149
149
|
|
|
150
150
|
PegaDxilMyBoolean.propTypes = {
|
|
@@ -182,6 +182,7 @@ const PegaDxilMyDate = props => {
|
|
|
182
182
|
</StyledPegaDxilMyDateWrapper>
|
|
183
183
|
);
|
|
184
184
|
} else {
|
|
185
|
+
|
|
185
186
|
dateComponent = (
|
|
186
187
|
<StyledPegaDxilMyDateWrapper>
|
|
187
188
|
<DateInput
|
|
@@ -222,7 +223,7 @@ PegaDxilMyDate.defaultProps = {
|
|
|
222
223
|
showWeekNumber: false,
|
|
223
224
|
nextYearRange: "",
|
|
224
225
|
previousYearRange: "",
|
|
225
|
-
testId:
|
|
226
|
+
testId: "",
|
|
226
227
|
showAsFormattedText: false,
|
|
227
228
|
additionalProps: {},
|
|
228
229
|
displayMode: null,
|