@pega/custom-dx-components 23.1.12 → 23.1.13
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/package.json +1 -1
- package/src/cli.js +9 -3
- package/src/constants.js +5 -0
- package/src/tasks/build-jest-assets/index.js +171 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +1 -1
- package/src/tasks/index.js +1 -0
- package/src/tasks/init/template/package.json.mustache +2 -1
- package/src/tasks/publish/helper.js +6 -0
- package/src/tasks/publish-all/helper.js +6 -0
- package/src/util.js +45 -66
- package/tests/assets/components/create/_components.md +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/_components.md +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/_components.md +1 -0
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -18,7 +18,8 @@ import {
|
|
|
18
18
|
promoteWebPack,
|
|
19
19
|
updateComponent,
|
|
20
20
|
validate,
|
|
21
|
-
upgrade
|
|
21
|
+
upgrade,
|
|
22
|
+
buildJestAssets
|
|
22
23
|
} from './tasks/index.js';
|
|
23
24
|
|
|
24
25
|
const TASKS = {
|
|
@@ -36,9 +37,10 @@ const TASKS = {
|
|
|
36
37
|
VALIDATE_SCHEMA: 'validateSchema',
|
|
37
38
|
UPDATE: 'update',
|
|
38
39
|
DELETE: 'delete',
|
|
39
|
-
DELETE_ALL:
|
|
40
|
+
DELETE_ALL: 'deleteAll',
|
|
40
41
|
AUTHENTICATE: 'authenticate',
|
|
41
|
-
UPGRADE: 'upgrade'
|
|
42
|
+
UPGRADE: 'upgrade',
|
|
43
|
+
BUILD_JEST_ASSETS: 'buildJestAssets'
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
const parseArgumentsIntoOptions = rawArgs => {
|
|
@@ -132,6 +134,10 @@ export default async (args = []) => {
|
|
|
132
134
|
upgrade(options);
|
|
133
135
|
break;
|
|
134
136
|
}
|
|
137
|
+
case TASKS.BUILD_JEST_ASSETS: {
|
|
138
|
+
buildJestAssets(options);
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
135
141
|
default: {
|
|
136
142
|
console.log(chalk.red(`No task matched with ${task}`));
|
|
137
143
|
break;
|
package/src/constants.js
CHANGED
|
@@ -39,6 +39,11 @@ export const BUILDER_DIR_FILE_PATH = '../bundle/builder';
|
|
|
39
39
|
|
|
40
40
|
export const CATEGORY_CONSTELLATION = 'constellation';
|
|
41
41
|
|
|
42
|
+
export const JEST_ASSETS_PATH = 'node_modules/@pega/custom-dx-components/tests/assets/components/';
|
|
43
|
+
export const JEST_CREATE_PATH = 'create/';
|
|
44
|
+
export const JEST_CREATE_ALL_CONSTELLATION_PATH = 'createAll/Constellation/';
|
|
45
|
+
export const JEST_CREATE_ALL_LAUNCHPAD_PATH = 'createAll/Launchpad';
|
|
46
|
+
|
|
42
47
|
export const AUTHENTICATE_DEFAULTS = {
|
|
43
48
|
serverType: 'infinity',
|
|
44
49
|
server: 'https://localhost:1080/prweb',
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import inquirer from 'inquirer';
|
|
5
|
+
import { Listr } from 'listr2';
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
|
|
8
|
+
import { showVersion, getServerType, setServerType, getSubComponents, deleteLocalComponent, checkPathAccess, getComponents } from '../../util.js';
|
|
9
|
+
import createAll from '../create-all/index.js';
|
|
10
|
+
import create from '../create/index.js';
|
|
11
|
+
|
|
12
|
+
import { JEST_ASSETS_PATH, JEST_CREATE_PATH, JEST_CREATE_ALL_CONSTELLATION_PATH, JEST_CREATE_ALL_LAUNCHPAD_PATH, TASKS_CONFIG_JSON_FILENAME, COMPONENTS_DIRECTORY_PATH } from '../../constants.js';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const getBuildAssetsQuestions = async () => {
|
|
16
|
+
const message = "\n**IMPORTANT** Building Jest Assets will remove any local components in your components directory!\n";
|
|
17
|
+
console.log(`${chalk.green.bold(message)}`);
|
|
18
|
+
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
name: 'buildAssets',
|
|
22
|
+
type: 'confirm',
|
|
23
|
+
message: 'Generate Jest Assets ?',
|
|
24
|
+
default: false
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const deleteTestComponent = async(path, componentKey) => {
|
|
30
|
+
const directory = join(path, componentKey);
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
fs.rmSync(directory, { recursive: true });
|
|
34
|
+
console.log(`${chalk.red.bold(componentKey)} is deleted from assets`);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
console.log('no file');
|
|
37
|
+
throw new Error(`No such file ${componentKey}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const copyAssets = async(destinationPath) => {
|
|
42
|
+
const currentDirectory = process.cwd();
|
|
43
|
+
const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
44
|
+
|
|
45
|
+
await checkPathAccess(pegaConfigJsonPath);
|
|
46
|
+
|
|
47
|
+
let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
|
|
48
|
+
data = JSON.parse(data);
|
|
49
|
+
|
|
50
|
+
if (!data[COMPONENTS_DIRECTORY_PATH]) {
|
|
51
|
+
console.error(
|
|
52
|
+
`${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
|
|
53
|
+
);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const srcDir = join(currentDirectory, data[COMPONENTS_DIRECTORY_PATH]);
|
|
58
|
+
|
|
59
|
+
fs.cpSync(srcDir, destinationPath, { recursive: true});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const deleteAssets = async() => {
|
|
63
|
+
const currentDirectory = process.cwd();
|
|
64
|
+
const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
65
|
+
|
|
66
|
+
await checkPathAccess(pegaConfigJsonPath);
|
|
67
|
+
|
|
68
|
+
let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
|
|
69
|
+
data = JSON.parse(data);
|
|
70
|
+
|
|
71
|
+
if (!data[COMPONENTS_DIRECTORY_PATH]) {
|
|
72
|
+
console.error(
|
|
73
|
+
`${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
|
|
74
|
+
);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
const localComponents = await getComponents();
|
|
78
|
+
|
|
79
|
+
for (const index in localComponents) {
|
|
80
|
+
const componentToDelete = localComponents[index];
|
|
81
|
+
// console.log(chalk.bold.green("Deleting: " + componentToDelete));
|
|
82
|
+
// eslint-disable-next-line no-await-in-loop
|
|
83
|
+
const directory = join(currentDirectory, data[COMPONENTS_DIRECTORY_PATH], componentToDelete);
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
fs.rmSync(directory, { recursive: true });
|
|
87
|
+
console.log(`${chalk.red.bold(componentToDelete)} is deleted from Local`);
|
|
88
|
+
} catch (err) {
|
|
89
|
+
console.log('no file');
|
|
90
|
+
throw new Error(`No such file ${componentToDelete}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const createJestAssets = async(isLaunchPad = false) => {
|
|
96
|
+
|
|
97
|
+
// initially delete local assets
|
|
98
|
+
await deleteAssets();
|
|
99
|
+
|
|
100
|
+
// const framework = await getFramework();
|
|
101
|
+
let args = [ '','', '', 'My', '0.0.1', 'DXIL', '', 'Pega'];
|
|
102
|
+
let myOptions = {};
|
|
103
|
+
myOptions["params"] = args;
|
|
104
|
+
|
|
105
|
+
await createAll(myOptions);
|
|
106
|
+
|
|
107
|
+
const jestCreateAllPath = isLaunchPad ? JEST_CREATE_ALL_LAUNCHPAD_PATH : JEST_CREATE_ALL_CONSTELLATION_PATH;
|
|
108
|
+
|
|
109
|
+
// goto Constellation
|
|
110
|
+
// get current test assets and delete them
|
|
111
|
+
let createAllPath = path.join(path.resolve(), JEST_ASSETS_PATH, jestCreateAllPath);
|
|
112
|
+
const fileList = await getSubComponents(createAllPath, '');
|
|
113
|
+
|
|
114
|
+
for (const index in fileList) {
|
|
115
|
+
const componentToDelete = fileList[index];
|
|
116
|
+
// console.log(chalk.bold.green("Deleting: " + componentToDelete));
|
|
117
|
+
// eslint-disable-next-line no-await-in-loop
|
|
118
|
+
await deleteTestComponent(createAllPath, componentToDelete);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
await copyAssets(createAllPath);
|
|
122
|
+
await deleteAssets();
|
|
123
|
+
|
|
124
|
+
args = [ '','', '', 'Field', 'Text', 'MyTestText', 'My Test Text', '0.0.1','DXIL', '', 'My Test Text Description', 'Pega'];
|
|
125
|
+
myOptions = {};
|
|
126
|
+
myOptions["params"] = args;
|
|
127
|
+
|
|
128
|
+
await create(myOptions);
|
|
129
|
+
|
|
130
|
+
let createPath = path.join(path.resolve(), JEST_ASSETS_PATH, JEST_CREATE_PATH);
|
|
131
|
+
const myFileList = await getSubComponents(createPath, '');
|
|
132
|
+
|
|
133
|
+
for (const index in myFileList) {
|
|
134
|
+
const componentToDelete = myFileList[index];
|
|
135
|
+
// console.log(chalk.bold.green("Deleting: " + componentToDelete));
|
|
136
|
+
// eslint-disable-next-line no-await-in-loop
|
|
137
|
+
await deleteTestComponent(createPath, componentToDelete);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
await copyAssets(createPath);
|
|
141
|
+
await deleteAssets();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
export default async options => {
|
|
146
|
+
showVersion();
|
|
147
|
+
|
|
148
|
+
const questions = await getBuildAssetsQuestions();
|
|
149
|
+
const answers = await inquirer.prompt(questions);
|
|
150
|
+
const { buildAssets } = answers;
|
|
151
|
+
|
|
152
|
+
if (buildAssets) {
|
|
153
|
+
// get current server type
|
|
154
|
+
const savedServerType = await getServerType();
|
|
155
|
+
|
|
156
|
+
// Constellation
|
|
157
|
+
await setServerType("infinity");
|
|
158
|
+
await createJestAssets(false);
|
|
159
|
+
|
|
160
|
+
//Launchpad
|
|
161
|
+
await setServerType("launchpad");
|
|
162
|
+
await createJestAssets(true);
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
// restore serverType
|
|
166
|
+
await setServerType(savedServerType);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
};
|
|
@@ -104,7 +104,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
107
|
-
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComponent </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
107
|
+
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComponent} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
if (displayMode === "LABELS_LEFT") {
|
|
@@ -175,7 +175,7 @@ function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
175
175
|
);
|
|
176
176
|
switch(displayMode){
|
|
177
177
|
case 'DISPLAY_ONLY': {
|
|
178
|
-
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
178
|
+
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
179
179
|
}
|
|
180
180
|
case "LABELS_LEFT" : {
|
|
181
181
|
return (
|
|
@@ -181,7 +181,7 @@ function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
181
181
|
);
|
|
182
182
|
switch (displayMode) {
|
|
183
183
|
case 'DISPLAY_ONLY': {
|
|
184
|
-
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
184
|
+
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
185
185
|
}
|
|
186
186
|
case 'LABELS_LEFT': {
|
|
187
187
|
return (
|
|
@@ -161,7 +161,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
161
161
|
|
|
162
162
|
switch (displayMode) {
|
|
163
163
|
case 'DISPLAY_ONLY': {
|
|
164
|
-
return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
164
|
+
return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
165
165
|
}
|
|
166
166
|
case 'LABELS_LEFT': {
|
|
167
167
|
return (
|
|
@@ -192,7 +192,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
192
192
|
|
|
193
193
|
switch (displayMode) {
|
|
194
194
|
case 'DISPLAY_ONLY': {
|
|
195
|
-
return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>) ;
|
|
195
|
+
return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>) ;
|
|
196
196
|
}
|
|
197
197
|
case 'LABELS_LEFT': {
|
|
198
198
|
return (
|
package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache
CHANGED
|
@@ -168,7 +168,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
168
168
|
|
|
169
169
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
170
170
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
171
|
-
displayComp
|
|
171
|
+
{displayComp}
|
|
172
172
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
173
173
|
) : (
|
|
174
174
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -187,7 +187,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
187
187
|
|
|
188
188
|
switch (displayMode) {
|
|
189
189
|
case 'DISPLAY_ONLY': {
|
|
190
|
-
return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
190
|
+
return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
191
191
|
}
|
|
192
192
|
case 'LABELS_LEFT': {
|
|
193
193
|
return (
|
|
@@ -256,7 +256,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
256
256
|
|
|
257
257
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
258
258
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
259
|
-
displayComp
|
|
259
|
+
{displayComp}
|
|
260
260
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
261
261
|
) : (
|
|
262
262
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -128,7 +128,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
128
128
|
}
|
|
129
129
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
130
130
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
131
|
-
displayComp
|
|
131
|
+
{displayComp}
|
|
132
132
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
133
133
|
) : (
|
|
134
134
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -143,7 +143,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
143
143
|
displayComp = textFormatter(formatter, value);
|
|
144
144
|
}
|
|
145
145
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
146
|
-
<Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
146
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
147
147
|
) : (
|
|
148
148
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
149
149
|
<FieldValueList
|
|
@@ -126,7 +126,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
126
126
|
}
|
|
127
127
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
128
128
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
129
|
-
displayComp
|
|
129
|
+
{displayComp}
|
|
130
130
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
131
131
|
) : (
|
|
132
132
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -164,7 +164,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
164
164
|
}
|
|
165
165
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
166
166
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
167
|
-
displayComp
|
|
167
|
+
{displayComp}
|
|
168
168
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
169
169
|
) : (
|
|
170
170
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -140,7 +140,7 @@ function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
140
140
|
);
|
|
141
141
|
switch (displayMode) {
|
|
142
142
|
case 'DISPLAY_ONLY': {
|
|
143
|
-
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
143
|
+
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
144
144
|
}
|
|
145
145
|
case 'LABELS_LEFT': {
|
|
146
146
|
return (
|
package/src/tasks/index.js
CHANGED
|
@@ -15,3 +15,4 @@ export { default as authenticate } from './authenticate/index.js';
|
|
|
15
15
|
export { default as upgrade } from './upgrade/index.js';
|
|
16
16
|
export { default as buildComponent } from './build-comp/index.js';
|
|
17
17
|
export { default as buildAllComponents } from './build-all/index.js';
|
|
18
|
+
export { default as buildJestAssets } from './build-jest-assets/index.js';
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"_internal-test-full": "npm run _internal-test-functional && npm run _internal-test-unit",
|
|
29
29
|
"_internal-test-functional": "npm run test:functional:local --prefix node_modules/@pega/custom-dx-components",
|
|
30
30
|
"_internal-test-unit": "npm run test:unit:local --prefix node_modules/@pega/custom-dx-components",
|
|
31
|
+
"_internal-build-jest-assets": "custom-dx-components buildJestAssets",
|
|
31
32
|
"_lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
|
|
32
33
|
"_lint:format": "prettier -c .",
|
|
33
34
|
"_lint:spelling": "cspell --no-progress **/*",
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@pega/configs": "^0.6.0",
|
|
71
|
-
"@pega/custom-dx-components": "23.1.
|
|
72
|
+
"@pega/custom-dx-components": "23.1.13",
|
|
72
73
|
"@pega/pcore-pconnect-typedefs": "~2.1.1",
|
|
73
74
|
"@storybook/addon-actions": "^7.6.7",
|
|
74
75
|
"@storybook/addon-essentials": "^7.6.7",
|
|
@@ -84,11 +84,17 @@ export const zipComponent = async componentKey => {
|
|
|
84
84
|
const srcDirectory = await getComponentDirectoryPath(componentKey);
|
|
85
85
|
const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
|
|
86
86
|
const configJson = `${srcDirectory}/config.json`;
|
|
87
|
+
const localizationJson = `${srcDirectory}/localizations.json`;
|
|
87
88
|
|
|
88
89
|
const zip = new AdmZip();
|
|
89
90
|
|
|
90
91
|
zip.addLocalFolder(srcDirectory, 'src/');
|
|
91
92
|
zip.addLocalFile(configJson);
|
|
93
|
+
|
|
94
|
+
if (fs.existsSync(localizationJson)) {
|
|
95
|
+
zip.addLocalFile(localizationJson);
|
|
96
|
+
}
|
|
97
|
+
|
|
92
98
|
zip.addLocalFolder(buildDirectory);
|
|
93
99
|
const zipContent = zip.toBuffer().toString('base64');
|
|
94
100
|
|
|
@@ -70,11 +70,17 @@ export const zipComponent = async componentKey => {
|
|
|
70
70
|
const srcDirectory = await getComponentDirectoryPath(componentKey);
|
|
71
71
|
const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
|
|
72
72
|
const configJson = `${srcDirectory}/config.json`;
|
|
73
|
+
const localizationJson = `${srcDirectory}/localizations.json`;
|
|
73
74
|
|
|
74
75
|
const zip = new AdmZip();
|
|
75
76
|
|
|
76
77
|
zip.addLocalFolder(srcDirectory, 'src/');
|
|
77
78
|
zip.addLocalFile(configJson);
|
|
79
|
+
|
|
80
|
+
if (fs.existsSync(localizationJson)) {
|
|
81
|
+
zip.addLocalFile(localizationJson);
|
|
82
|
+
}
|
|
83
|
+
|
|
78
84
|
zip.addLocalFolder(buildDirectory);
|
|
79
85
|
const zipContent = zip.toBuffer().toString('base64');
|
|
80
86
|
|
package/src/util.js
CHANGED
|
@@ -33,14 +33,12 @@ export const checkPathAccess = async (path, options = {}, throwError = false) =>
|
|
|
33
33
|
} catch (err) {
|
|
34
34
|
if (throwError) {
|
|
35
35
|
throw new Error(err);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
36
|
+
} else {
|
|
38
37
|
const message =
|
|
39
38
|
errorMessage || `${chalk.red.bold('ERROR')} Could not able to access path - ${path}`;
|
|
40
39
|
console.error(message);
|
|
41
40
|
process.exit(1);
|
|
42
41
|
}
|
|
43
|
-
|
|
44
42
|
}
|
|
45
43
|
};
|
|
46
44
|
|
|
@@ -51,8 +49,7 @@ export const getUseWebPackPromotion = async () => {
|
|
|
51
49
|
try {
|
|
52
50
|
// force to throw error and not console log
|
|
53
51
|
await checkPathAccess(pegaConfigJsonPath, {}, true);
|
|
54
|
-
}
|
|
55
|
-
catch (ex) {
|
|
52
|
+
} catch (ex) {
|
|
56
53
|
// when can't find it, always be false, assume no webpack override.
|
|
57
54
|
// This is IMPORTANT for init (npx install)
|
|
58
55
|
return false;
|
|
@@ -75,10 +72,9 @@ export const getUseWebPackPromotion = async () => {
|
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
return data[USE_PROMOTED_WEB_PACK];
|
|
75
|
+
};
|
|
78
76
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export const updateUseWebPackPromotion = async ( useValue = false ) => {
|
|
77
|
+
export const updateUseWebPackPromotion = async (useValue = false) => {
|
|
82
78
|
const currentDirectory = process.cwd();
|
|
83
79
|
const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
84
80
|
|
|
@@ -94,11 +90,10 @@ export const updateUseWebPackPromotion = async ( useValue = false ) => {
|
|
|
94
90
|
process.exit(1);
|
|
95
91
|
}
|
|
96
92
|
|
|
97
|
-
data
|
|
93
|
+
data.usePromotedWebPack = useValue;
|
|
98
94
|
|
|
99
95
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8' });
|
|
100
|
-
|
|
101
|
-
}
|
|
96
|
+
};
|
|
102
97
|
|
|
103
98
|
export const deleteLocalComponent = async componentKey => {
|
|
104
99
|
const currentDirectory = process.cwd();
|
|
@@ -262,6 +257,23 @@ export const getComponentDefaults = async () => {
|
|
|
262
257
|
return config.component;
|
|
263
258
|
};
|
|
264
259
|
|
|
260
|
+
export const getServerType = async () => {
|
|
261
|
+
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
262
|
+
return defaultPegaServerConfig.serverType;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
export const setServerType = async serverType => {
|
|
266
|
+
const currentDirectory = process.cwd();
|
|
267
|
+
const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
268
|
+
const configData = await getPegaConfig();
|
|
269
|
+
const serverConfig = configData['server-config'];
|
|
270
|
+
serverConfig.serverType = serverType;
|
|
271
|
+
|
|
272
|
+
// update file
|
|
273
|
+
// stringify "4", makes the json string look like JSON in the file, formated instead of a single line
|
|
274
|
+
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8' });
|
|
275
|
+
};
|
|
276
|
+
|
|
265
277
|
export const getComponentDirectoryPath = async componentKey => {
|
|
266
278
|
const currentDirectory = process.cwd();
|
|
267
279
|
const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
@@ -435,55 +447,37 @@ export const deleteInfinityServerComponent = async componentKey => {
|
|
|
435
447
|
status = response.status;
|
|
436
448
|
if (!response.ok) {
|
|
437
449
|
if (status === 401) {
|
|
438
|
-
throw new Error(
|
|
439
|
-
'Error occurred in authentication. Please regenerate using authenticate'
|
|
440
|
-
);
|
|
450
|
+
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
441
451
|
// console.log(accessTokenUri, refreshToken);
|
|
442
452
|
/* TODO - Handle refresh_token */
|
|
443
|
-
}
|
|
444
|
-
else if (status === 404){
|
|
453
|
+
} else if (status === 404) {
|
|
445
454
|
throw new Error('404: Server resource not found');
|
|
446
|
-
}
|
|
447
|
-
else if (status === 405){
|
|
455
|
+
} else if (status === 405) {
|
|
448
456
|
throw new Error('405: Server method not allowed');
|
|
449
|
-
}
|
|
450
|
-
else if (status === 408){
|
|
457
|
+
} else if (status === 408) {
|
|
451
458
|
throw new Error('408: Server timed out');
|
|
459
|
+
} else if (response.status === 403) {
|
|
460
|
+
throw new Error('Error forbidden: User does not have privileges to Publish.');
|
|
452
461
|
}
|
|
453
|
-
else if (response.status === 403) {
|
|
454
|
-
throw new Error(
|
|
455
|
-
'Error forbidden: User does not have privileges to Publish.'
|
|
456
|
-
);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
|
|
460
462
|
}
|
|
461
463
|
|
|
462
464
|
try {
|
|
463
465
|
const respData = await response.json();
|
|
464
|
-
console.log(
|
|
465
|
-
chalk.bold.green(`Success : ${respData.message}`)
|
|
466
|
-
);
|
|
466
|
+
console.log(chalk.bold.green(`Success : ${respData.message}`));
|
|
467
467
|
|
|
468
468
|
if (status === 500) {
|
|
469
469
|
status = 999;
|
|
470
470
|
throw new Error(respData.message);
|
|
471
471
|
}
|
|
472
|
-
}
|
|
473
|
-
catch (err) {
|
|
472
|
+
} catch (err) {
|
|
474
473
|
if (status === 500) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
else if (status === 999) {
|
|
480
|
-
throw new Error (err);
|
|
474
|
+
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
475
|
+
} else if (status === 999) {
|
|
476
|
+
throw new Error(err);
|
|
481
477
|
}
|
|
482
478
|
}
|
|
483
|
-
|
|
484
479
|
}
|
|
485
480
|
} catch (error) {
|
|
486
|
-
|
|
487
481
|
throw new Error(error);
|
|
488
482
|
}
|
|
489
483
|
};
|
|
@@ -515,7 +509,6 @@ export const deleteLaunchpadServerComponent = async componentKey => {
|
|
|
515
509
|
componentName
|
|
516
510
|
};
|
|
517
511
|
|
|
518
|
-
|
|
519
512
|
const response = await fetch(deleteUrl, {
|
|
520
513
|
method: 'DELETE',
|
|
521
514
|
agent: new https.Agent({ rejectUnauthorized: false }),
|
|
@@ -526,47 +519,33 @@ export const deleteLaunchpadServerComponent = async componentKey => {
|
|
|
526
519
|
status = response.status;
|
|
527
520
|
if (!response.ok) {
|
|
528
521
|
if (status === 401) {
|
|
529
|
-
throw new Error(
|
|
530
|
-
'Error occurred in authentication. Please regenerate using authenticate'
|
|
531
|
-
);
|
|
522
|
+
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
532
523
|
// console.log(accessTokenUri, refreshToken);
|
|
533
524
|
/* TODO - Handle refresh_token */
|
|
534
|
-
}
|
|
535
|
-
else if (status === 404){
|
|
525
|
+
} else if (status === 404) {
|
|
536
526
|
throw new Error('404: Server resource not found');
|
|
537
|
-
}
|
|
538
|
-
else if (status === 405){
|
|
527
|
+
} else if (status === 405) {
|
|
539
528
|
throw new Error('405: Server method not allowed');
|
|
540
|
-
}
|
|
541
|
-
else if (status === 408){
|
|
529
|
+
} else if (status === 408) {
|
|
542
530
|
throw new Error('408: Server timed out');
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
throw new Error(
|
|
546
|
-
'Error forbidden: User does not have privileges to Publish.'
|
|
547
|
-
);
|
|
531
|
+
} else if (response.status === 403) {
|
|
532
|
+
throw new Error('Error forbidden: User does not have privileges to Publish.');
|
|
548
533
|
}
|
|
549
534
|
}
|
|
550
535
|
|
|
551
536
|
try {
|
|
552
537
|
const respData = await response.text();
|
|
553
|
-
console.log(
|
|
554
|
-
chalk.bold.green(`Success : ${respData}`)
|
|
555
|
-
);
|
|
538
|
+
console.log(chalk.bold.green(`Success : ${respData}`));
|
|
556
539
|
|
|
557
540
|
if (status === 500) {
|
|
558
541
|
status = 999;
|
|
559
542
|
throw new Error(respData.message);
|
|
560
543
|
}
|
|
561
|
-
}
|
|
562
|
-
catch (err) {
|
|
544
|
+
} catch (err) {
|
|
563
545
|
if (status === 500) {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
}
|
|
568
|
-
else if (status === 999) {
|
|
569
|
-
throw new Error (err);
|
|
546
|
+
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
547
|
+
} else if (status === 999) {
|
|
548
|
+
throw new Error(err);
|
|
570
549
|
}
|
|
571
550
|
}
|
|
572
551
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# directory for components #
|
|
@@ -104,7 +104,7 @@ function PegaDxilMyBoolean(props: PegaDxilMyBooleanProps) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
107
|
-
return ( <StyledPegaDxilMyBooleanWrapper> displayComponent </StyledPegaDxilMyBooleanWrapper>);
|
|
107
|
+
return ( <StyledPegaDxilMyBooleanWrapper> {displayComponent} </StyledPegaDxilMyBooleanWrapper>);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
if (displayMode === "LABELS_LEFT") {
|
|
@@ -189,7 +189,7 @@ function PegaDxilMyCurrency(props: PegaDxilMyCurrencyProps) {
|
|
|
189
189
|
|
|
190
190
|
switch (displayMode) {
|
|
191
191
|
case 'DISPLAY_ONLY': {
|
|
192
|
-
return (<StyledPegaDxilMyCurrencyWrapper> displayComp </StyledPegaDxilMyCurrencyWrapper>) ;
|
|
192
|
+
return (<StyledPegaDxilMyCurrencyWrapper> {displayComp} </StyledPegaDxilMyCurrencyWrapper>) ;
|
|
193
193
|
}
|
|
194
194
|
case 'LABELS_LEFT': {
|
|
195
195
|
return (
|
|
@@ -175,7 +175,7 @@ function PegaDxilMyDate (props: PegaDxilMyDateProps) {
|
|
|
175
175
|
);
|
|
176
176
|
switch(displayMode){
|
|
177
177
|
case 'DISPLAY_ONLY': {
|
|
178
|
-
return ( <StyledPegaDxilMyDateWrapper> displayComp </StyledPegaDxilMyDateWrapper>);
|
|
178
|
+
return ( <StyledPegaDxilMyDateWrapper> {displayComp} </StyledPegaDxilMyDateWrapper>);
|
|
179
179
|
}
|
|
180
180
|
case "LABELS_LEFT" : {
|
|
181
181
|
return (
|
|
@@ -181,7 +181,7 @@ function PegaDxilMyDateTime (props: PegaDxilMyDateTimeProps) {
|
|
|
181
181
|
);
|
|
182
182
|
switch (displayMode) {
|
|
183
183
|
case 'DISPLAY_ONLY': {
|
|
184
|
-
return ( <StyledPegaDxilMyDateTimeWrapper> displayComp </StyledPegaDxilMyDateTimeWrapper>);
|
|
184
|
+
return ( <StyledPegaDxilMyDateTimeWrapper> {displayComp} </StyledPegaDxilMyDateTimeWrapper>);
|
|
185
185
|
}
|
|
186
186
|
case 'LABELS_LEFT': {
|
|
187
187
|
return (
|
|
@@ -158,7 +158,7 @@ function PegaDxilMyDecimal(props: PegaDxilMyDecimalProps) {
|
|
|
158
158
|
|
|
159
159
|
switch (displayMode) {
|
|
160
160
|
case 'DISPLAY_ONLY': {
|
|
161
|
-
return (<StyledPegaDxilMyDecimalWrapper> displayComp </StyledPegaDxilMyDecimalWrapper>);
|
|
161
|
+
return (<StyledPegaDxilMyDecimalWrapper> {displayComp} </StyledPegaDxilMyDecimalWrapper>);
|
|
162
162
|
}
|
|
163
163
|
case 'LABELS_LEFT': {
|
|
164
164
|
return (
|
|
@@ -128,7 +128,7 @@ function PegaDxilMyEmail(props: PegaDxilMyEmailProps) {
|
|
|
128
128
|
}
|
|
129
129
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
130
130
|
<StyledPegaDxilMyEmailWrapper>
|
|
131
|
-
displayComp
|
|
131
|
+
{displayComp}
|
|
132
132
|
</StyledPegaDxilMyEmailWrapper>
|
|
133
133
|
) : (
|
|
134
134
|
<StyledPegaDxilMyEmailWrapper>
|
|
@@ -184,7 +184,7 @@ function PegaDxilMyInteger(props: PegaDxilMyIntegerProps) {
|
|
|
184
184
|
|
|
185
185
|
switch (displayMode) {
|
|
186
186
|
case 'DISPLAY_ONLY': {
|
|
187
|
-
return (<StyledPegaDxilMyIntegerWrapper> displayComp </StyledPegaDxilMyIntegerWrapper>);
|
|
187
|
+
return (<StyledPegaDxilMyIntegerWrapper> {displayComp} </StyledPegaDxilMyIntegerWrapper>);
|
|
188
188
|
}
|
|
189
189
|
case 'LABELS_LEFT': {
|
|
190
190
|
return (
|
|
@@ -126,7 +126,7 @@ function PegaDxilMyParagraph(props: PegaDxilMyParagraphProps) {
|
|
|
126
126
|
}
|
|
127
127
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
128
128
|
<StyledPegaDxilMyParagraphWrapper>
|
|
129
|
-
displayComp
|
|
129
|
+
{displayComp}
|
|
130
130
|
</StyledPegaDxilMyParagraphWrapper>
|
|
131
131
|
) : (
|
|
132
132
|
<StyledPegaDxilMyParagraphWrapper>
|
|
@@ -165,7 +165,7 @@ function PegaDxilMyPercentage(props: PegaDxilMyPercentageProps) {
|
|
|
165
165
|
|
|
166
166
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
167
167
|
<StyledPegaDxilMyPercentageWrapper>
|
|
168
|
-
displayComp
|
|
168
|
+
{displayComp}
|
|
169
169
|
</StyledPegaDxilMyPercentageWrapper>
|
|
170
170
|
) : (
|
|
171
171
|
<StyledPegaDxilMyPercentageWrapper>
|
|
@@ -164,7 +164,7 @@ function PegaDxilMyPhone(props: PegaDxilMyPhoneProps) {
|
|
|
164
164
|
}
|
|
165
165
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
166
166
|
<StyledPegaDxilMyPhoneWrapper>
|
|
167
|
-
displayComp
|
|
167
|
+
{displayComp}
|
|
168
168
|
</StyledPegaDxilMyPhoneWrapper>
|
|
169
169
|
) : (
|
|
170
170
|
<StyledPegaDxilMyPhoneWrapper>
|
|
@@ -256,7 +256,7 @@ function PegaDxilMyPicklist(props: PegaDxilMyPicklistProps) {
|
|
|
256
256
|
|
|
257
257
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
258
258
|
<StyledPegaDxilMyPicklistWrapper>
|
|
259
|
-
displayComp
|
|
259
|
+
{displayComp}
|
|
260
260
|
</StyledPegaDxilMyPicklistWrapper>
|
|
261
261
|
) : (
|
|
262
262
|
<StyledPegaDxilMyPicklistWrapper>
|
|
@@ -143,7 +143,7 @@ function PegaDxilMyTextInput(props: PegaDxilMyTextInputProps) {
|
|
|
143
143
|
displayComp = textFormatter(formatter, value);
|
|
144
144
|
}
|
|
145
145
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
146
|
-
<StyledPegaDxilMyTextInputWrapper> displayComp </StyledPegaDxilMyTextInputWrapper>
|
|
146
|
+
<StyledPegaDxilMyTextInputWrapper> {displayComp} </StyledPegaDxilMyTextInputWrapper>
|
|
147
147
|
) : (
|
|
148
148
|
<StyledPegaDxilMyTextInputWrapper>
|
|
149
149
|
<FieldValueList
|
|
@@ -140,7 +140,7 @@ function PegaDxilMyTimeOfDay (props: PegaDxilMyTimeOfDayProps) {
|
|
|
140
140
|
);
|
|
141
141
|
switch (displayMode) {
|
|
142
142
|
case 'DISPLAY_ONLY': {
|
|
143
|
-
return ( <StyledPegaDxilMyTimeOfDayWrapper> displayComp </StyledPegaDxilMyTimeOfDayWrapper>);
|
|
143
|
+
return ( <StyledPegaDxilMyTimeOfDayWrapper> {displayComp} </StyledPegaDxilMyTimeOfDayWrapper>);
|
|
144
144
|
}
|
|
145
145
|
case 'LABELS_LEFT': {
|
|
146
146
|
return (
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# directory for components #
|
|
@@ -104,7 +104,7 @@ function PegaDxilMyBoolean(props: PegaDxilMyBooleanProps) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
107
|
-
return ( <StyledPegaDxilMyBooleanWrapper> displayComponent </StyledPegaDxilMyBooleanWrapper>);
|
|
107
|
+
return ( <StyledPegaDxilMyBooleanWrapper> {displayComponent} </StyledPegaDxilMyBooleanWrapper>);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
if (displayMode === "LABELS_LEFT") {
|
|
@@ -189,7 +189,7 @@ function PegaDxilMyCurrency(props: PegaDxilMyCurrencyProps) {
|
|
|
189
189
|
|
|
190
190
|
switch (displayMode) {
|
|
191
191
|
case 'DISPLAY_ONLY': {
|
|
192
|
-
return (<StyledPegaDxilMyCurrencyWrapper> displayComp </StyledPegaDxilMyCurrencyWrapper>) ;
|
|
192
|
+
return (<StyledPegaDxilMyCurrencyWrapper> {displayComp} </StyledPegaDxilMyCurrencyWrapper>) ;
|
|
193
193
|
}
|
|
194
194
|
case 'LABELS_LEFT': {
|
|
195
195
|
return (
|
|
@@ -175,7 +175,7 @@ function PegaDxilMyDate (props: PegaDxilMyDateProps) {
|
|
|
175
175
|
);
|
|
176
176
|
switch(displayMode){
|
|
177
177
|
case 'DISPLAY_ONLY': {
|
|
178
|
-
return ( <StyledPegaDxilMyDateWrapper> displayComp </StyledPegaDxilMyDateWrapper>);
|
|
178
|
+
return ( <StyledPegaDxilMyDateWrapper> {displayComp} </StyledPegaDxilMyDateWrapper>);
|
|
179
179
|
}
|
|
180
180
|
case "LABELS_LEFT" : {
|
|
181
181
|
return (
|
|
@@ -181,7 +181,7 @@ function PegaDxilMyDateTime (props: PegaDxilMyDateTimeProps) {
|
|
|
181
181
|
);
|
|
182
182
|
switch (displayMode) {
|
|
183
183
|
case 'DISPLAY_ONLY': {
|
|
184
|
-
return ( <StyledPegaDxilMyDateTimeWrapper> displayComp </StyledPegaDxilMyDateTimeWrapper>);
|
|
184
|
+
return ( <StyledPegaDxilMyDateTimeWrapper> {displayComp} </StyledPegaDxilMyDateTimeWrapper>);
|
|
185
185
|
}
|
|
186
186
|
case 'LABELS_LEFT': {
|
|
187
187
|
return (
|
|
@@ -158,7 +158,7 @@ function PegaDxilMyDecimal(props: PegaDxilMyDecimalProps) {
|
|
|
158
158
|
|
|
159
159
|
switch (displayMode) {
|
|
160
160
|
case 'DISPLAY_ONLY': {
|
|
161
|
-
return (<StyledPegaDxilMyDecimalWrapper> displayComp </StyledPegaDxilMyDecimalWrapper>);
|
|
161
|
+
return (<StyledPegaDxilMyDecimalWrapper> {displayComp} </StyledPegaDxilMyDecimalWrapper>);
|
|
162
162
|
}
|
|
163
163
|
case 'LABELS_LEFT': {
|
|
164
164
|
return (
|
|
@@ -128,7 +128,7 @@ function PegaDxilMyEmail(props: PegaDxilMyEmailProps) {
|
|
|
128
128
|
}
|
|
129
129
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
130
130
|
<StyledPegaDxilMyEmailWrapper>
|
|
131
|
-
displayComp
|
|
131
|
+
{displayComp}
|
|
132
132
|
</StyledPegaDxilMyEmailWrapper>
|
|
133
133
|
) : (
|
|
134
134
|
<StyledPegaDxilMyEmailWrapper>
|
|
@@ -184,7 +184,7 @@ function PegaDxilMyInteger(props: PegaDxilMyIntegerProps) {
|
|
|
184
184
|
|
|
185
185
|
switch (displayMode) {
|
|
186
186
|
case 'DISPLAY_ONLY': {
|
|
187
|
-
return (<StyledPegaDxilMyIntegerWrapper> displayComp </StyledPegaDxilMyIntegerWrapper>);
|
|
187
|
+
return (<StyledPegaDxilMyIntegerWrapper> {displayComp} </StyledPegaDxilMyIntegerWrapper>);
|
|
188
188
|
}
|
|
189
189
|
case 'LABELS_LEFT': {
|
|
190
190
|
return (
|
|
@@ -126,7 +126,7 @@ function PegaDxilMyParagraph(props: PegaDxilMyParagraphProps) {
|
|
|
126
126
|
}
|
|
127
127
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
128
128
|
<StyledPegaDxilMyParagraphWrapper>
|
|
129
|
-
displayComp
|
|
129
|
+
{displayComp}
|
|
130
130
|
</StyledPegaDxilMyParagraphWrapper>
|
|
131
131
|
) : (
|
|
132
132
|
<StyledPegaDxilMyParagraphWrapper>
|
|
@@ -165,7 +165,7 @@ function PegaDxilMyPercentage(props: PegaDxilMyPercentageProps) {
|
|
|
165
165
|
|
|
166
166
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
167
167
|
<StyledPegaDxilMyPercentageWrapper>
|
|
168
|
-
displayComp
|
|
168
|
+
{displayComp}
|
|
169
169
|
</StyledPegaDxilMyPercentageWrapper>
|
|
170
170
|
) : (
|
|
171
171
|
<StyledPegaDxilMyPercentageWrapper>
|
|
@@ -164,7 +164,7 @@ function PegaDxilMyPhone(props: PegaDxilMyPhoneProps) {
|
|
|
164
164
|
}
|
|
165
165
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
166
166
|
<StyledPegaDxilMyPhoneWrapper>
|
|
167
|
-
displayComp
|
|
167
|
+
{displayComp}
|
|
168
168
|
</StyledPegaDxilMyPhoneWrapper>
|
|
169
169
|
) : (
|
|
170
170
|
<StyledPegaDxilMyPhoneWrapper>
|
|
@@ -256,7 +256,7 @@ function PegaDxilMyPicklist(props: PegaDxilMyPicklistProps) {
|
|
|
256
256
|
|
|
257
257
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
258
258
|
<StyledPegaDxilMyPicklistWrapper>
|
|
259
|
-
displayComp
|
|
259
|
+
{displayComp}
|
|
260
260
|
</StyledPegaDxilMyPicklistWrapper>
|
|
261
261
|
) : (
|
|
262
262
|
<StyledPegaDxilMyPicklistWrapper>
|
|
@@ -143,7 +143,7 @@ function PegaDxilMyTextInput(props: PegaDxilMyTextInputProps) {
|
|
|
143
143
|
displayComp = textFormatter(formatter, value);
|
|
144
144
|
}
|
|
145
145
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
146
|
-
<StyledPegaDxilMyTextInputWrapper> displayComp </StyledPegaDxilMyTextInputWrapper>
|
|
146
|
+
<StyledPegaDxilMyTextInputWrapper> {displayComp} </StyledPegaDxilMyTextInputWrapper>
|
|
147
147
|
) : (
|
|
148
148
|
<StyledPegaDxilMyTextInputWrapper>
|
|
149
149
|
<FieldValueList
|
|
@@ -140,7 +140,7 @@ function PegaDxilMyTimeOfDay (props: PegaDxilMyTimeOfDayProps) {
|
|
|
140
140
|
);
|
|
141
141
|
switch (displayMode) {
|
|
142
142
|
case 'DISPLAY_ONLY': {
|
|
143
|
-
return ( <StyledPegaDxilMyTimeOfDayWrapper> displayComp </StyledPegaDxilMyTimeOfDayWrapper>);
|
|
143
|
+
return ( <StyledPegaDxilMyTimeOfDayWrapper> {displayComp} </StyledPegaDxilMyTimeOfDayWrapper>);
|
|
144
144
|
}
|
|
145
145
|
case 'LABELS_LEFT': {
|
|
146
146
|
return (
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# directory for components #
|