@pega/react-sdk-overrides 24.2.10 → 25.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/designSystemExtension/Banner/Banner.css +1 -1
- package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +8 -9
- package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
- package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
- package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
- package/lib/field/CancelAlert/CancelAlert.css +4 -4
- package/lib/field/CancelAlert/CancelAlert.tsx +7 -10
- package/lib/field/Checkbox/Checkbox.tsx +97 -4
- package/lib/field/Currency/Currency.tsx +10 -7
- package/lib/field/Currency/currency-utils.ts +1 -2
- package/lib/field/Date/Date.tsx +8 -8
- package/lib/field/DateTime/DateTime.tsx +16 -13
- package/lib/field/Decimal/Decimal.tsx +10 -7
- package/lib/field/Dropdown/Dropdown.tsx +30 -25
- package/lib/field/Email/Email.tsx +11 -13
- package/lib/field/Group/Group.tsx +10 -8
- package/lib/field/Integer/Integer.tsx +5 -7
- package/lib/field/Location/Location.css +4 -0
- package/lib/field/Location/Location.tsx +258 -0
- package/lib/field/Location/config-ext.json +8 -0
- package/lib/field/Location/index.tsx +1 -0
- package/lib/field/Multiselect/utils.ts +1 -1
- package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
- package/lib/field/ObjectReference/index.tsx +1 -0
- package/lib/field/ObjectReference/utils.ts +111 -0
- package/lib/field/Percentage/Percentage.tsx +9 -9
- package/lib/field/Phone/Phone.tsx +7 -5
- package/lib/field/RadioButtons/RadioButtons.tsx +47 -5
- package/lib/field/RichText/RichText.css +79 -0
- package/lib/field/RichText/RichText.tsx +3 -1
- package/lib/field/ScalarList/ScalarList.tsx +2 -4
- package/lib/field/SelectableCard/SelectableCard.tsx +175 -0
- package/lib/field/SelectableCard/index.tsx +1 -0
- package/lib/field/SelectableCard/utils.tsx +223 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
- package/lib/field/SemanticLink/utils.ts +1 -1
- package/lib/field/TextArea/TextArea.tsx +5 -7
- package/lib/field/TextContent/TextContent.tsx +1 -2
- package/lib/field/TextInput/TextInput.tsx +5 -7
- package/lib/field/Time/Time.tsx +4 -8
- package/lib/field/URL/URL.tsx +5 -7
- package/lib/field/UserReference/UserReference.tsx +3 -6
- package/lib/helpers/attachmentShared.ts +6 -0
- package/lib/helpers/common-utils.ts +24 -2
- package/lib/helpers/data_page.ts +0 -1
- package/lib/helpers/field-group-utils.ts +1 -1
- package/lib/helpers/formatters/Currency.ts +20 -20
- package/lib/helpers/formatters/CurrencyMap.ts +0 -2
- package/lib/helpers/formatters/common.ts +2 -1
- package/lib/helpers/formatters/index.ts +2 -4
- package/lib/helpers/object-utils.ts +10 -0
- package/lib/helpers/simpleTableHelpers.ts +118 -6
- package/lib/helpers/utils.ts +8 -1
- package/lib/helpers/versionHelpers.ts +0 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
- package/lib/infra/Assignment/Assignment.tsx +39 -36
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +21 -113
- package/lib/infra/Containers/FlowContainer/helpers.ts +1 -5
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +4 -3
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +7 -6
- package/lib/infra/Containers/SimpleView/helper.ts +1 -1
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +4 -5
- package/lib/infra/Containers/container-helpers.ts +52 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +5 -9
- package/lib/infra/DashboardFilter/filterUtils.tsx +3 -6
- package/lib/infra/DeferLoad/DeferLoad.tsx +7 -9
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
- package/lib/infra/MultiStep/MultiStep.css +48 -70
- package/lib/infra/MultiStep/MultiStep.tsx +27 -58
- package/lib/infra/NavBar/NavBar.css +1 -1
- package/lib/infra/NavBar/NavBar.tsx +43 -32
- package/lib/infra/Reference/Reference.tsx +3 -4
- package/lib/infra/Region/Region.tsx +1 -1
- package/lib/infra/RootContainer/RootContainer.tsx +3 -4
- package/lib/infra/Stages/Stages.tsx +3 -4
- package/lib/infra/View/View.tsx +4 -3
- package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
- package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
- package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
- package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
- package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
- package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
- package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
- package/lib/template/AdvancedSearch/config-ext.json +9 -0
- package/lib/template/AdvancedSearch/index.tsx +1 -0
- package/lib/template/AppShell/AppShell.css +1 -1
- package/lib/template/AppShell/AppShell.tsx +22 -23
- package/lib/template/BannerPage/BannerPage.tsx +2 -2
- package/lib/template/CaseSummary/CaseSummary.tsx +28 -41
- package/lib/template/CaseView/CaseView.tsx +32 -38
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/lib/template/Confirmation/Confirmation.tsx +3 -4
- package/lib/template/DataReference/DataReference.tsx +312 -106
- package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
- package/lib/template/DataReference/SearchForm.tsx +149 -0
- package/lib/template/DataReference/utils.ts +90 -0
- package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
- package/lib/template/DefaultForm/utils/index.ts +1 -3
- package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
- package/lib/template/DefaultPage/index.tsx +1 -0
- package/lib/template/Details/Details/Details.tsx +11 -11
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -2
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -5
- package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
- package/lib/template/ListPage/ListPage.tsx +1 -1
- package/lib/template/ListView/ListView.tsx +285 -204
- package/lib/template/ListView/hooks.ts +1 -5
- package/lib/template/ListView/utils.ts +38 -6
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
- package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -3
- package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +145 -0
- package/lib/template/SelfServiceCaseView/index.tsx +1 -0
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -5
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +99 -84
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +3 -5
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
- package/lib/template/SubTabs/SubTabs.tsx +2 -2
- package/lib/template/SubTabs/tabUtils.ts +118 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
- package/lib/template/WssNavBar/WssNavBar.css +1 -1
- package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
- package/lib/template/utils.tsx +58 -0
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
- package/lib/widget/Attachment/Attachment.css +7 -8
- package/lib/widget/Attachment/Attachment.tsx +304 -231
- package/lib/widget/Attachment/Attachment.types.ts +96 -0
- package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
- package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +30 -23
- package/lib/widget/Followers/Followers.tsx +2 -4
- package/lib/widget/QuickCreate/QuickCreate.tsx +1 -3
- package/lib/widget/SummaryItem/SummaryItem.css +9 -11
- package/lib/widget/SummaryItem/SummaryItem.tsx +3 -3
- package/lib/widget/SummaryList/SummaryList.tsx +1 -1
- package/lib/widget/ToDo/ToDo.css +1 -13
- package/lib/widget/ToDo/ToDo.tsx +38 -37
- package/package.json +1 -1
- package/lib/helpers/attachmentHelpers.ts +0 -76
- package/lib/infra/Containers/helpers.ts +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
3
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface QuickCreateProps extends PConnProps {
|
|
7
7
|
// If any, enter additional props that only exist on this component
|
|
@@ -21,7 +21,6 @@ export default function QuickCreate(props: QuickCreateProps) {
|
|
|
21
21
|
.getActionsApi()
|
|
22
22
|
.createWork(className, {} as any)
|
|
23
23
|
.catch(error => {
|
|
24
|
-
// eslint-disable-next-line no-console
|
|
25
24
|
console.log('Error in case creation: ', error?.message);
|
|
26
25
|
});
|
|
27
26
|
};
|
|
@@ -35,7 +34,6 @@ export default function QuickCreate(props: QuickCreateProps) {
|
|
|
35
34
|
const defaultCases: any = [];
|
|
36
35
|
const envInfo = PCore.getEnvironmentInfo();
|
|
37
36
|
if (envInfo?.environmentInfoObject?.pyCaseTypeList) {
|
|
38
|
-
// @ts-ignore - Property 'forEach' does not exist on type 'string'
|
|
39
37
|
envInfo.environmentInfoObject.pyCaseTypeList.forEach(casetype => {
|
|
40
38
|
if (casetype.pyWorkTypeName && casetype.pyWorkTypeImplementationClassName) {
|
|
41
39
|
defaultCases.push({
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
flex-direction: row;
|
|
12
12
|
padding: 0.25rem 0rem 0.25rem 0.25rem;
|
|
13
13
|
margin-bottom: 0.5rem;
|
|
14
|
+
align-items: center;
|
|
15
|
+
border: 0.0625rem solid var(--utility-card-border-color);
|
|
16
|
+
border-radius: calc(0.25rem);
|
|
17
|
+
min-height: 3rem;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
.psdk-utility-card-icon {
|
|
@@ -23,6 +27,7 @@
|
|
|
23
27
|
.psdk-utility-card-svg-icon {
|
|
24
28
|
width: 2.5rem;
|
|
25
29
|
display: inline-block;
|
|
30
|
+
filter: var(--svg-color);
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
.psdk-utility-card-main {
|
|
@@ -40,14 +45,7 @@
|
|
|
40
45
|
.psdk-utility-card-action-svg-icon {
|
|
41
46
|
width: 1.4rem;
|
|
42
47
|
display: inline-block;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
.psdk-utility-card {
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
border: 0.0625rem solid rgb(207, 207, 207);
|
|
49
|
-
border-radius: calc(0.25rem);
|
|
50
|
-
min-height: 3rem;
|
|
48
|
+
filter: var(--svg-color);
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
.psdk-utility-button {
|
|
@@ -65,14 +63,14 @@
|
|
|
65
63
|
width: 1.4rem;
|
|
66
64
|
display: inline-block;
|
|
67
65
|
vertical-align: middle;
|
|
68
|
-
filter:
|
|
66
|
+
filter: var(--svg-color);
|
|
69
67
|
}
|
|
70
68
|
|
|
71
|
-
.psdk-link-button {
|
|
69
|
+
.psdk-utility-link-button {
|
|
72
70
|
background: none;
|
|
73
71
|
border: none;
|
|
74
72
|
align-items: center;
|
|
75
73
|
display: flex;
|
|
76
74
|
padding: 0;
|
|
77
|
-
color:
|
|
75
|
+
color: var(--link-button-color);
|
|
78
76
|
}
|
|
@@ -2,7 +2,7 @@ import { useState } from 'react';
|
|
|
2
2
|
import { IconButton, Menu, MenuItem } from '@mui/material';
|
|
3
3
|
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
4
4
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
6
|
|
|
7
7
|
import './SummaryItem.css';
|
|
8
8
|
|
|
@@ -47,7 +47,7 @@ export default function SummaryItem(props: SummaryItemProps) {
|
|
|
47
47
|
{item.primary.type !== 'URL' && <div className='psdk-utility-card-main-primary-label'>{item.primary.name}</div>}
|
|
48
48
|
{item.primary.type === 'URL' && (
|
|
49
49
|
<div className='psdk-utility-card-main-primary-url'>
|
|
50
|
-
<button type='button' className='psdk-link-button'>
|
|
50
|
+
<button type='button' className='psdk-utility-link-button'>
|
|
51
51
|
{item.primary.name}
|
|
52
52
|
<img className='psdk-utility-card-actions-svg-icon' src={`${imagePath$}${item.primary.icon}.svg`} />
|
|
53
53
|
</button>
|
|
@@ -73,7 +73,7 @@ export default function SummaryItem(props: SummaryItemProps) {
|
|
|
73
73
|
>
|
|
74
74
|
<MoreVertIcon />
|
|
75
75
|
</IconButton>
|
|
76
|
-
<Menu
|
|
76
|
+
<Menu id='file-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
|
|
77
77
|
{item.actions &&
|
|
78
78
|
item.actions.map(option => (
|
|
79
79
|
<MenuItem style={{ fontSize: '14px' }} key={option.id || option.text} onClick={option.onClick}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
2
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
2
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
|
|
4
4
|
interface SummaryListProps extends PConnProps {
|
|
5
5
|
// If any, enter additional props that only exist on this component
|
package/lib/widget/ToDo/ToDo.css
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
text-align: center;
|
|
42
42
|
display: flex;
|
|
43
43
|
background: var(--app-primary-color);
|
|
44
|
-
color:
|
|
44
|
+
color: var(--app-text-color);
|
|
45
45
|
font-weight: bold;
|
|
46
46
|
font-size: 1.25rem;
|
|
47
47
|
}
|
|
@@ -56,18 +56,6 @@
|
|
|
56
56
|
display: inline-flex;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.psdk-todo-assignment-status {
|
|
60
|
-
background-color: var(--app-neutral-light-color);
|
|
61
|
-
border-radius: 0.125rem;
|
|
62
|
-
color: darkslategray;
|
|
63
|
-
font-size: 0.75rem;
|
|
64
|
-
font-weight: bold;
|
|
65
|
-
line-height: calc(0.5rem * 2.5);
|
|
66
|
-
height: calc(0.5rem * 2.5);
|
|
67
|
-
padding: 0 0.5rem;
|
|
68
|
-
text-transform: uppercase;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
59
|
.psdk-todo-assignment-task {
|
|
72
60
|
color: var(--app-neutral-color);
|
|
73
61
|
}
|
package/lib/widget/ToDo/ToDo.tsx
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-shadow */
|
|
2
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
Box,
|
|
5
|
-
Button,
|
|
6
|
-
Card,
|
|
7
|
-
CardContent,
|
|
8
|
-
CardHeader,
|
|
9
|
-
Avatar,
|
|
10
|
-
Typography,
|
|
11
|
-
Badge,
|
|
12
|
-
List,
|
|
13
|
-
ListItem,
|
|
14
|
-
ListItemText,
|
|
15
|
-
ListItemSecondaryAction
|
|
16
|
-
} from '@mui/material';
|
|
2
|
+
import { Box, Button, Card, CardContent, CardHeader, Avatar, Typography, Badge, List, ListItem, ListItemText } from '@mui/material';
|
|
17
3
|
import Snackbar from '@mui/material/Snackbar';
|
|
18
4
|
import IconButton from '@mui/material/IconButton';
|
|
19
5
|
import CloseIcon from '@mui/icons-material/Close';
|
|
@@ -23,7 +9,7 @@ import makeStyles from '@mui/styles/makeStyles';
|
|
|
23
9
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
24
10
|
|
|
25
11
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
26
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
12
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
27
13
|
|
|
28
14
|
import './ToDo.css';
|
|
29
15
|
|
|
@@ -64,10 +50,10 @@ interface ToDoProps extends PConnProps {
|
|
|
64
50
|
// If any, enter additional props that only exist on this component
|
|
65
51
|
datasource?: any;
|
|
66
52
|
myWorkList?: any;
|
|
67
|
-
|
|
53
|
+
|
|
68
54
|
caseInfoID?: string;
|
|
69
55
|
headerText?: string;
|
|
70
|
-
|
|
56
|
+
|
|
71
57
|
itemKey?: string;
|
|
72
58
|
showTodoList?: boolean;
|
|
73
59
|
type?: string;
|
|
@@ -96,21 +82,28 @@ function getID(assignment: any) {
|
|
|
96
82
|
|
|
97
83
|
const useStyles = makeStyles(theme => ({
|
|
98
84
|
root: {
|
|
99
|
-
marginTop: theme.spacing(1),
|
|
100
85
|
marginBottom: theme.spacing(1),
|
|
101
86
|
paddingBottom: theme.spacing(1),
|
|
102
|
-
|
|
103
|
-
borderLeftColor: theme.palette.primary.light
|
|
87
|
+
borderRadius: 16
|
|
104
88
|
},
|
|
105
89
|
avatar: {
|
|
106
90
|
backgroundColor: theme.palette.primary.light,
|
|
107
91
|
color: theme.palette.getContrastText(theme.palette.primary.light)
|
|
108
92
|
},
|
|
109
93
|
todoWrapper: {
|
|
110
|
-
borderLeft: '6px solid',
|
|
111
|
-
borderLeftColor: theme.palette.primary.light,
|
|
112
94
|
padding: theme.spacing(1),
|
|
113
95
|
margin: theme.spacing(1)
|
|
96
|
+
},
|
|
97
|
+
psdkTodoAssignmentStatus: {
|
|
98
|
+
backgroundColor: 'var(--app-neutral-light-color)',
|
|
99
|
+
borderRadius: '0.125rem',
|
|
100
|
+
color: theme.embedded.resolutionTextColor,
|
|
101
|
+
fontSize: '0.75rem',
|
|
102
|
+
fontWeight: 'bold',
|
|
103
|
+
lineHeight: 'calc(0.5rem * 2.5)',
|
|
104
|
+
height: 'calc(0.5rem * 2.5)',
|
|
105
|
+
padding: '0 0.5rem',
|
|
106
|
+
textTransform: 'uppercase'
|
|
114
107
|
}
|
|
115
108
|
}));
|
|
116
109
|
|
|
@@ -129,14 +122,14 @@ export default function ToDo(props: ToDoProps) {
|
|
|
129
122
|
const CONSTS = PCore.getConstants();
|
|
130
123
|
|
|
131
124
|
const bLogging = true;
|
|
132
|
-
const currentUser = PCore.getEnvironmentInfo().getOperatorName();
|
|
125
|
+
const currentUser = PCore.getEnvironmentInfo().getOperatorName() ?? '';
|
|
133
126
|
const currentUserInitials = Utils.getInitials(currentUser);
|
|
134
127
|
const assignmentsSource = datasource?.source || myWorkList?.source;
|
|
135
128
|
|
|
136
129
|
const [bShowMore, setBShowMore] = useState(true);
|
|
137
130
|
const [showSnackbar, setShowSnackbar] = useState(false);
|
|
138
131
|
const [snackbarMessage, setSnackbarMessage]: any = useState('');
|
|
139
|
-
|
|
132
|
+
|
|
140
133
|
const [assignments, setAssignments] = useState<any[]>(initAssignments());
|
|
141
134
|
|
|
142
135
|
const thePConn = getPConnect();
|
|
@@ -187,12 +180,14 @@ export default function ToDo(props: ToDoProps) {
|
|
|
187
180
|
};
|
|
188
181
|
|
|
189
182
|
const getAssignmentName = assignment => {
|
|
190
|
-
return type === CONSTS.TODO
|
|
183
|
+
return type === CONSTS.TODO
|
|
184
|
+
? localizedVal(assignment.name, '', PCore.getLocaleUtils().getCaseLocaleReference(assignment.classname))
|
|
185
|
+
: localizedVal(assignment.stepName, '', PCore.getLocaleUtils().getCaseLocaleReference(assignment.classname));
|
|
191
186
|
};
|
|
192
187
|
|
|
193
188
|
function showToast(message: string) {
|
|
194
189
|
const theMessage = `Assignment: ${message}`;
|
|
195
|
-
|
|
190
|
+
|
|
196
191
|
console.error(theMessage);
|
|
197
192
|
setSnackbarMessage(message);
|
|
198
193
|
setShowSnackbar(true);
|
|
@@ -251,7 +246,6 @@ export default function ToDo(props: ToDoProps) {
|
|
|
251
246
|
.openAssignment(id, classname, options)
|
|
252
247
|
.then(() => {
|
|
253
248
|
if (bLogging) {
|
|
254
|
-
// eslint-disable-next-line no-console
|
|
255
249
|
console.log(`openAssignment completed`);
|
|
256
250
|
}
|
|
257
251
|
})
|
|
@@ -271,13 +265,16 @@ export default function ToDo(props: ToDoProps) {
|
|
|
271
265
|
};
|
|
272
266
|
|
|
273
267
|
const getListItemComponent = assignment => {
|
|
268
|
+
const caseLocaleRef = PCore.getLocaleUtils().getCaseLocaleReference(assignment.classname);
|
|
274
269
|
if (isDesktop) {
|
|
275
270
|
return (
|
|
276
271
|
<>
|
|
277
|
-
{localizedVal('
|
|
272
|
+
{localizedVal('In', localeCategory)}
|
|
278
273
|
{renderTaskId(type, getPConnect, showTodoList, assignment)}
|
|
279
274
|
{type === CONSTS.WORKLIST && assignment.status ? `\u2022 ` : undefined}
|
|
280
|
-
{type === CONSTS.WORKLIST && assignment.status ?
|
|
275
|
+
{type === CONSTS.WORKLIST && assignment.status ? (
|
|
276
|
+
<span className='psdk-todo-assignment-status'>{localizedVal(assignment.status, '', caseLocaleRef)}</span>
|
|
277
|
+
) : undefined}
|
|
281
278
|
{` \u2022 ${localizedVal('Urgency', localeCategory)} ${getPriority(assignment)}`}
|
|
282
279
|
</>
|
|
283
280
|
);
|
|
@@ -290,7 +287,6 @@ export default function ToDo(props: ToDoProps) {
|
|
|
290
287
|
);
|
|
291
288
|
};
|
|
292
289
|
|
|
293
|
-
// eslint-disable-next-line no-nested-ternary
|
|
294
290
|
const getCount = () => (assignmentsSource ? assignmentsSource.length : type === CONSTS.WORKLIST ? count : 0);
|
|
295
291
|
|
|
296
292
|
const toDoContent = (
|
|
@@ -311,8 +307,8 @@ export default function ToDo(props: ToDoProps) {
|
|
|
311
307
|
{currentUserInitials}
|
|
312
308
|
</Avatar>
|
|
313
309
|
<div style={{ display: 'block' }}>
|
|
314
|
-
<Typography variant='h6'>{assignment?.name}</Typography>
|
|
315
|
-
{`${localizedVal('
|
|
310
|
+
<Typography variant='h6'>{localizedVal(assignment?.name, localeCategory)}</Typography>
|
|
311
|
+
{`${localizedVal('In', localeCategory)} ${getID(assignment)} \u2022 ${localizedVal(
|
|
316
312
|
'Urgency',
|
|
317
313
|
localeCategory
|
|
318
314
|
)} ${getPriority(assignment)}`}
|
|
@@ -347,13 +343,18 @@ export default function ToDo(props: ToDoProps) {
|
|
|
347
343
|
<CardContent>
|
|
348
344
|
<List>
|
|
349
345
|
{assignments.map(assignment => (
|
|
350
|
-
<ListItem
|
|
351
|
-
|
|
352
|
-
|
|
346
|
+
<ListItem
|
|
347
|
+
key={getAssignmentId(assignment)}
|
|
348
|
+
dense
|
|
349
|
+
divider
|
|
350
|
+
onClick={() => clickGo(assignment)}
|
|
351
|
+
secondaryAction={
|
|
353
352
|
<IconButton onClick={() => clickGo(assignment)} size='large'>
|
|
354
353
|
<ArrowForwardIosOutlinedIcon />
|
|
355
354
|
</IconButton>
|
|
356
|
-
|
|
355
|
+
}
|
|
356
|
+
>
|
|
357
|
+
<ListItemText primary={getAssignmentName(assignment)} secondary={getListItemComponent(assignment)} />
|
|
357
358
|
</ListItem>
|
|
358
359
|
))}
|
|
359
360
|
</List>
|
package/package.json
CHANGED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import download from 'downloadjs';
|
|
2
|
-
|
|
3
|
-
export const validateMaxSize = (fileObj: any, maxSizeInMB: string): boolean => {
|
|
4
|
-
const fileSize = (fileObj.size / 1048576).toFixed(2);
|
|
5
|
-
return parseFloat(fileSize) < parseFloat(maxSizeInMB);
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const fileDownload = (data, fileName, ext) => {
|
|
9
|
-
const name = ext ? `${fileName}.${ext}` : fileName;
|
|
10
|
-
// Temp fix: downloading EMAIl type attachment as html file
|
|
11
|
-
if (ext === 'html') {
|
|
12
|
-
download(data, name, 'text/html');
|
|
13
|
-
} else {
|
|
14
|
-
download(atob(data), name);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const getIconFromFileType = (fileType): string => {
|
|
19
|
-
let icon = 'document-doc';
|
|
20
|
-
if (!fileType) return icon;
|
|
21
|
-
if (fileType.startsWith('audio')) {
|
|
22
|
-
icon = 'audio';
|
|
23
|
-
} else if (fileType.startsWith('video')) {
|
|
24
|
-
icon = 'video';
|
|
25
|
-
} else if (fileType.startsWith('image')) {
|
|
26
|
-
icon = 'picture';
|
|
27
|
-
} else if (fileType.includes('pdf')) {
|
|
28
|
-
icon = 'document-pdf';
|
|
29
|
-
} else {
|
|
30
|
-
const [, subtype] = fileType.split('/');
|
|
31
|
-
const foundMatch = sources => {
|
|
32
|
-
return sources.some(key => subtype.includes(key));
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
if (foundMatch(['excel', 'spreadsheet'])) {
|
|
36
|
-
icon = 'document-xls';
|
|
37
|
-
} else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {
|
|
38
|
-
icon = 'document-compress';
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return icon;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const getIconForAttachment = (inThis: any, attachment: any): string => {
|
|
46
|
-
let icon;
|
|
47
|
-
switch (attachment.type) {
|
|
48
|
-
case 'FILE':
|
|
49
|
-
icon = inThis.getIconFromFileType(attachment.mimeType);
|
|
50
|
-
break;
|
|
51
|
-
case 'URL':
|
|
52
|
-
icon = 'chain';
|
|
53
|
-
break;
|
|
54
|
-
default:
|
|
55
|
-
icon = 'document-doc';
|
|
56
|
-
}
|
|
57
|
-
return icon;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const buildFilePropsFromResponse = (
|
|
61
|
-
respObj
|
|
62
|
-
): {
|
|
63
|
-
props: { meta: string; name: string; icon: string };
|
|
64
|
-
responseProps: any;
|
|
65
|
-
} => {
|
|
66
|
-
return {
|
|
67
|
-
props: {
|
|
68
|
-
meta: `${respObj.pyCategoryName}, ${respObj.pxCreateOperator}`,
|
|
69
|
-
name: respObj.pyAttachName,
|
|
70
|
-
icon: getIconFromFileType(respObj.pyMimeFileExtension)
|
|
71
|
-
},
|
|
72
|
-
responseProps: {
|
|
73
|
-
...respObj
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
2
|
-
export const isContainerInitialized = pConnect => {
|
|
3
|
-
const context = pConnect.getContextName();
|
|
4
|
-
const containerName = pConnect.getContainerName();
|
|
5
|
-
return PCore.getContainerUtils().isContainerInitialized(context, containerName);
|
|
6
|
-
};
|