@pega/custom-dx-components 0.23.24 → 0.23.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/package.json +1 -1
- package/src/tasks/build-all/helper.js +14 -10
- package/src/tasks/build-all/index.js +3 -1
- package/src/tasks/build-comp/helper.js +15 -5
- package/src/tasks/bundle/builder/index.js +3 -3
- package/src/tasks/create/templates/Constellation/Field/Boolean/event-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +9 -3
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +3 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +4 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.js.mustache +5 -4
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +9 -7
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/picklist-utils.js.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-utils.js.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +5 -3
- package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.tsx +2 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +5 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +4 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +6 -4
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +4 -2
- package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.tsx.mustache +5 -3
- package/src/tasks/init/template/.eslintrc.json +2 -4
- package/src/tasks/init/template/package.json.mustache +5 -2
- package/src/tasks/publish-all/index.js +9 -3
- package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyAutocomplete/date.js +5 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyAutocomplete/index.tsx +9 -7
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyAutocomplete/picklist-utils.js +1 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyAutocomplete/repeat-utils.js +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/event-utils.ts +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +9 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +4 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +5 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Operator.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +4 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +6 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +5 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.tsx +4 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyAutocomplete/date.js +5 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyAutocomplete/index.tsx +9 -7
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyAutocomplete/picklist-utils.js +1 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyAutocomplete/repeat-utils.js +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/event-utils.ts +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +9 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +4 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +5 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +4 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +3 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +6 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +3 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/index.tsx +3 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +3 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +5 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.tsx +4 -2
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/PConnProps.d.ts.mustache +0 -0
- /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.tsx.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/mock.ts.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/styles.ts.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/suggestions-handler.ts.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/time-of-day.js.mustache +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
+
import type React from 'react';
|
|
2
3
|
import { useEffect, useState } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import { Avatar as CosmosAvatar } from '@pega/cosmos-react-core';
|
|
@@ -44,7 +45,7 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
44
45
|
|
|
45
46
|
if (showStatus) {
|
|
46
47
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
|
-
const [userState, setUserState] = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
|
+
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
49
|
|
|
49
50
|
// @ts-ignore
|
|
50
51
|
const handleUserStateChange = ({ state }) => {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-fragments */
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import { useState, useEffect, Fragment } from 'react';
|
|
3
5
|
import {
|
|
4
6
|
Link,
|
|
@@ -37,7 +39,7 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
37
39
|
const [popoverTarget, setPopoverTarget] = useState(null);
|
|
38
40
|
const [popoverEl, setPopoverEl] = useElement(null);
|
|
39
41
|
const [popoverContent, setpopoverContent] = useState(null);
|
|
40
|
-
const theme = useTheme();
|
|
42
|
+
const theme: any = useTheme();
|
|
41
43
|
|
|
42
44
|
/* If the id has changed, we need to reset the popover */
|
|
43
45
|
useEffect(() => {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
+
import type React from 'react';
|
|
2
3
|
import { useEffect, useState } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import { Avatar as CosmosAvatar } from '@pega/cosmos-react-core';
|
|
5
6
|
import type { PConnFieldProps } from './PConnProps';
|
|
6
7
|
|
|
8
|
+
|
|
7
9
|
// interface for props
|
|
8
10
|
interface {{COMPONENT_CLASS_NAME}}AvatarProps extends PConnFieldProps {
|
|
9
11
|
// If any, enter additional props that only exist on TextInput here
|
|
@@ -43,7 +45,7 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
43
45
|
|
|
44
46
|
if (showStatus) {
|
|
45
47
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
46
|
-
const [userState, setUserState] = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
|
+
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
47
49
|
|
|
48
50
|
// @ts-ignore
|
|
49
51
|
const handleUserStateChange = ({ state }) => {
|
|
@@ -59,9 +61,9 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
59
61
|
return function cleanup() {
|
|
60
62
|
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
61
63
|
};
|
|
62
|
-
}, [
|
|
64
|
+
}, [userIdentifier, handleUserStateChange]);
|
|
63
65
|
// @ts-ignore
|
|
64
|
-
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl} status={userState} />;
|
|
66
|
+
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
// Do not render when userName does not exists
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"prettier/prettier": "off",
|
|
24
24
|
|
|
25
25
|
// Disable rules from shared configs we're not ready for yet.
|
|
26
|
-
"sonarjs/cognitive-complexity": "
|
|
26
|
+
"sonarjs/cognitive-complexity": ["warn", 45],
|
|
27
27
|
"sonarjs/no-identical-functions": "off",
|
|
28
28
|
"sonarjs/no-duplicate-string": "off",
|
|
29
29
|
"sonarjs/no-nested-template-literals": "off",
|
|
30
30
|
|
|
31
31
|
//
|
|
32
32
|
// JA - Override some default lint handling here
|
|
33
|
-
"@typescript-eslint/array-type":
|
|
33
|
+
"@typescript-eslint/array-type": "off",
|
|
34
34
|
// "import/extensions": ["warn", "never"], // Turning off for now (see below)
|
|
35
35
|
|
|
36
36
|
//
|
|
@@ -80,7 +80,6 @@
|
|
|
80
80
|
"no-undef": "off",
|
|
81
81
|
"no-unused-vars": "off",
|
|
82
82
|
"no-var": "off",
|
|
83
|
-
"prefer-const": "off",
|
|
84
83
|
"yoda": "error",
|
|
85
84
|
"no-irregular-whitespace": "off",
|
|
86
85
|
"no-empty": "off",
|
|
@@ -103,7 +102,6 @@
|
|
|
103
102
|
"react/static-property-placement": "error",
|
|
104
103
|
"array-callback-return": "error",
|
|
105
104
|
"camelcase": "error",
|
|
106
|
-
"default-case": "off",
|
|
107
105
|
"func-names": "error",
|
|
108
106
|
"no-case-declarations": "error",
|
|
109
107
|
"no-lonely-if": "error",
|
|
@@ -59,13 +59,16 @@
|
|
|
59
59
|
"polished": "^4.2.2",
|
|
60
60
|
"prop-types": "^15.8.1",
|
|
61
61
|
"react": "^17.0.2",
|
|
62
|
+
"react-autosuggest": "^10.1.0",
|
|
62
63
|
"react-dom": "^17.0.2",
|
|
63
64
|
"react-is": "^18.2.0",
|
|
65
|
+
"react-player": "^2.10.1",
|
|
66
|
+
"react-redux": "^7.2.6",
|
|
64
67
|
"styled-components": "^5.3.5"
|
|
65
68
|
},
|
|
66
69
|
"devDependencies": {
|
|
67
|
-
"@pega/configs": "^0.
|
|
68
|
-
"@pega/custom-dx-components": "0.23.
|
|
70
|
+
"@pega/configs": "^0.7.1",
|
|
71
|
+
"@pega/custom-dx-components": "0.23.25",
|
|
69
72
|
"@pega/pcore-pconnect-typedefs": "2.0.0",
|
|
70
73
|
"@storybook/addon-actions": "^7.6.7",
|
|
71
74
|
"@storybook/addon-essentials": "^7.6.7",
|
|
@@ -7,7 +7,12 @@ import bundleComponent from '../bundle/index.js';
|
|
|
7
7
|
import { lintComponent } from '../linter/index.js';
|
|
8
8
|
import { getComponents, getComponentDirectoryPath, showVersion } from '../../util.js';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
getPublishComponentQuestions,
|
|
12
|
+
publishComponentToServer,
|
|
13
|
+
zipComponent,
|
|
14
|
+
cleanUp
|
|
15
|
+
} from './helper.js';
|
|
11
16
|
|
|
12
17
|
export function getCustomTasks(componentKey, sourceMap, devBuild, content, options) {
|
|
13
18
|
const sDevBuild = devBuild ? '(dev build)' : '';
|
|
@@ -56,7 +61,7 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, content, optio
|
|
|
56
61
|
);
|
|
57
62
|
}
|
|
58
63
|
|
|
59
|
-
export default async
|
|
64
|
+
export default async options => {
|
|
60
65
|
showVersion();
|
|
61
66
|
|
|
62
67
|
const components = await getComponents();
|
|
@@ -95,8 +100,9 @@ export default async (options) => {
|
|
|
95
100
|
const myCustomTasks = getCustomTasks(componentKey, sourceMap, devBuild, content, options);
|
|
96
101
|
|
|
97
102
|
// eslint-disable-next-line no-await-in-loop
|
|
98
|
-
await myCustomTasks.run().catch(
|
|
103
|
+
await myCustomTasks.run().catch(err => {
|
|
99
104
|
console.log(chalk.bold.red(err.toString()));
|
|
105
|
+
process.exit(1);
|
|
100
106
|
});
|
|
101
107
|
}
|
|
102
108
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import PropTypes from 'prop-types';
|
|
2
4
|
import { Input } from '@pega/cosmos-react-core';
|
|
3
5
|
|
|
@@ -27,7 +29,7 @@ export default function PegaDxilMyTestText(props: PegaDxilMyTestTextProps) {
|
|
|
27
29
|
const pConn = getPConnect();
|
|
28
30
|
const actions = pConn.getActionsApi();
|
|
29
31
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
30
|
-
|
|
32
|
+
const propName: string = stateProps.value;
|
|
31
33
|
|
|
32
34
|
const handleOnChange = (event: any) => {
|
|
33
35
|
const { value: updatedValue } = event.target;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-shadow */
|
|
2
1
|
import dayjs from 'dayjs';
|
|
3
2
|
import relativeTime from 'dayjs/plugin/relativeTime.js';
|
|
4
3
|
import localizedFormat from 'dayjs/plugin/localizedFormat.js';
|
|
@@ -83,8 +82,10 @@ const constellationToCosmosFormatterMap = new Map([
|
|
|
83
82
|
const types = ['fromNow', 'customFormat'];
|
|
84
83
|
|
|
85
84
|
// value should be in ISO 8601 format.
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
function DateFormatter(
|
|
86
|
+
value,
|
|
87
|
+
// eslint-disable-next-line no-shadow, @typescript-eslint/no-shadow
|
|
88
|
+
{ type = types[1], format = 'DD/MM/YYYY', timezone, fieldType } = {}) {
|
|
88
89
|
if (!value) return value;
|
|
89
90
|
switch (type) {
|
|
90
91
|
case types[1]:
|
|
@@ -127,7 +128,7 @@ function DateFormatter(value, { type = types[1], format = 'DD/MM/YYYY', timezone
|
|
|
127
128
|
export function format(value, options) {
|
|
128
129
|
if (!value) return null;
|
|
129
130
|
const { type, locale, timezone, formatter, translate } = options;
|
|
130
|
-
// eslint-disable-next-line no-shadow
|
|
131
|
+
// eslint-disable-next-line no-shadow, @typescript-eslint/no-shadow
|
|
131
132
|
const { format, variant } = constellationToCosmosFormatterMap.get(type).get(formatter);
|
|
132
133
|
return formatDateTime(parseToDate(value), {
|
|
133
134
|
t: translate,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/* eslint-disable sonarjs/cognitive-complexity */
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useEffect, useRef, useState, memo, useMemo, type MutableRefObject, type SetStateAction } from 'react';
|
|
6
|
+
import { ComboBox, menuHelpers, debounce, throttle, Button, Icon, type MenuGroupProps, type MenuItemProps } from '@pega/cosmos-react-core';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
8
|
import get from 'lodash.get';
|
|
7
9
|
import type { PConnFieldProps } from './PConnProps';
|
|
@@ -206,7 +208,7 @@ export const doSearch = (
|
|
|
206
208
|
const updatedItems = menuHelpers.selectItem(searchedItems, value, AC_TYPE);
|
|
207
209
|
const selectedItem = menuHelpers.getSelected(updatedItems)[0];
|
|
208
210
|
if (!selectedItem) {
|
|
209
|
-
let searchedItem = [];
|
|
211
|
+
let searchedItem: any = [];
|
|
210
212
|
if (fetchDisplayValue) {
|
|
211
213
|
dataApiObj.matchPosition = 'equals';
|
|
212
214
|
buildColumnForDisplayValue(dataApiObj);
|
|
@@ -330,8 +332,8 @@ export const setValueToAssocProp = (
|
|
|
330
332
|
actions: any,
|
|
331
333
|
columns: Array<any>
|
|
332
334
|
) => {
|
|
333
|
-
let searchedEntry = null;
|
|
334
|
-
let retValue;
|
|
335
|
+
let searchedEntry: any = null;
|
|
336
|
+
let retValue: any;
|
|
335
337
|
if (listSource && listSource.length > 0 && listSource[0]) {
|
|
336
338
|
searchedEntry = listSource.filter(
|
|
337
339
|
item =>
|
|
@@ -734,7 +736,7 @@ export function PegaDxilMyAutocomplete(props: PegaDxilMyAutocompleteProps) {
|
|
|
734
736
|
|
|
735
737
|
useEffect(() => {
|
|
736
738
|
if (listType === 'datapage' && displayMode && displayMode?.length > 0 && value !== '') {
|
|
737
|
-
let displayItem = null;
|
|
739
|
+
let displayItem: any = null;
|
|
738
740
|
if (referenceType === 'Case' || referenceType === 'Data') {
|
|
739
741
|
displayItem =
|
|
740
742
|
referenceType === 'Case'
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyAutocomplete/repeat-utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable sonarjs/no-collapsible-if */
|
|
2
2
|
/* eslint-disable default-param-last */
|
|
3
3
|
/* eslint-disable func-names */
|
|
4
|
+
/* eslint-disable sonarjs/cognitive-complexity */
|
|
4
5
|
import { splitConditionTree } from '@pega/cosmos-react-condition-builder';
|
|
5
6
|
import cloneDeep from 'lodash/cloneDeep.js';
|
|
6
7
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import {
|
|
2
4
|
Checkbox as CosmosCheckbox,
|
|
3
5
|
CheckboxGroup,
|
|
@@ -6,6 +8,7 @@ import {
|
|
|
6
8
|
} from "@pega/cosmos-react-core";
|
|
7
9
|
import PropTypes from "prop-types";
|
|
8
10
|
|
|
11
|
+
|
|
9
12
|
import type { PConnFieldProps } from './PConnProps';
|
|
10
13
|
|
|
11
14
|
// includes in bundle
|
|
@@ -59,7 +62,7 @@ export default function PegaDxilMyBoolean(props: PegaDxilMyBooleanProps) {
|
|
|
59
62
|
const actions = pConn.getActionsApi();
|
|
60
63
|
const actionsProps = pConn.getActionsApi() as unknown as ActionsProps;
|
|
61
64
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
62
|
-
|
|
65
|
+
const propName: string = stateProps.value;
|
|
63
66
|
|
|
64
67
|
let { readOnly, required, disabled } = props;
|
|
65
68
|
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
@@ -82,7 +85,7 @@ export default function PegaDxilMyBoolean(props: PegaDxilMyBooleanProps) {
|
|
|
82
85
|
required={required}
|
|
83
86
|
onClick={actionsProps.onClick}
|
|
84
87
|
onChange={(event) => {
|
|
85
|
-
handleEvent(actions, "changeNblur", propName,
|
|
88
|
+
handleEvent(actions, "changeNblur", propName, event.target.checked);
|
|
86
89
|
}}
|
|
87
90
|
onBlur={(event: { target: { checked: any; }; }) => {
|
|
88
91
|
// @ts-ignore
|
|
@@ -97,7 +100,10 @@ export default function PegaDxilMyBoolean(props: PegaDxilMyBooleanProps) {
|
|
|
97
100
|
let displayComponent;
|
|
98
101
|
if (displayMode) {
|
|
99
102
|
// @ts-ignore
|
|
100
|
-
displayComponent =
|
|
103
|
+
displayComponent = (
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
<PegaDxilMyBoolean value={value} trueLabel={trueLabel} falseLabel={falseLabel} />
|
|
106
|
+
);
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useEffect, useState } from 'react';
|
|
2
4
|
import { DateInput, FieldValueList, DateTimeDisplay, Text, } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -88,6 +90,7 @@ export default function PegaDxilMyDate (props: PegaDxilMyDateProps) {
|
|
|
88
90
|
|
|
89
91
|
// cast status
|
|
90
92
|
let myStatus: 'success' | 'warning' | 'error' | 'pending';
|
|
93
|
+
// eslint-disable-next-line prefer-const
|
|
91
94
|
myStatus = status as 'success' | 'warning' | 'error' | 'pending';
|
|
92
95
|
|
|
93
96
|
useEffect(() => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useEffect, useState } from 'react';
|
|
2
4
|
import { DateTimeInput, FieldValueList, DateTimeDisplay, Text } from "@pega/cosmos-react-core";
|
|
3
5
|
import PropTypes from "prop-types";
|
|
@@ -80,7 +82,7 @@ export default function PegaDxilMyDateTime (props: PegaDxilMyDateTimeProps) {
|
|
|
80
82
|
const actions = pConn.getActionsApi();
|
|
81
83
|
const actionsProps = pConn.getActionsApi() as unknown as ActionsProps;
|
|
82
84
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
83
|
-
|
|
85
|
+
const propName: string = stateProps.value;
|
|
84
86
|
|
|
85
87
|
const environmentInfo = PCore.getEnvironmentInfo();
|
|
86
88
|
const timezone = environmentInfo && environmentInfo.getTimeZone();
|
|
@@ -94,6 +96,7 @@ export default function PegaDxilMyDateTime (props: PegaDxilMyDateTimeProps) {
|
|
|
94
96
|
|
|
95
97
|
// cast status
|
|
96
98
|
let myStatus: 'success' | 'warning' | 'error' | 'pending';
|
|
99
|
+
// eslint-disable-next-line prefer-const
|
|
97
100
|
myStatus = status as 'success' | 'warning' | 'error' | 'pending';
|
|
98
101
|
|
|
99
102
|
useEffect(() => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import { NumberInput, NumberDisplay, CurrencyDisplay, FieldValueList, Text } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx
CHANGED
|
@@ -98,6 +98,7 @@ export const BasePegaDxilMyDetails = () => {
|
|
|
98
98
|
return pyReviewRaw.config.inheritedProps;
|
|
99
99
|
},
|
|
100
100
|
createComponent: config => {
|
|
101
|
+
// eslint-disable-next-line default-case
|
|
101
102
|
switch (config.config.value) {
|
|
102
103
|
case '@P .pyStatusWork':
|
|
103
104
|
return renderField(pyReviewResolved.highlightedData[0].config);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import { Input, EmailDisplay, FieldValueList, Text, URLDisplay, PhoneDisplay } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -44,7 +46,7 @@ export const formatExists = (formatterVal: string) => {
|
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
export const textFormatter = (formatter: string, value: any) => {
|
|
47
|
-
let displayComponent = null;
|
|
49
|
+
let displayComponent: any = null;
|
|
48
50
|
switch(formatter){
|
|
49
51
|
case "TextInput" : {
|
|
50
52
|
displayComponent = value;
|
|
@@ -93,7 +95,7 @@ export default function PegaDxilMyEmail(props: PegaDxilMyEmailProps) {
|
|
|
93
95
|
const pConn = getPConnect();
|
|
94
96
|
const actions = pConn.getActionsApi();
|
|
95
97
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
96
|
-
|
|
98
|
+
const propName: string = stateProps.value;
|
|
97
99
|
|
|
98
100
|
const hasValueChange = useRef(false);
|
|
99
101
|
|
|
@@ -118,7 +120,7 @@ export default function PegaDxilMyEmail(props: PegaDxilMyEmailProps) {
|
|
|
118
120
|
}
|
|
119
121
|
}, [validatemessage, hasSuggestions, status]);
|
|
120
122
|
|
|
121
|
-
let displayComp = null;
|
|
123
|
+
let displayComp: any = null;
|
|
122
124
|
if (displayMode) {
|
|
123
125
|
displayComp = <EmailDisplay value={value} displayText={inputValue} variant='link' />;
|
|
124
126
|
}
|
|
@@ -144,6 +144,7 @@ export const BasePegaDxilMyForm = () => {
|
|
|
144
144
|
return pyReviewRaw.config.inheritedProps;
|
|
145
145
|
},
|
|
146
146
|
createComponent: config => {
|
|
147
|
+
// eslint-disable-next-line default-case
|
|
147
148
|
switch (config.config.value) {
|
|
148
149
|
case '@P .FirstName':
|
|
149
150
|
return renderField(regionChildrenResolved[0]);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import { NumberInput, NumberDisplay, Slider, FieldValueList, CurrencyDisplay, Text } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
+
import type React from 'react';
|
|
2
3
|
import { useEffect, useState } from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import { Avatar as CosmosAvatar } from '@pega/cosmos-react-core';
|
|
@@ -44,7 +45,7 @@ function Avatar(props: PegaDxilMyPageCaseWidgetAvatarProps) {
|
|
|
44
45
|
|
|
45
46
|
if (showStatus) {
|
|
46
47
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
|
-
const [userState, setUserState] = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
|
+
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
49
|
|
|
49
50
|
// @ts-ignore
|
|
50
51
|
const handleUserStateChange = ({ state }) => {
|
package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Operator.tsx
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-fragments */
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import { useState, useEffect, Fragment } from 'react';
|
|
3
5
|
import {
|
|
4
6
|
Link,
|
|
@@ -37,7 +39,7 @@ export default function Operator(props: PegaDxilMyPageCaseWidgetOperatorProps) {
|
|
|
37
39
|
const [popoverTarget, setPopoverTarget] = useState(null);
|
|
38
40
|
const [popoverEl, setPopoverEl] = useElement(null);
|
|
39
41
|
const [popoverContent, setpopoverContent] = useState(null);
|
|
40
|
-
const theme = useTheme();
|
|
42
|
+
const theme: any = useTheme();
|
|
41
43
|
|
|
42
44
|
/* If the id has changed, we need to reset the popover */
|
|
43
45
|
useEffect(() => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import { TextArea as CosmosTextArea, FieldValueList, ParagraphDisplay, Text, EmailDisplay, PhoneDisplay, URLDisplay } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -44,7 +46,7 @@ export const formatExists = (formatterVal: string) => {
|
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
export const textFormatter = (formatter: string, value: any) => {
|
|
47
|
-
let displayComponent = null;
|
|
49
|
+
let displayComponent:any = null;
|
|
48
50
|
switch(formatter){
|
|
49
51
|
case "TextInput" : {
|
|
50
52
|
displayComponent = value;
|
|
@@ -94,7 +96,7 @@ export default function PegaDxilMyParagraph(props: PegaDxilMyParagraphProps) {
|
|
|
94
96
|
const pConn = getPConnect();
|
|
95
97
|
const actions = pConn.getActionsApi();
|
|
96
98
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
97
|
-
|
|
99
|
+
const propName: string = stateProps.value;
|
|
98
100
|
const maxLength = fieldMetadata?.maxLength;
|
|
99
101
|
const hasValueChange = useRef(false);
|
|
100
102
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import {
|
|
3
5
|
NumberInput,
|
|
@@ -104,7 +106,7 @@ export default function PegaDxilMyPercentage(props: PegaDxilMyPercentageProps) {
|
|
|
104
106
|
|
|
105
107
|
if (displayMode === 'LABELS_LEFT' || displayMode === 'DISPLAY_ONLY') {
|
|
106
108
|
let unit = 'percent';
|
|
107
|
-
let displayComp = null;
|
|
109
|
+
let displayComp:any = null;
|
|
108
110
|
|
|
109
111
|
if (isTableFormatter) {
|
|
110
112
|
switch (formatter) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import {
|
|
3
5
|
PhoneInput as CosmosPhone,
|
|
@@ -53,7 +55,7 @@ export const formatExists = (formatterVal: string) => {
|
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
export const textFormatter = (formatter: string, value: any) => {
|
|
56
|
-
let displayComponent = null;
|
|
58
|
+
let displayComponent:any = null;
|
|
57
59
|
switch(formatter){
|
|
58
60
|
case "TextInput" : {
|
|
59
61
|
displayComponent = value;
|
|
@@ -104,7 +106,7 @@ export default function PegaDxilMyPhone(props: PegaDxilMyPhoneProps) {
|
|
|
104
106
|
const pConn = getPConnect();
|
|
105
107
|
const actions = pConn.getActionsApi();
|
|
106
108
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
107
|
-
|
|
109
|
+
const propName: string = stateProps.value;
|
|
108
110
|
const hasValueChange = useRef(false);
|
|
109
111
|
|
|
110
112
|
let callingCodesList: Array<any> = [];
|
|
@@ -139,7 +141,7 @@ export default function PegaDxilMyPhone(props: PegaDxilMyPhoneProps) {
|
|
|
139
141
|
}
|
|
140
142
|
}, [validatemessage, hasSuggestions, status]);
|
|
141
143
|
|
|
142
|
-
//
|
|
144
|
+
// function to exclude country code from phone number
|
|
143
145
|
function getPhoneNumberAlone(phoneNumber: string) {
|
|
144
146
|
const phoneNumberParts = getPhoneNumberParts(phoneNumber, callingCodesList);
|
|
145
147
|
return phoneNumberParts && phoneNumberParts[1];
|
|
@@ -152,7 +154,7 @@ export default function PegaDxilMyPhone(props: PegaDxilMyPhoneProps) {
|
|
|
152
154
|
handleEvent(actions, eventType, propName, enteredValue);
|
|
153
155
|
}
|
|
154
156
|
|
|
155
|
-
let displayComp = null;
|
|
157
|
+
let displayComp: any = null;
|
|
156
158
|
if (displayMode) {
|
|
157
159
|
displayComp = <PhoneDisplay value={value} variant='link' />;
|
|
158
160
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import React from 'react';
|
|
2
4
|
// @ts-nocheck
|
|
3
5
|
import { useState, useEffect, useRef } from 'react';
|
|
4
6
|
import { Select, Option, FieldValueList, Text } from '@pega/cosmos-react-core';
|
|
@@ -60,7 +62,7 @@ export const formatExists = (formatterVal: string) => {
|
|
|
60
62
|
|
|
61
63
|
|
|
62
64
|
export const textFormatter = (formatter: string,value: any) => {
|
|
63
|
-
let displayComponent = null;
|
|
65
|
+
let displayComponent: any = null;
|
|
64
66
|
switch(formatter){
|
|
65
67
|
case "TextInput" : {
|
|
66
68
|
displayComponent = value;
|