@pega/custom-dx-components 0.23.33 → 0.23.35
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 +2 -2
- package/package.json +1 -1
- package/src/constants.js +2 -2
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +45 -75
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Operator.tsx.mustache +34 -106
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/src/util.js +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Operator.tsx +45 -75
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/config.json +4 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/demo.stories.tsx +5 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/index.tsx +7 -7
- package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyAutocomplete → Constellation/Pega_DXIL_MySearchbox}/config.json +4 -4
- package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyAutocomplete → Constellation/Pega_DXIL_MySearchbox}/demo.stories.tsx +5 -5
- package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/index.tsx +12 -12
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Operator.tsx +34 -106
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/config.json +4 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/demo.stories.tsx +5 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/index.tsx +7 -7
- package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyAutocomplete → Launchpad/Pega_DXIL_MySearchbox}/config.json +4 -4
- package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyAutocomplete → Launchpad/Pega_DXIL_MySearchbox}/demo.stories.tsx +5 -5
- package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/index.tsx +12 -12
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/PConnProps.d.ts +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/component-constants.js +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/date.js +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/embed-utils.js +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/event-utils.ts +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/format-constants.js +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/mock.ts +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/picklist-utils.js +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/repeat-constants.js +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/repeat-utils.js +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/styles.ts +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/suggestions-handler.ts +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/textformat-utils.jsx +0 -0
- /package/tests/assets/components/createAll/Constellation/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/utils.ts +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/PConnProps.d.ts +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/component-constants.js +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/date.js +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/embed-utils.js +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/event-utils.ts +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/format-constants.js +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/mock.ts +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/picklist-utils.js +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/repeat-constants.js +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/repeat-utils.js +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/styles.ts +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/suggestions-handler.ts +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/textformat-utils.jsx +0 -0
- /package/tests/assets/components/createAll/Launchpad/{Pega_DXIL_MyAutocomplete → Pega_DXIL_MySearchbox}/utils.ts +0 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This project provides you with an environment to extend Constellation by giving
|
|
|
8
8
|
|
|
9
9
|
Ensure you have access to the following in your system:
|
|
10
10
|
|
|
11
|
-
- Pega Infinity Server version
|
|
11
|
+
- Pega Infinity Server version 23 or later
|
|
12
12
|
|
|
13
13
|
- Git version 2.30 or later
|
|
14
14
|
|
|
@@ -18,4 +18,4 @@ Ensure you have access to the following in your system:
|
|
|
18
18
|
|
|
19
19
|
## Latest Documentation
|
|
20
20
|
|
|
21
|
-
Find the latest documentation on using **DX Component Builder** [here](https://docs.pega.com/bundle/constellation-dx-components
|
|
21
|
+
Find the latest documentation on using **DX Component Builder** [here](https://docs.pega.com/bundle/constellation-dx-components/page/constellation-dx-components/custom-components/lifecycle-dx-cosmos-components.html)
|
package/package.json
CHANGED
package/src/constants.js
CHANGED
|
@@ -170,11 +170,11 @@ export const COMPONENT_SCHEMA = {
|
|
|
170
170
|
value: 'Picklist'
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
|
-
name: '
|
|
173
|
+
name: 'Search box',
|
|
174
174
|
value: 'Picklist-Autocomplete'
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
|
-
name: 'Radio
|
|
177
|
+
name: 'Radio buttons',
|
|
178
178
|
value: 'Picklist-RadioButtons'
|
|
179
179
|
}
|
|
180
180
|
],
|
|
@@ -100,7 +100,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
100
100
|
// @ts-ignore
|
|
101
101
|
displayComponent = (
|
|
102
102
|
// @ts-ignore
|
|
103
|
-
<
|
|
103
|
+
<{{COMPONENT_CLASS_NAME}} value={value} trueLabel={trueLabel} falseLabel={falseLabel} />
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
//
|
|
2
|
-
import React from 'react';
|
|
1
|
+
// @ts-nocheck
|
|
3
2
|
import { useState, useEffect, Fragment } from 'react';
|
|
4
3
|
import {
|
|
5
4
|
Link,
|
|
6
5
|
Button,
|
|
7
6
|
Popover,
|
|
8
|
-
Flex,
|
|
9
7
|
useOuterEvent,
|
|
10
8
|
useElement,
|
|
11
9
|
Progress,
|
|
@@ -13,6 +11,7 @@ import {
|
|
|
13
11
|
useTheme
|
|
14
12
|
} from '@pega/cosmos-react-core';
|
|
15
13
|
import { Glimpse } from '@pega/cosmos-react-work';
|
|
14
|
+
import { EmailDisplay } from '@pega/cosmos-react-core';
|
|
16
15
|
import PropTypes from 'prop-types';
|
|
17
16
|
|
|
18
17
|
import type { PConnFieldProps } from './PConnProps';
|
|
@@ -30,19 +29,19 @@ interface {{COMPONENT_CLASS_NAME}}OperatorProps extends PConnFieldProps {
|
|
|
30
29
|
externalUser: any;
|
|
31
30
|
}
|
|
32
31
|
|
|
32
|
+
let pTarget = null;
|
|
33
33
|
|
|
34
34
|
export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
35
35
|
const { id, name, label, testId, helperText, externalUser, metaObj } = props;
|
|
36
36
|
const [isOpen, setIsOpen] = useState(false);
|
|
37
37
|
const [isLoading, setIsLoading] = useState(true);
|
|
38
|
-
const [popoverTarget, setPopoverTarget] = useState(null);
|
|
39
38
|
const [popoverEl, setPopoverEl] = useElement(null);
|
|
40
39
|
const [popoverContent, setpopoverContent] = useState(null);
|
|
41
40
|
const theme: any = useTheme();
|
|
42
41
|
|
|
43
42
|
/* If the id has changed, we need to reset the popover */
|
|
44
43
|
useEffect(() => {
|
|
45
|
-
|
|
44
|
+
pTarget = null;
|
|
46
45
|
}, [id]);
|
|
47
46
|
|
|
48
47
|
|
|
@@ -53,7 +52,6 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
53
52
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
54
53
|
const localeCategory = 'Operator';
|
|
55
54
|
setpopoverContent(
|
|
56
|
-
// @ts-ignore
|
|
57
55
|
<Progress variant='ring' message={localizedVal('Loading operator...', localeCategory)} placement='local' />
|
|
58
56
|
);
|
|
59
57
|
if (externalUser && externalUser.classID !== 'Data-Party-Operator') {
|
|
@@ -77,10 +75,8 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
77
75
|
];
|
|
78
76
|
setIsLoading(false);
|
|
79
77
|
setpopoverContent(
|
|
80
|
-
// @ts-ignore
|
|
81
78
|
<Glimpse
|
|
82
79
|
visual={
|
|
83
|
-
// @ts-ignore
|
|
84
80
|
<Avatar
|
|
85
81
|
metaObj={{
|
|
86
82
|
name: externalUser.name
|
|
@@ -90,79 +86,53 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
90
86
|
primary={externalUser.name}
|
|
91
87
|
secondary={[externalUser.position]}
|
|
92
88
|
fields={fields}
|
|
89
|
+
target={pTarget}
|
|
93
90
|
/>
|
|
94
91
|
);
|
|
95
92
|
} else {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
.then(
|
|
99
|
-
if (res.data
|
|
100
|
-
const fields = [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
{res.data.pyOperatorInfo.pyTelephone}
|
|
113
|
-
</Link>
|
|
114
|
-
) : (
|
|
115
|
-
''
|
|
116
|
-
)
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
id: 'pyEmailAddress',
|
|
93
|
+
return PCore.getUserApi()
|
|
94
|
+
.getOperatorDetails(id, true)
|
|
95
|
+
.then(res => {
|
|
96
|
+
if (res.data?.pyOperatorInfo) {
|
|
97
|
+
const fields = [];
|
|
98
|
+
const data = res.data;
|
|
99
|
+
if (data.pyOperatorInfo && data.pyOperatorInfo.pyUserName) {
|
|
100
|
+
fields.push({
|
|
101
|
+
id: 'Name',
|
|
102
|
+
name: localizedVal('Name', localeCategory),
|
|
103
|
+
value: data.pyOperatorInfo.pyUserName
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (data.pyOperatorInfo && data.pyOperatorInfo.pyEmailAddress) {
|
|
107
|
+
fields.push({
|
|
108
|
+
id: 'Email',
|
|
120
109
|
name: localizedVal('Email address', localeCategory),
|
|
121
|
-
value:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
value: res.data.pyOperatorInfo.pyReportToUserName
|
|
134
|
-
}
|
|
135
|
-
];
|
|
110
|
+
value: <EmailDisplay value={data.pyOperatorInfo.pyEmailAddress} />
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const opAvatar = (
|
|
114
|
+
<Avatar
|
|
115
|
+
metaObj={{
|
|
116
|
+
image: '',
|
|
117
|
+
name: data.pyOperatorInfo.pyUserName
|
|
118
|
+
}}
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
|
|
136
122
|
setIsLoading(false);
|
|
137
123
|
setpopoverContent(
|
|
138
|
-
// @ts-ignore
|
|
139
124
|
<Glimpse
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
name: res.data.pyOperatorInfo.pyUserName
|
|
146
|
-
}}
|
|
147
|
-
/>
|
|
148
|
-
}
|
|
149
|
-
primary={res.data.pyOperatorInfo.pyUserName}
|
|
150
|
-
secondary={[res.data.pyOperatorInfo.pyPosition]}
|
|
125
|
+
heading={{
|
|
126
|
+
primary: data.pyOperatorInfo.pyUserName,
|
|
127
|
+
secondary: data.pyOperatorInfo.pyEmailAddress,
|
|
128
|
+
visual: opAvatar
|
|
129
|
+
}}
|
|
151
130
|
fields={fields}
|
|
131
|
+
target={pTarget}
|
|
132
|
+
onDismiss={() => {pTarget = null;}}
|
|
152
133
|
/>
|
|
153
134
|
);
|
|
154
|
-
} else {
|
|
155
|
-
setIsLoading(false);
|
|
156
|
-
// @ts-ignore
|
|
157
|
-
setpopoverContent(<Flex container={{ pad: 1 }}>{localizedVal('Operator not found', localeCategory)}</Flex>);
|
|
158
135
|
}
|
|
159
|
-
})
|
|
160
|
-
.catch(() => {
|
|
161
|
-
setIsLoading(false);
|
|
162
|
-
setpopoverContent(
|
|
163
|
-
// @ts-ignore
|
|
164
|
-
<Flex container={{ pad: 1 }}>{localizedVal('Error loading the operator profile', localeCategory)}</Flex>
|
|
165
|
-
);
|
|
166
136
|
});
|
|
167
137
|
}
|
|
168
138
|
};
|
|
@@ -170,9 +140,10 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
170
140
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
171
141
|
|
|
172
142
|
const clickAction = (e: any) => {
|
|
173
|
-
|
|
143
|
+
|
|
174
144
|
setIsOpen(!isOpen);
|
|
175
|
-
if (
|
|
145
|
+
if (pTarget === null) {
|
|
146
|
+
pTarget = e.currentTarget;
|
|
176
147
|
OperatorPreview();
|
|
177
148
|
}
|
|
178
149
|
};
|
|
@@ -183,8 +154,7 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
183
154
|
}
|
|
184
155
|
};
|
|
185
156
|
|
|
186
|
-
//
|
|
187
|
-
useOuterEvent('mousedown', [popoverEl, popoverTarget], hidePopover); // Call the method on clicking outside these elements
|
|
157
|
+
useOuterEvent('mousedown', [popoverEl], hidePopover); // Call the method on clicking outside these elements
|
|
188
158
|
|
|
189
159
|
const hideOnEscape = (e: any) => {
|
|
190
160
|
if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed
|
|
@@ -222,7 +192,7 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
222
192
|
<Popover
|
|
223
193
|
ref={setPopoverEl}
|
|
224
194
|
groupId='operator'
|
|
225
|
-
target={
|
|
195
|
+
target={pTarget}
|
|
226
196
|
placement='bottom-start'
|
|
227
197
|
style={isLoading ? { position: 'relative', width: '10rem', minHeight: '4rem' } : undefined}
|
|
228
198
|
strategy='fixed'
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import { useState, useEffect, Fragment } from 'react';
|
|
2
3
|
import {
|
|
3
4
|
Link,
|
|
@@ -27,18 +28,19 @@ interface {{COMPONENT_CLASS_NAME}}OperatorProps extends PConnFieldProps {
|
|
|
27
28
|
externalUser: any;
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
let pTarget = null;
|
|
32
|
+
|
|
30
33
|
export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
31
34
|
const { id, name, label, testId, helperText, externalUser, metaObj } = props;
|
|
32
35
|
const [isOpen, setIsOpen] = useState(false);
|
|
33
36
|
const [isLoading, setIsLoading] = useState(true);
|
|
34
|
-
const [popoverTarget, setPopoverTarget] = useState(null);
|
|
35
37
|
const [popoverEl, setPopoverEl] = useElement(null);
|
|
36
38
|
const [popoverContent, setpopoverContent] = useState(null);
|
|
37
39
|
const theme = useTheme();
|
|
38
40
|
|
|
39
41
|
/* If the id has changed, we need to reset the popover */
|
|
40
42
|
useEffect(() => {
|
|
41
|
-
|
|
43
|
+
pTarget = null;
|
|
42
44
|
}, [id]);
|
|
43
45
|
|
|
44
46
|
|
|
@@ -49,7 +51,6 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
49
51
|
let localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
50
52
|
let localeCategory = 'Operator';
|
|
51
53
|
setpopoverContent(
|
|
52
|
-
// @ts-ignore
|
|
53
54
|
<Progress variant='ring' message={localizedVal('Loading operator...', localeCategory)} placement='local' />
|
|
54
55
|
);
|
|
55
56
|
if (externalUser && externalUser.classID !== 'Data-Party-Operator') {
|
|
@@ -73,10 +74,8 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
73
74
|
];
|
|
74
75
|
setIsLoading(false);
|
|
75
76
|
setpopoverContent(
|
|
76
|
-
// @ts-ignore
|
|
77
77
|
<Glimpse
|
|
78
78
|
visual={
|
|
79
|
-
// @ts-ignore
|
|
80
79
|
<Avatar
|
|
81
80
|
metaObj={{
|
|
82
81
|
name: externalUser.name
|
|
@@ -86,6 +85,7 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
86
85
|
primary={externalUser.name}
|
|
87
86
|
secondary={[externalUser.position]}
|
|
88
87
|
fields={fields}
|
|
88
|
+
target={pTarget}
|
|
89
89
|
/>
|
|
90
90
|
);
|
|
91
91
|
} else {
|
|
@@ -108,112 +108,41 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
108
108
|
name: localizedVal('Email address', localeCategory),
|
|
109
109
|
value: <EmailDisplay value={res.data.data[0].BusinessID} />
|
|
110
110
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
/*
|
|
136
|
-
const { getOperatorDetails } = PCore.getUserApi();
|
|
137
|
-
getOperatorDetails(id)
|
|
138
|
-
.then((res) => {
|
|
139
|
-
if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
|
|
140
|
-
const fields = [
|
|
141
|
-
{
|
|
142
|
-
id: 'pyOrganization',
|
|
143
|
-
name: localizedVal('Organization', localeCategory),
|
|
144
|
-
value: res.data.pyOperatorInfo.pyOrganization
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
id: 'pyTelephone',
|
|
148
|
-
name: localizedVal('Telephone', localeCategory),
|
|
149
|
-
value:
|
|
150
|
-
res.data.pyOperatorInfo.pyTelephone !== '' ? (
|
|
151
|
-
<Link href={`tel:${res.data.pyOperatorInfo.pyTelephone}`}>
|
|
152
|
-
{res.data.pyOperatorInfo.pyTelephone}
|
|
153
|
-
</Link>
|
|
154
|
-
) : (
|
|
155
|
-
''
|
|
156
|
-
)
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
id: 'pyEmailAddress',
|
|
160
|
-
name: localizedVal('Email address', localeCategory),
|
|
161
|
-
value:
|
|
162
|
-
res.data.pyOperatorInfo.pyEmailAddress !== '' ? (
|
|
163
|
-
<Link href={`mailto:${res.data.pyOperatorInfo.pyEmailAddress}`}>
|
|
164
|
-
{res.data.pyOperatorInfo.pyEmailAddress}
|
|
165
|
-
</Link>
|
|
166
|
-
) : (
|
|
167
|
-
''
|
|
168
|
-
)
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
id: 'ReportToUserName',
|
|
172
|
-
name: localizedVal('Reports to', localeCategory),
|
|
173
|
-
value: res.data.pyOperatorInfo.pyReportToUserName
|
|
174
|
-
}
|
|
175
|
-
];
|
|
176
|
-
setIsLoading(false);
|
|
177
|
-
setpopoverContent(
|
|
178
|
-
// @ts-ignore
|
|
179
|
-
<Glimpse
|
|
180
|
-
visual={
|
|
181
|
-
// @ts-ignore
|
|
182
|
-
<Avatar
|
|
183
|
-
metaObj={{
|
|
184
|
-
image: res.data.pyOperatorInfo.pyImageInsKey || '',
|
|
185
|
-
name: res.data.pyOperatorInfo.pyUserName
|
|
186
|
-
}}
|
|
187
|
-
/>
|
|
188
|
-
}
|
|
189
|
-
primary={res.data.pyOperatorInfo.pyUserName}
|
|
190
|
-
secondary={[res.data.pyOperatorInfo.pyPosition]}
|
|
191
|
-
fields={fields}
|
|
192
|
-
/>
|
|
193
|
-
);
|
|
194
|
-
} else {
|
|
195
|
-
setIsLoading(false);
|
|
196
|
-
// @ts-ignore
|
|
197
|
-
setpopoverContent(<Flex container={{ pad: 1 }}>{localizedVal('Operator not found', localeCategory)}</Flex>);
|
|
111
|
+
|
|
112
|
+
setIsLoading(false);
|
|
113
|
+
setpopoverContent(
|
|
114
|
+
<Glimpse
|
|
115
|
+
heading={{
|
|
116
|
+
primary: res.data.data[0].Name,
|
|
117
|
+
secondary: res.data.data[0].BusinessID,
|
|
118
|
+
visual: (
|
|
119
|
+
<Avatar
|
|
120
|
+
metaObj={{
|
|
121
|
+
image: '',
|
|
122
|
+
name: res.data.data[0].Name
|
|
123
|
+
}}
|
|
124
|
+
/>
|
|
125
|
+
)
|
|
126
|
+
}}
|
|
127
|
+
fields={fields}
|
|
128
|
+
target={pTarget}
|
|
129
|
+
onDismiss={() => {pTarget = null;})}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
|
|
198
133
|
}
|
|
199
|
-
})
|
|
200
|
-
.catch(() => {
|
|
201
|
-
setIsLoading(false);
|
|
202
|
-
setpopoverContent(
|
|
203
|
-
// @ts-ignore
|
|
204
|
-
<Flex container={{ pad: 1 }}>{localizedVal('Error loading the operator profile', localeCategory)}</Flex>
|
|
205
|
-
);
|
|
206
134
|
});
|
|
207
|
-
|
|
135
|
+
|
|
208
136
|
}
|
|
209
137
|
};
|
|
210
138
|
|
|
211
139
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
212
140
|
|
|
213
|
-
const clickAction = (e: any) =>
|
|
214
|
-
|
|
141
|
+
const clickAction = (e: any) =>
|
|
142
|
+
|
|
215
143
|
setIsOpen(!isOpen);
|
|
216
|
-
if (
|
|
144
|
+
if (pTarget === null) {
|
|
145
|
+
pTarget = e.currentTarget;
|
|
217
146
|
OperatorPreview();
|
|
218
147
|
}
|
|
219
148
|
};
|
|
@@ -224,8 +153,7 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
224
153
|
}
|
|
225
154
|
};
|
|
226
155
|
|
|
227
|
-
//
|
|
228
|
-
useOuterEvent('mousedown', [popoverEl, popoverTarget], hidePopover); // Call the method on clicking outside these elements
|
|
156
|
+
useOuterEvent('mousedown', [popoverEl], hidePopover); // Call the method on clicking outside these elements
|
|
229
157
|
const hideOnEscape = (e: any) => {
|
|
230
158
|
if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed
|
|
231
159
|
};
|
|
@@ -262,7 +190,7 @@ export default function Operator(props: {{COMPONENT_CLASS_NAME}}OperatorProps) {
|
|
|
262
190
|
<Popover
|
|
263
191
|
ref={setPopoverEl}
|
|
264
192
|
groupId='operator'
|
|
265
|
-
target={
|
|
193
|
+
target={pTarget}
|
|
266
194
|
placement='bottom-start'
|
|
267
195
|
style={isLoading ? { position: 'relative', width: '10rem', minHeight: '4rem' } : undefined}
|
|
268
196
|
strategy='fixed'
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@pega/configs": "^0.6.0",
|
|
72
|
-
"@pega/custom-dx-components": "0.23.
|
|
72
|
+
"@pega/custom-dx-components": "0.23.35",
|
|
73
73
|
"@pega/pcore-pconnect-typedefs": "2.0.0",
|
|
74
74
|
"@storybook/addon-actions": "^7.6.7",
|
|
75
75
|
"@storybook/addon-essentials": "^7.6.7",
|
package/src/util.js
CHANGED
|
@@ -290,7 +290,7 @@ export const showVersion = () => {
|
|
|
290
290
|
const hasGit = checkGit(process.cwd());
|
|
291
291
|
|
|
292
292
|
if (!hasGit) {
|
|
293
|
-
console.log(chalk.redBright('DX Component Builder -
|
|
293
|
+
console.log(chalk.redBright('DX Component Builder - Git needs to be installed.'));
|
|
294
294
|
process.exit(1);
|
|
295
295
|
}
|
|
296
296
|
};
|