@pega/custom-dx-components 2.0.23 → 2.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +3 -6
- package/src/cli.js +0 -18
- package/src/constants.js +2 -32
- package/src/tasks/authenticate/helper.js +5 -63
- package/src/tasks/authenticate/index.js +50 -107
- package/src/tasks/create/index.js +63 -59
- package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +16 -33
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +67 -179
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +17 -46
- package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +1 -3
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/{date-utils.js.mustache → date-utils.js} +0 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +17 -46
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +17 -22
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +17 -26
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +4 -3
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +17 -22
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +2 -8
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +17 -22
- package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +16 -50
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +1 -44
- package/src/tasks/create/templates/Constellation/Field/Picklist/picklist.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +16 -23
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +17 -21
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +2 -44
- package/src/tasks/create/templates/Constellation/Field/Text-Email/text-email.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/{StatusWork.jsx → StatusWork.js} +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +17 -21
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +3 -46
- package/src/tasks/create/templates/Constellation/Field/Text-Input/text-input.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +17 -21
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +2 -44
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/text-paragraph.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +17 -19
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +3 -47
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/text-phone.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +17 -19
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-URL/{text-url.jsx.mustache → text-url.js.mustache} +1 -2
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +17 -30
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +29 -14
- package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +77 -3
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +29 -14
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache +74 -3
- package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +10 -6
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +8 -10
- package/src/tasks/create/templates/Constellation/Template/PAGE/{GetNextWork.jsx.mustache → GetNextWork.js.mustache} +0 -6
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +7 -9
- package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +1 -4
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Avatar.jsx.mustache → Avatar.js.mustache} +0 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Operator.jsx.mustache → Operator.js.mustache} +1 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +9 -9
- package/src/tasks/delete/helper.js +0 -4
- package/src/tasks/delete/index.js +0 -4
- package/src/tasks/index.js +0 -3
- package/src/tasks/init/index.js +3 -3
- package/src/tasks/init/template/.eslintrc.json +5 -186
- package/src/tasks/init/template/README.md +59 -75
- package/src/tasks/init/template/package.json.mustache +6 -21
- package/src/tasks/init/template/tasks.config.json +2 -5
- package/src/tasks/list/index.js +0 -4
- package/src/tasks/{bundle → publish/bundle}/builder/webpack.config.js +2 -0
- package/src/tasks/{bundle → publish/bundle}/index.js +2 -2
- package/src/tasks/publish/index.js +1 -14
- package/src/util.js +6 -11
- package/src/auth.js +0 -563
- package/src/tasks/build/helper.js +0 -123
- package/src/tasks/build/index.js +0 -54
- package/src/tasks/create/templates/Constellation/Field/Boolean/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +0 -61
- package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +0 -41
- package/src/tasks/create/templates/Constellation/Field/Date/mock.stories.js.mustache +0 -23
- package/src/tasks/create/templates/Constellation/Field/DateTime/mock.stories.js.mustache +0 -23
- package/src/tasks/create/templates/Constellation/Field/Decimal/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.stories.js.mustache +0 -23
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Integer/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Picklist/mock.stories.js.mustache +0 -67
- package/src/tasks/create/templates/Constellation/Field/Text/mock.stories.js.mustache +0 -13
- package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.stories.js.mustache +0 -22
- package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.stories.js.mustache +0 -20
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.stories.js.mustache +0 -37
- package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.stories.js.mustache +0 -22
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/mock.stories.js.mustache +0 -20
- package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.jsx.mustache +0 -26
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +0 -118
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.stories.js.mustache +0 -179
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.jsx.mustache +0 -26
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +0 -123
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.stories.js.mustache +0 -215
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +0 -93
- package/src/tasks/create/templates/Constellation/Template/FORM/mock.stories.js.mustache +0 -125
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +0 -100
- package/src/tasks/create/templates/Constellation/Template/FORM-region/mock.stories.js.mustache +0 -131
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.jsx.mustache +0 -101
- package/src/tasks/create/templates/Constellation/Template/PAGE/mock.stories.js.mustache +0 -94
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.jsx.mustache +0 -78
- package/src/tasks/create/templates/Constellation/Widget/CASE/mock.stories.js.mustache +0 -390
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.jsx.mustache +0 -30
- package/src/tasks/create/templates/Constellation/Widget/PAGE/mock.stories.js.mustache +0 -23
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.jsx.mustache +0 -68
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.stories.js.mustache +0 -51
- package/src/tasks/delete-all/helper.js +0 -175
- package/src/tasks/delete-all/index.js +0 -49
- package/src/tasks/init/template/.eslintignore +0 -8
- package/src/tasks/linter/index.js +0 -46
- package/src/tasks/publish-all/helper.js +0 -139
- package/src/tasks/publish-all/index.js +0 -84
- /package/src/tasks/{bundle → publish/bundle}/builder/index.js +0 -0
- /package/src/tasks/{bundle → publish/bundle}/builder/modules.js +0 -0
- /package/src/tasks/{bundle → publish/bundle}/builder/paths.js +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { Fragment } from 'react';
|
|
1
|
+
import { Fragment, memo } from 'react';
|
|
3
2
|
import { DateTimeDisplay, Card, CardHeader, CardContent, Flex } from '@pega/cosmos-react-core';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
|
|
6
5
|
// includes in bundle
|
|
7
|
-
import Operator from './Operator
|
|
6
|
+
import Operator from './Operator';
|
|
8
7
|
|
|
9
8
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
10
9
|
|
|
@@ -28,7 +27,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
|
|
|
28
27
|
resolveLabel,
|
|
29
28
|
resolveOperator,
|
|
30
29
|
resolveDateTime,
|
|
31
|
-
hideLabel
|
|
30
|
+
hideLabel,
|
|
31
|
+
defVal
|
|
32
32
|
} = props;
|
|
33
33
|
|
|
34
34
|
|
|
@@ -84,13 +84,13 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
|
|
|
84
84
|
resolveLabel: null,
|
|
85
85
|
resolveOperator: null,
|
|
86
86
|
resolveDateTime: null,
|
|
87
|
-
hideLabel: false
|
|
87
|
+
hideLabel: false,
|
|
88
|
+
defVal: '––'
|
|
88
89
|
};
|
|
89
90
|
|
|
90
91
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
91
92
|
getPConnect: PropTypes.func.isRequired,
|
|
92
93
|
label: PropTypes.string,
|
|
93
|
-
title: PropTypes.string,
|
|
94
94
|
createLabel: PropTypes.string,
|
|
95
95
|
updateLabel: PropTypes.string,
|
|
96
96
|
resolveLabel: PropTypes.string,
|
|
@@ -105,6 +105,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
|
|
|
105
105
|
|
|
106
106
|
// as objects are there in props, shallow comparision fails & re-rendering of comp happens even with
|
|
107
107
|
// same key value pairs in obj. hence using custom comparison function on when to re-render
|
|
108
|
-
//
|
|
109
|
-
//
|
|
110
|
-
//
|
|
108
|
+
//const comparisonFn = (prevProps, nextProps) => {
|
|
109
|
+
// return prevProps.updateDateTime === nextProps.updateDateTime;
|
|
110
|
+
//};
|
|
@@ -13,8 +13,6 @@ import {
|
|
|
13
13
|
} from '../../util.js';
|
|
14
14
|
import { getComponentsFromServer } from '../list/helper.js';
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
16
|
export const SOURCE_OF_COMPONENT_TYPES = {
|
|
19
17
|
SERVER: 'Server',
|
|
20
18
|
LOCAL: 'Local'
|
|
@@ -94,8 +92,6 @@ export const deleteServerComponents = async (sourceOfComponents, answers) => {
|
|
|
94
92
|
choices: choicesArr
|
|
95
93
|
});
|
|
96
94
|
await deleteServerComponent(answers.componentToDelete);
|
|
97
|
-
|
|
98
|
-
|
|
99
95
|
} else {
|
|
100
96
|
console.log(chalk.bold.redBright(`No custom components in ${sourceOfComponents}`));
|
|
101
97
|
}
|
|
@@ -9,8 +9,6 @@ import {
|
|
|
9
9
|
getDeleteComponentsQuestions
|
|
10
10
|
} from './helper.js';
|
|
11
11
|
|
|
12
|
-
import { showVersion } from '../../util.js';
|
|
13
|
-
|
|
14
12
|
const deleteComponentsFn = async (sourceOfComponents, answers) => {
|
|
15
13
|
switch (sourceOfComponents) {
|
|
16
14
|
case SOURCE_OF_COMPONENT_TYPES.LOCAL: {
|
|
@@ -29,8 +27,6 @@ const deleteComponentsFn = async (sourceOfComponents, answers) => {
|
|
|
29
27
|
};
|
|
30
28
|
|
|
31
29
|
export default async options => {
|
|
32
|
-
showVersion();
|
|
33
|
-
|
|
34
30
|
let sourceOfComponentsOption = SOURCE_OF_COMPONENT_TYPES.LOCAL;
|
|
35
31
|
if (options.params[3] === SOURCE_OF_COMPONENT_TYPES.LOCAL) {
|
|
36
32
|
sourceOfComponentsOption = options.params[3];
|
package/src/tasks/index.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export { default as createComponent } from './create/index.js';
|
|
2
2
|
export { default as deleteComponent } from './delete/index.js';
|
|
3
|
-
export { default as deleteAllComponents } from './delete-all/index.js';
|
|
4
3
|
export { default as initProject } from './init/index.js';
|
|
5
4
|
export { default as publishComponent } from './publish/index.js';
|
|
6
|
-
export { default as publishAllComponents } from './publish-all/index.js';
|
|
7
5
|
export { default as listComponents } from './list/index.js';
|
|
8
6
|
export { default as updateComponent } from './update/index.js';
|
|
9
7
|
export { default as validate } from './validator/index.js';
|
|
10
8
|
export { default as authenticate } from './authenticate/index.js';
|
|
11
9
|
export { default as upgrade } from './upgrade/index.js';
|
|
12
|
-
export { default as buildComponent } from './build/index.js';
|
package/src/tasks/init/index.js
CHANGED
|
@@ -123,7 +123,7 @@ export default async options => {
|
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
title: installDependenciesText,
|
|
126
|
-
task: () => execPromise('npm i --
|
|
126
|
+
task: () => execPromise('npm i --production=false', { cwd: options.targetDirectory })
|
|
127
127
|
}
|
|
128
128
|
],
|
|
129
129
|
{
|
|
@@ -140,7 +140,7 @@ export default async options => {
|
|
|
140
140
|
'\n',
|
|
141
141
|
`Inside that directory, you can run several commands:`,
|
|
142
142
|
'\n\n',
|
|
143
|
-
`${chalk.blueBright('npm
|
|
143
|
+
`${chalk.blueBright('npm start')}`,
|
|
144
144
|
`\n Start Storybook in development mode`,
|
|
145
145
|
'\n\n',
|
|
146
146
|
`${chalk.blueBright('npm run create')}`,
|
|
@@ -158,7 +158,7 @@ export default async options => {
|
|
|
158
158
|
'\n\n',
|
|
159
159
|
`${chalk.blueBright('cd')} ${chalk.bold(projectName)}`,
|
|
160
160
|
'\n',
|
|
161
|
-
`${chalk.blueBright('npm
|
|
161
|
+
`${chalk.blueBright('npm start')}`,
|
|
162
162
|
'\n'
|
|
163
163
|
);
|
|
164
164
|
return true;
|
|
@@ -1,191 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"root": true,
|
|
3
2
|
"extends": ["@pega"],
|
|
4
|
-
"parserOptions": {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
"settings": {
|
|
9
|
-
"import/resolver": {
|
|
10
|
-
"typescript": {},
|
|
11
|
-
"node": {
|
|
12
|
-
"extensions": [".js", ".jsx"]
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"react": {
|
|
16
|
-
"version": "detect"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"ignorePatterns": ["node_modules", "packages/*/lib", "!.storybook", ".storybook/public"],
|
|
3
|
+
"parserOptions": { "project": "tsconfig.json" },
|
|
4
|
+
"root": true,
|
|
5
|
+
"ignorePatterns": ["node_modules", "lib", "!.storybook", ".storybook/public"],
|
|
20
6
|
"rules": {
|
|
21
|
-
// Prettier recommends running separately from a linter.
|
|
22
|
-
// https://prettier.io/docs/en/integrating-with-linters.html#notes
|
|
23
7
|
"prettier/prettier": "off",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"sonarjs/cognitive-complexity": "off",
|
|
27
|
-
"sonarjs/no-identical-functions": "off",
|
|
28
|
-
"sonarjs/no-duplicate-string": "off",
|
|
29
|
-
"sonarjs/no-nested-template-literals": "off",
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
// JA - Override some default lint handling here
|
|
33
|
-
"@typescript-eslint/array-type": ["error", { "default": "generic" }],
|
|
34
|
-
// "import/extensions": ["warn", "never"], // Turning off for now (see below)
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
// Initial release: turning these off; phase in to "warn" or "error" over time
|
|
38
|
-
// For "quotes" and "@typescript-eslint/quotes", see override below for .ts/.tsx files
|
|
39
|
-
"import/extensions": ["off", "never"],
|
|
40
|
-
"import/named": "off",
|
|
41
|
-
"import/no-cycle": "off",
|
|
42
|
-
"import/no-duplicates": "off",
|
|
43
|
-
"import/no-extraneous-dependencies": "off",
|
|
44
|
-
"import/no-named-as-default": "off",
|
|
45
|
-
"import/no-named-as-default-member": "off",
|
|
46
|
-
"import/no-self-import": "off",
|
|
47
|
-
"import/no-unresolved": "off",
|
|
48
|
-
"import/no-useless-path-segments": "off",
|
|
49
|
-
"import/order": "off",
|
|
50
|
-
|
|
51
|
-
"no-else-return": "off",
|
|
52
|
-
"no-restricted-syntax": "off",
|
|
53
|
-
"no-underscore-dangle": "off",
|
|
54
|
-
|
|
55
|
-
"jsx-a11y/alt-text": "off",
|
|
56
|
-
"jsx-a11y/anchor-is-valid": "off",
|
|
57
|
-
"jsx-a11y/click-events-have-key-events": "off",
|
|
58
|
-
"jsx-a11y/label-has-associated-control": "off",
|
|
59
|
-
"jsx-a11y/no-static-element-interactions": "off",
|
|
60
|
-
|
|
61
|
-
"react/jsx-fragments": "off",
|
|
62
|
-
"react/jsx-no-bind": "off",
|
|
63
|
-
"react/self-closing-comp": "off",
|
|
64
|
-
|
|
65
|
-
"sonarjs/prefer-immediate-return": "off",
|
|
66
|
-
|
|
67
|
-
"@typescript-eslint/dot-notation": "off", // prefer warn but needs different parserOptions
|
|
68
|
-
"@typescript-eslint/naming-convention": "off", // prefer warn but needs different parserOptions
|
|
69
|
-
"@typescript-eslint/ban-types": "off", // also, see override below
|
|
70
|
-
|
|
71
|
-
//
|
|
72
|
-
// Initial release: set to error
|
|
73
|
-
"@typescript-eslint/no-inferrable-types": "error",
|
|
74
|
-
"eqeqeq": "error",
|
|
75
|
-
"no-alert": "error",
|
|
76
|
-
"no-console": "error",
|
|
77
|
-
"no-fallthrough": "error",
|
|
78
|
-
"no-undef": "error",
|
|
79
|
-
"no-unused-vars": "error",
|
|
80
|
-
"no-var": "error",
|
|
81
|
-
"prefer-const": "error",
|
|
82
|
-
"yoda": "error",
|
|
83
|
-
|
|
84
|
-
"import/no-mutable-exports": "error",
|
|
85
|
-
"sonarjs/max-switch-cases": "error",
|
|
86
|
-
"sonarjs/no-collapsible-if": "error",
|
|
87
|
-
"sonarjs/no-all-duplicated-branches": "error",
|
|
88
|
-
"sonarjs/no-duplicated-branches": "error",
|
|
89
|
-
"sonarjs/no-gratuitous-expressions": "error",
|
|
90
|
-
"sonarjs/no-ignored-return": "error",
|
|
91
|
-
"sonarjs/no-small-switch": "error",
|
|
92
|
-
"sonarjs/prefer-object-literal": "error",
|
|
93
|
-
"sonarjs/prefer-single-boolean-return": "error",
|
|
94
|
-
"@typescript-eslint/no-shadow": "error",
|
|
95
|
-
"react/default-props-match-prop-types": "error",
|
|
96
|
-
"react/no-unescaped-entities": "error",
|
|
97
|
-
"react/no-unused-prop-types": "error",
|
|
98
|
-
"react/static-property-placement": "error",
|
|
99
|
-
"array-callback-return": "error",
|
|
100
|
-
"camelcase": "error",
|
|
101
|
-
"default-case": "error",
|
|
102
|
-
"func-names": "error",
|
|
103
|
-
"no-case-declarations": "error",
|
|
104
|
-
"no-lonely-if": "error",
|
|
105
|
-
"no-nested-ternary": "error",
|
|
106
|
-
"no-plusplus": "error",
|
|
107
|
-
"no-restricted-globals": "error",
|
|
108
|
-
"no-restricted-properties": "error",
|
|
109
|
-
"no-shadow": "error",
|
|
110
|
-
"radix": "error",
|
|
111
|
-
"spaced-comment": "error",
|
|
112
|
-
|
|
113
|
-
"import/newline-after-import": "error",
|
|
114
|
-
"sonarjs/no-nested-switch": "error",
|
|
115
|
-
"@typescript-eslint/no-array-constructor": "error",
|
|
116
|
-
"@typescript-eslint/no-empty-function": "error",
|
|
117
|
-
"@typescript-eslint/no-unused-vars": "error",
|
|
118
|
-
"@typescript-eslint/no-useless-constructor": "error",
|
|
119
|
-
"react/button-has-type": "error",
|
|
120
|
-
"react/jsx-curly-brace-presence": "error",
|
|
121
|
-
"react/jsx-boolean-value": "error",
|
|
122
|
-
"react/no-array-index-key": "error",
|
|
123
|
-
"class-methods-use-this": "error",
|
|
124
|
-
"guard-for-in": "error",
|
|
125
|
-
"no-unneeded-ternary": "error",
|
|
126
|
-
"no-unused-expressions": "error",
|
|
127
|
-
"operator-assignment": "error",
|
|
128
|
-
"prefer-template": "error",
|
|
129
|
-
"vars-on-top": "error",
|
|
130
|
-
|
|
131
|
-
"no-use-before-define": "off", // doc for @typescript-eslint/no-use-before-define says to turn off the base implementation
|
|
132
|
-
"@typescript-eslint/no-use-before-define": "error"
|
|
133
|
-
},
|
|
134
|
-
"overrides": [
|
|
135
|
-
{
|
|
136
|
-
"files": "*.@(ts|tsx)",
|
|
137
|
-
"rules": {
|
|
138
|
-
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
139
|
-
// "@typescript-eslint/ban-types": [
|
|
140
|
-
// "warn",
|
|
141
|
-
// {
|
|
142
|
-
// "types": {
|
|
143
|
-
// "Omit": "Please use the 'OmitStrict' type from 'src/types/' instead.",
|
|
144
|
-
// "object": false,
|
|
145
|
-
// "Function": false
|
|
146
|
-
// },
|
|
147
|
-
// "extendDefaults": true
|
|
148
|
-
// }
|
|
149
|
-
// ],
|
|
150
|
-
|
|
151
|
-
"quotes": "off",
|
|
152
|
-
"@typescript-eslint/quotes": "off"
|
|
153
|
-
// [
|
|
154
|
-
// "error",
|
|
155
|
-
// "single",
|
|
156
|
-
// {
|
|
157
|
-
// "avoidEscape": true,
|
|
158
|
-
// "allowTemplateLiterals": false
|
|
159
|
-
// }
|
|
160
|
-
// ]
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
"files": "*.@(jsx|tsx|mdx)",
|
|
165
|
-
"rules": {
|
|
166
|
-
"react/react-in-jsx-scope": "off",
|
|
167
|
-
// Set up configuration for future sweep
|
|
168
|
-
"react-hooks/exhaustive-deps": [
|
|
169
|
-
"off",
|
|
170
|
-
{
|
|
171
|
-
"additionalHooks": "useAfterInitialEffect"
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
"files": "*.@(js|jsx|ts|tsx|mdx)",
|
|
178
|
-
"rules": {}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"files": ".storybook/*.js",
|
|
182
|
-
"extends": ["@pega/eslint-config/script"]
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
"files": "*/**/mocks/**.@(mocks|styles).@(tsx|ts)",
|
|
186
|
-
"rules": {
|
|
187
|
-
"import/prefer-default-export": ["off"]
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
]
|
|
8
|
+
"react/react-in-jsx-scope": "off"
|
|
9
|
+
}
|
|
191
10
|
}
|
|
@@ -12,9 +12,9 @@ Ensure you have access to the following in your system:
|
|
|
12
12
|
|
|
13
13
|
- Git version 2.30 or later
|
|
14
14
|
|
|
15
|
-
- System node version
|
|
15
|
+
- System node version 16
|
|
16
16
|
|
|
17
|
-
- System npm version
|
|
17
|
+
- System npm version 7
|
|
18
18
|
|
|
19
19
|
## Initialize a project
|
|
20
20
|
|
|
@@ -22,12 +22,12 @@ Initialize the project by performing the following procedure in a terminal:
|
|
|
22
22
|
|
|
23
23
|
1. Enter the following command to initialize the project.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Pega 8.7 - `npx @pega/custom-dx-components@1 init`
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Pega 8.8 - `npx @pega/custom-dx-components@2 init`
|
|
28
28
|
|
|
29
29
|
2. If prompted, enter `y` to install the Custom UI Components package.
|
|
30
|
-
|
|
30
|
+
You will then be asked to set up the project by entering the required details.
|
|
31
31
|
|
|
32
32
|
3. Enter the following details:
|
|
33
33
|
- Name of the project (required)
|
|
@@ -41,7 +41,7 @@ Example - `This project is intended to create and publish a custom component.`
|
|
|
41
41
|
- Git repository URL (optional)
|
|
42
42
|
Example - `https://git.custom-components.io/custom-cc.git`
|
|
43
43
|
- Author (optional)
|
|
44
|
-
|
|
44
|
+
Example - `Michelle`
|
|
45
45
|
|
|
46
46
|
The workspace is now set up to create custom components and publish them to the server.
|
|
47
47
|
|
|
@@ -50,7 +50,7 @@ The workspace is now set up to create custom components and publish them to the
|
|
|
50
50
|
Create custom components using the following procedure:
|
|
51
51
|
|
|
52
52
|
1. Enter the following command to create a component:
|
|
53
|
-
|
|
53
|
+
`npm run create`
|
|
54
54
|
You will then be asked to enter or review the following details of the component:
|
|
55
55
|
- Name of the component (required)
|
|
56
56
|
Example - `customcomp0`
|
|
@@ -65,22 +65,21 @@ Example - `Field`
|
|
|
65
65
|
- Sub-type of component (required)
|
|
66
66
|
Example - `Text`
|
|
67
67
|
- Description of the component (optional)
|
|
68
|
-
|
|
68
|
+
Example - `This is a customized searchbox that filters data.`
|
|
69
69
|
The component is created in the following path: _/Users/your_user_name/project_name/src/components/component_name_
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"icon": "basic-field-text.svg"
|
|
81
|
-
}
|
|
70
|
+
You can also pre-configure the values for the above options in a tasks.config.json file as shown below.
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"component": {
|
|
75
|
+
"library": "basic",
|
|
76
|
+
"type": "field",
|
|
77
|
+
"subtype": "text",
|
|
78
|
+
"description": "basic field for capturing textual data",
|
|
79
|
+
"icon": "basic-field-text.svg"
|
|
82
80
|
}
|
|
83
|
-
|
|
81
|
+
}
|
|
82
|
+
```
|
|
84
83
|
>**Note**:
|
|
85
84
|
Alternatively, you can enter the following command to skip entering the details of the component now and can manually enter the details in the config.json file after the component is created:
|
|
86
85
|
`npm run create <enter_component_name>`
|
|
@@ -103,19 +102,13 @@ The *config.json* file contains the mapping of properties for configuring the au
|
|
|
103
102
|
|
|
104
103
|
|
|
105
104
|
2. Enter the following command to start the storybook to view the demo.
|
|
106
|
-
|
|
105
|
+
`npm start`
|
|
107
106
|
|
|
108
107
|
3. Modify the source files to build your own component. You can also install and import third-party libraries if required for your component.
|
|
109
108
|
|
|
110
109
|
The custom component is now created. We use the information provided to create uniquely namespaced components in this convention - `<organization>_<library>_<component name>`.
|
|
111
110
|
|
|
112
|
-
4. local build, you can build the component locally to check for config validation and component validation. Enter
|
|
113
|
-
`npm buildComponent`
|
|
114
|
-
|
|
115
|
-
buildComponent will do the same first 2 steps as publish, but will not publish to the server. This allows you to compile your component locally and fix errors before publish.
|
|
116
|
-
|
|
117
111
|
## Authenticate the user
|
|
118
|
-
|
|
119
112
|
Before we publish the custom component to the Pega Infinity Server, authenticate the user to access the resources in the Pega Infinity Server.
|
|
120
113
|
|
|
121
114
|
>**Note**:
|
|
@@ -123,57 +116,53 @@ It is required that you configure a value for clientId, clientSecret, and access
|
|
|
123
116
|
1. Login to Pega Infinity Server, navigate to Records / Security / OAuth 2.0 Client Registration landing page and open the *DX-CustomComponents* record.
|
|
124
117
|
2. Click **Regenerate Client Secret**, download the Client Credentials (as the Client ID, Client Secret, and Access token endpoint will be needed), and save the record.
|
|
125
118
|
3. Update the the task.config.json file with these downloaded values:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
```json
|
|
120
|
+
"server-config": {
|
|
121
|
+
"server": "https://127.0.0.1:8080/prweb",
|
|
122
|
+
"user": "customcomponentoperator",
|
|
123
|
+
"password": "pwd",
|
|
124
|
+
"clientId": "<mention client ID here>",
|
|
125
|
+
"clientSecret": "<mention client secret here>",
|
|
126
|
+
"accessTokenUri": "https://127.0.0.1:8080/prweb/PRRestService/oauth2/v1/token"
|
|
127
|
+
},
|
|
128
|
+
```
|
|
136
129
|
4. Enter the following command to initiate authentication.
|
|
137
|
-
|
|
130
|
+
`npm run authenticate`
|
|
138
131
|
|
|
139
132
|
The user is now authenticated and can proceed to either publish or list the components.
|
|
140
133
|
|
|
141
134
|
## Publish custom components
|
|
142
135
|
Enter the following command to publish custom components to Pega Infinity Server:
|
|
143
136
|
`npm run publish`
|
|
144
|
-
`npm run publishAll`
|
|
145
137
|
Publish the finalized custom components changes to Pega Infinity Server so that it can be discoverable in authoring (design palette).
|
|
146
138
|
You will then be asked to enter the following details:
|
|
147
139
|
|
|
148
140
|
- The component to be published to Pega Infinity Server. It will be updated if the component exists.
|
|
149
|
-
- If publishAll, then you won't get a list
|
|
150
141
|
- The name of the ruleset where the component must be published.
|
|
151
142
|
- The version of the ruleset where the component must be published.
|
|
152
143
|
- Specify if the development build should be generated for debugging.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
"sourceOfComponents": "Server",
|
|
166
|
-
"devBuild": false,
|
|
167
|
-
}
|
|
144
|
+
You can also pre-configure the values for the above options in a tasks.config.json file as shown below. The server, user name, and password must be pre-configured.
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"components-server-config": {
|
|
149
|
+
"server": "http://127.0.0.1:8080/prweb",
|
|
150
|
+
"user": "customcomponentoperator",
|
|
151
|
+
"password": "pwd"
|
|
152
|
+
"rulesetName": "TestPega-C11nGall",
|
|
153
|
+
"rulesetVersion": "01-01-03",
|
|
154
|
+
"sourceOfComponents": "Server",
|
|
155
|
+
"devBuild": false,
|
|
168
156
|
}
|
|
169
|
-
|
|
170
|
-
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
When the component is successfully published, you can use the newly published component in App Studio's view authoring.
|
|
171
160
|
|
|
172
|
-
> **Note**:
|
|
173
|
-
> The Rule-UI-Component instance (with component name) is created on the Pega Infinity Server after publishing the component.
|
|
174
161
|
|
|
175
|
-
|
|
162
|
+
>**Note**:
|
|
163
|
+
The Rule-UI-Component instance (with component name) is created on the Pega Infinity Server after publishing the component.
|
|
176
164
|
|
|
165
|
+
## List custom components
|
|
177
166
|
View the available components in the local machine or the server.
|
|
178
167
|
|
|
179
168
|
Enter the following command to list custom components:
|
|
@@ -182,42 +171,37 @@ Enter the following command to list custom components:
|
|
|
182
171
|
You will then be asked to enter the following details:
|
|
183
172
|
|
|
184
173
|
- List components from Server or Local?
|
|
185
|
-
|
|
174
|
+
Example - `Server`
|
|
186
175
|
|
|
187
176
|
The custom components will now be listed in the terminal.
|
|
188
177
|
|
|
189
178
|
## Delete custom components
|
|
190
|
-
|
|
191
179
|
Delete the available or published components in the local machine or the server.
|
|
192
180
|
|
|
193
181
|
Enter the following command to delete custom components:
|
|
194
182
|
`npm run delete`
|
|
195
|
-
`npm run deleteAll`
|
|
196
183
|
|
|
197
184
|
You will then be asked to enter the following details:
|
|
198
185
|
|
|
199
186
|
- Delete components from Server or Local?
|
|
200
|
-
|
|
187
|
+
Example - `Local`
|
|
201
188
|
|
|
202
189
|
- Select component to delete
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
- For deleteAll you will see the full list and asked if you want to delete them all.
|
|
190
|
+
The list of available components in the following path will be displayed: _/Users/your_user_name/project_name/src/components
|
|
191
|
+
Select the component to be deleted from this list.
|
|
206
192
|
|
|
207
193
|
- Are you sure?
|
|
208
|
-
|
|
194
|
+
Example - `yes`
|
|
209
195
|
|
|
210
|
-
|
|
211
|
-
|
|
196
|
+
>**Note**:
|
|
197
|
+
If you choose to delete components from the server, the successfully published components along with their ruleset name and ruleset version from the Pega Infinity Server will be displayed. Select the component to be deleted from this list.
|
|
212
198
|
|
|
213
199
|
## View existing custom components in storybook
|
|
214
|
-
|
|
215
200
|
View custom components in a storybook by performing the following procedure:
|
|
216
|
-
|
|
217
201
|
1. Enter the following command to open the project.
|
|
218
|
-
|
|
202
|
+
`cd <enter your project's name>`
|
|
219
203
|
|
|
220
204
|
2. Enter the following command to start the storybook in development mode.
|
|
221
|
-
|
|
205
|
+
`npm start`
|
|
222
206
|
|
|
223
207
|
The storybook is launched in a browser where you can view the components working in isolation.
|
|
@@ -5,20 +5,17 @@
|
|
|
5
5
|
"organization": "{{organization}}",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start
|
|
8
|
+
"start": "start-storybook --port 6040 --quiet",
|
|
9
9
|
"build": "tsc -b tsconfig.build.json",
|
|
10
10
|
"lint": "run-p -cl lint:*",
|
|
11
11
|
"fix": "run-p -cl fix:*",
|
|
12
12
|
"authenticate": "custom-dx-components authenticate",
|
|
13
|
-
"buildComponent": "custom-dx-components buildComponent",
|
|
14
13
|
"create": "custom-dx-components create",
|
|
15
14
|
"publish": "custom-dx-components publish",
|
|
16
|
-
"publishAll": "custom-dx-components publishAll",
|
|
17
15
|
"list": "custom-dx-components list",
|
|
18
16
|
"validate-schema": "custom-dx-components validateSchema",
|
|
19
17
|
"update": "custom-dx-components update",
|
|
20
18
|
"delete": "custom-dx-components delete",
|
|
21
|
-
"deleteAll": "custom-dx-components deleteAll",
|
|
22
19
|
"lint:types": "tsc --noEmit",
|
|
23
20
|
"lint:es": "eslint .",
|
|
24
21
|
"lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
|
|
@@ -38,8 +35,9 @@
|
|
|
38
35
|
"license": "Enter License",
|
|
39
36
|
"sideEffects": false,
|
|
40
37
|
"dependencies": {
|
|
41
|
-
"@pega/cosmos-react-core": "^3.0.
|
|
42
|
-
"@pega/cosmos-react-work": "3.0.
|
|
38
|
+
"@pega/cosmos-react-core": "^3.0.0-rc.4",
|
|
39
|
+
"@pega/cosmos-react-work": "3.0.0-rc.4",
|
|
40
|
+
"@storybook/addon-knobs": "^6.3.1",
|
|
43
41
|
"dayjs": "^1.11.5",
|
|
44
42
|
"jest": "^29.3.1",
|
|
45
43
|
"polished": "^4.2.2",
|
|
@@ -54,12 +52,10 @@
|
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
54
|
"@pega/configs": "^0.3.4",
|
|
57
|
-
"@pega/custom-dx-components": "^2.0.
|
|
58
|
-
"@pega/eslint-config": "^0.3.2",
|
|
55
|
+
"@pega/custom-dx-components": "^2.0.25",
|
|
59
56
|
"@storybook/addon-actions": "^6.5.12",
|
|
60
57
|
"@storybook/addon-essentials": "^6.5.12",
|
|
61
58
|
"@storybook/addon-links": "^6.5.12",
|
|
62
|
-
"@storybook/addon-knobs": "^6.3.1",
|
|
63
59
|
"@storybook/addon-storysource": "^6.5.12",
|
|
64
60
|
"@storybook/builder-webpack5": "^6.5.12",
|
|
65
61
|
"@storybook/manager-webpack5": "^6.5.12",
|
|
@@ -69,18 +65,7 @@
|
|
|
69
65
|
"@types/react-color": "^3.0.6",
|
|
70
66
|
"@types/react-dom": "^17.0.11",
|
|
71
67
|
"@types/styled-components": "^5.1.26",
|
|
72
|
-
"
|
|
73
|
-
"eslint": "^8.4.1",
|
|
74
|
-
"eslint-plugin-import": "^2.25.3",
|
|
75
|
-
"eslint-plugin-jest": "^25.3.0",
|
|
76
|
-
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
77
|
-
"eslint-plugin-mdx": "^2.0.5",
|
|
78
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
79
|
-
"eslint-plugin-react": "^7.27.1",
|
|
80
|
-
"eslint-plugin-react-hooks": "^4.3.0",
|
|
81
|
-
"eslint-plugin-sonarjs": "^0.11.0",
|
|
82
|
-
"jest": "^29.3.1",
|
|
83
|
-
"jest-environment-jsdom": "^29.3.1",
|
|
68
|
+
"eslint": "^8.23.1",
|
|
84
69
|
"npm-run-all": "^4.1.5",
|
|
85
70
|
"prettier": "2.7.1",
|
|
86
71
|
"stylelint": "^14.11.0",
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"components-directory-path": "src/components",
|
|
3
3
|
"server-config": {
|
|
4
|
-
"serverType": "infinity",
|
|
5
4
|
"server": "https://localhost:38764/prweb",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"password": "",
|
|
5
|
+
"user": "user",
|
|
6
|
+
"password": "password",
|
|
9
7
|
"rulesetName": "rulesetName",
|
|
10
8
|
"rulesetVersion": "rulesetVersion",
|
|
11
9
|
"sourceOfComponents": "Server",
|
|
@@ -16,7 +14,6 @@
|
|
|
16
14
|
"component": {
|
|
17
15
|
"library": "",
|
|
18
16
|
"type": "",
|
|
19
|
-
"version": "",
|
|
20
17
|
"subtype": "",
|
|
21
18
|
"description": "",
|
|
22
19
|
"icon": ""
|