@pega/dx-component-builder-sdk 0.23.6 → 0.23.7

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.
Files changed (136) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/create/templates/Constellation/field/Text-Input/index.jsx.mustache +1 -1
  3. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +47 -0
  4. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/AlertBanner/index.tsx +1 -0
  5. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +5 -3
  6. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +1 -1
  7. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +121 -0
  8. package/tests/assets/components/SDK-React/create/override-sdk/designSystemExtension/RichTextEditor/index.tsx +1 -0
  9. package/tests/assets/components/SDK-React/create/override-sdk/field/AutoComplete/AutoComplete.tsx +29 -27
  10. package/tests/assets/components/SDK-React/create/override-sdk/field/Checkbox/Checkbox.tsx +10 -6
  11. package/tests/assets/components/SDK-React/create/override-sdk/field/Currency/Currency.tsx +16 -15
  12. package/tests/assets/components/SDK-React/create/override-sdk/field/Date/Date.tsx +16 -15
  13. package/tests/assets/components/SDK-React/create/override-sdk/field/DateTime/DateTime.tsx +19 -14
  14. package/tests/assets/components/SDK-React/create/override-sdk/field/Decimal/Decimal.tsx +18 -16
  15. package/tests/assets/components/SDK-React/create/override-sdk/field/Dropdown/Dropdown.tsx +17 -25
  16. package/tests/assets/components/SDK-React/create/override-sdk/field/Email/Email.tsx +11 -11
  17. package/tests/assets/components/SDK-React/create/override-sdk/field/Integer/Integer.tsx +9 -7
  18. package/tests/assets/components/SDK-React/create/override-sdk/field/Percentage/Percentage.tsx +9 -9
  19. package/tests/assets/components/SDK-React/create/override-sdk/field/Phone/Phone.tsx +13 -12
  20. package/tests/assets/components/SDK-React/create/override-sdk/field/RadioButtons/RadioButtons.tsx +16 -35
  21. package/tests/assets/components/SDK-React/create/override-sdk/field/RichText/RichText.tsx +95 -0
  22. package/tests/assets/components/SDK-React/create/override-sdk/field/RichText/index.tsx +1 -0
  23. package/tests/assets/components/SDK-React/create/override-sdk/field/ScalarList/ScalarList.tsx +73 -0
  24. package/tests/assets/components/SDK-React/create/override-sdk/field/ScalarList/config-ext.json +8 -0
  25. package/tests/assets/components/SDK-React/create/override-sdk/field/ScalarList/index.tsx +1 -0
  26. package/tests/assets/components/SDK-React/create/override-sdk/field/SemanticLink/SemanticLink.tsx +19 -19
  27. package/tests/assets/components/SDK-React/create/override-sdk/field/TextArea/TextArea.tsx +8 -6
  28. package/tests/assets/components/SDK-React/create/override-sdk/field/TextInput/TextInput.tsx +8 -7
  29. package/tests/assets/components/SDK-React/create/override-sdk/field/Time/Time.tsx +16 -28
  30. package/tests/assets/components/SDK-React/create/override-sdk/field/URL/URL.tsx +10 -8
  31. package/tests/assets/components/SDK-React/create/override-sdk/field/UserReference/UserReference.tsx +29 -29
  32. package/tests/assets/components/SDK-React/create/override-sdk/infra/Assignment/Assignment.tsx +5 -2
  33. package/tests/assets/components/SDK-React/create/override-sdk/infra/AssignmentCard/AssignmentCard.tsx +4 -2
  34. package/tests/assets/components/SDK-React/create/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +13 -13
  35. package/tests/assets/components/SDK-React/create/override-sdk/infra/DashboardFilter/filterUtils.tsx +2 -1
  36. package/tests/assets/components/SDK-React/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +172 -0
  37. package/tests/assets/components/SDK-React/create/override-sdk/infra/DeferLoad/index.tsx +1 -0
  38. package/tests/assets/components/SDK-React/create/override-sdk/infra/MultiStep/MultiStep.tsx +4 -3
  39. package/tests/assets/components/SDK-React/create/override-sdk/infra/NavBar/NavBar.tsx +2 -1
  40. package/tests/assets/components/SDK-React/create/override-sdk/infra/VerticalTabs/VerticalTabs.tsx +4 -1
  41. package/tests/assets/components/SDK-React/create/override-sdk/template/AppShell/AppShell.tsx +6 -4
  42. package/tests/assets/components/SDK-React/create/override-sdk/template/BannerPage/BannerPage.tsx +4 -1
  43. package/tests/assets/components/SDK-React/create/override-sdk/template/CaseSummary/CaseSummary.tsx +4 -1
  44. package/tests/assets/components/SDK-React/create/override-sdk/template/CaseView/CaseView.tsx +10 -13
  45. package/tests/assets/components/SDK-React/create/override-sdk/template/Confirmation/Confirmation.tsx +23 -44
  46. package/tests/assets/components/SDK-React/create/override-sdk/template/DataReference/DataReference.tsx +43 -64
  47. package/tests/assets/components/SDK-React/create/override-sdk/template/Details/Details.tsx +8 -4
  48. package/tests/assets/components/SDK-React/create/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +8 -4
  49. package/tests/assets/components/SDK-React/create/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +8 -4
  50. package/tests/assets/components/SDK-React/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +6 -2
  51. package/tests/assets/components/SDK-React/create/override-sdk/template/InlineDashboardPage/InlineDashboardPage.tsx +5 -1
  52. package/tests/assets/components/SDK-React/create/override-sdk/template/ListPage/ListPage.tsx +6 -3
  53. package/tests/assets/components/SDK-React/create/override-sdk/template/ListView/ListView.tsx +89 -93
  54. package/tests/assets/components/SDK-React/create/override-sdk/template/ListView/utils.ts +170 -23
  55. package/tests/assets/components/SDK-React/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +9 -9
  56. package/tests/assets/components/SDK-React/create/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +8 -4
  57. package/tests/assets/components/SDK-React/create/override-sdk/template/NarrowWidePage/NarrowWidePage.tsx +4 -1
  58. package/tests/assets/components/SDK-React/create/override-sdk/template/OneColumnPage/OneColumnPage.tsx +3 -1
  59. package/tests/assets/components/SDK-React/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +4 -1
  60. package/tests/assets/components/SDK-React/create/override-sdk/template/SimpleTable/SimpleTable.tsx +88 -5
  61. package/tests/assets/components/SDK-React/create/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +6 -4
  62. package/tests/assets/components/SDK-React/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +22 -18
  63. package/tests/assets/components/SDK-React/create/override-sdk/template/TwoColumnPage/TwoColumnPage.tsx +3 -2
  64. package/tests/assets/components/SDK-React/create/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +8 -3
  65. package/tests/assets/components/SDK-React/create/override-sdk/template/WideNarrowPage/WideNarrowPage.tsx +4 -3
  66. package/tests/assets/components/SDK-React/create/override-sdk/widget/Attachment/Attachment.tsx +5 -1
  67. package/tests/assets/components/SDK-React/create/override-sdk/widget/FileUtility/FileUtility.tsx +8 -2
  68. package/tests/assets/components/SDK-React/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +4 -1
  69. package/tests/assets/components/SDK-React/create/override-sdk/widget/SummaryList/SummaryList.tsx +4 -1
  70. package/tests/assets/components/SDK-React/create/override-sdk/widget/ToDo/ToDo.tsx +53 -82
  71. package/tests/assets/components/SDK-React/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/index.jsx +1 -1
  72. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +47 -0
  73. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/AlertBanner/index.tsx +1 -0
  74. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +5 -3
  75. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +121 -0
  76. package/tests/assets/components/SDK-React/createAll/override-sdk/designSystemExtension/RichTextEditor/index.tsx +1 -0
  77. package/tests/assets/components/SDK-React/createAll/override-sdk/field/AutoComplete/AutoComplete.tsx +29 -27
  78. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Checkbox/Checkbox.tsx +10 -6
  79. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Currency/Currency.tsx +16 -15
  80. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Date/Date.tsx +16 -15
  81. package/tests/assets/components/SDK-React/createAll/override-sdk/field/DateTime/DateTime.tsx +19 -14
  82. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Decimal/Decimal.tsx +18 -16
  83. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Dropdown/Dropdown.tsx +17 -25
  84. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Email/Email.tsx +11 -11
  85. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Integer/Integer.tsx +9 -7
  86. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Percentage/Percentage.tsx +9 -9
  87. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Phone/Phone.tsx +13 -12
  88. package/tests/assets/components/SDK-React/createAll/override-sdk/field/RadioButtons/RadioButtons.tsx +16 -35
  89. package/tests/assets/components/SDK-React/createAll/override-sdk/field/RichText/RichText.tsx +95 -0
  90. package/tests/assets/components/SDK-React/createAll/override-sdk/field/RichText/index.tsx +1 -0
  91. package/tests/assets/components/SDK-React/createAll/override-sdk/field/ScalarList/ScalarList.tsx +25 -18
  92. package/tests/assets/components/SDK-React/createAll/override-sdk/field/SemanticLink/SemanticLink.tsx +19 -19
  93. package/tests/assets/components/SDK-React/createAll/override-sdk/field/TextArea/TextArea.tsx +8 -6
  94. package/tests/assets/components/SDK-React/createAll/override-sdk/field/TextInput/TextInput.tsx +8 -7
  95. package/tests/assets/components/SDK-React/createAll/override-sdk/field/Time/Time.tsx +16 -28
  96. package/tests/assets/components/SDK-React/createAll/override-sdk/field/URL/URL.tsx +10 -8
  97. package/tests/assets/components/SDK-React/createAll/override-sdk/field/UserReference/UserReference.tsx +29 -29
  98. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/Assignment/Assignment.tsx +5 -2
  99. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/AssignmentCard/AssignmentCard.tsx +4 -2
  100. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +172 -0
  101. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/DeferLoad/index.tsx +1 -0
  102. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +4 -3
  103. package/tests/assets/components/SDK-React/createAll/override-sdk/infra/VerticalTabs/VerticalTabs.tsx +4 -1
  104. package/tests/assets/components/SDK-React/createAll/override-sdk/template/AppShell/AppShell.tsx +6 -4
  105. package/tests/assets/components/SDK-React/createAll/override-sdk/template/BannerPage/BannerPage.tsx +4 -1
  106. package/tests/assets/components/SDK-React/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +4 -1
  107. package/tests/assets/components/SDK-React/createAll/override-sdk/template/CaseView/CaseView.tsx +6 -3
  108. package/tests/assets/components/SDK-React/createAll/override-sdk/template/Confirmation/Confirmation.tsx +23 -44
  109. package/tests/assets/components/SDK-React/createAll/override-sdk/template/DataReference/DataReference.tsx +6 -2
  110. package/tests/assets/components/SDK-React/createAll/override-sdk/template/Details/Details.tsx +5 -1
  111. package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +5 -1
  112. package/tests/assets/components/SDK-React/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +5 -1
  113. package/tests/assets/components/SDK-React/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +6 -2
  114. package/tests/assets/components/SDK-React/createAll/override-sdk/template/InlineDashboardPage/InlineDashboardPage.tsx +5 -1
  115. package/tests/assets/components/SDK-React/createAll/override-sdk/template/ListPage/ListPage.tsx +6 -3
  116. package/tests/assets/components/SDK-React/createAll/override-sdk/template/ListView/ListView.tsx +89 -93
  117. package/tests/assets/components/SDK-React/createAll/override-sdk/template/ListView/utils.ts +170 -23
  118. package/tests/assets/components/SDK-React/createAll/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +5 -1
  119. package/tests/assets/components/SDK-React/createAll/override-sdk/template/NarrowWidePage/NarrowWidePage.tsx +4 -1
  120. package/tests/assets/components/SDK-React/createAll/override-sdk/template/OneColumnPage/OneColumnPage.tsx +3 -1
  121. package/tests/assets/components/SDK-React/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +4 -1
  122. package/tests/assets/components/SDK-React/createAll/override-sdk/template/SimpleTable/SimpleTable.tsx +88 -5
  123. package/tests/assets/components/SDK-React/createAll/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +6 -4
  124. package/tests/assets/components/SDK-React/createAll/override-sdk/template/TwoColumnPage/TwoColumnPage.tsx +3 -2
  125. package/tests/assets/components/SDK-React/createAll/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +5 -1
  126. package/tests/assets/components/SDK-React/createAll/override-sdk/template/WideNarrowPage/WideNarrowPage.tsx +4 -3
  127. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/Attachment/Attachment.tsx +5 -1
  128. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +8 -2
  129. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +4 -1
  130. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/SummaryList/SummaryList.tsx +4 -1
  131. package/tests/assets/components/SDK-React/createAll/override-sdk/widget/ToDo/ToDo.tsx +53 -82
  132. package/tests/functional/localCreateBuildAllDeleteAllCustom.test.js +1 -1
  133. package/tests/functional/localCreateBuildDeleteOverride.test.js +2 -1
  134. package/tests/functional/localCreatePublishAllDeleteAllCustom.test.js +1 -2
  135. package/tests/functional/localCreatePublishAllDeleteAllOverride.test.js +0 -4
  136. package/tests/functional/localCreatePublishDeleteOverride.test.js +2 -5
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
-
3
- import TwoColumn from '@pega/react-sdk-components/lib/components/template/TwoColumn/TwoColumn';
2
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
3
 
5
4
  // TwoColumnPage does NOT have getPConnect. So, no need to extend from PConnProps
6
5
  interface TwoColumnPageProps{
@@ -14,6 +13,8 @@ interface TwoColumnPageProps{
14
13
  * and mapping to the TwoColumn template.
15
14
  */
16
15
  export default function TwoColumnPage(props: TwoColumnPageProps) {
16
+ // Get emitted components from map (so we can get any override that may exist)
17
+ const TwoColumn = getComponentFromMap('TwoColumn');
17
18
 
18
19
  return (
19
20
  <TwoColumn
@@ -2,10 +2,11 @@ import React, { createElement } from 'react';
2
2
  import Grid from '@material-ui/core/Grid';
3
3
  import { GridSize } from '@material-ui/core/Grid';
4
4
  import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
5
- import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
5
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
6
+
6
7
  // import type { PConnProps } from '../../../../types/PConnProps';
7
8
 
8
- // Can't use PConnProps until createComponent types are ok
9
+ // Can't use PConnProps until PConnect.getChildren() type is ok
9
10
  // interface WideNarrowDetailsProps extends PConnProps {
10
11
  // // If any, enter additional props that only exist on this component
11
12
  // showLabel?: boolean,
@@ -16,6 +17,9 @@ import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemEx
16
17
  const COLUMN_WIDTHS = [8, 4];
17
18
 
18
19
  export default function WideNarrowDetails(props /* : WideNarrowDetailsProps */) {
20
+ // Get emitted components from map (so we can get any override that may exist)
21
+ const FieldGroup = getComponentFromMap('FieldGroup');
22
+
19
23
  const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
20
24
 
21
25
  // Get the inherited props from the parent to determine label settings
@@ -53,7 +57,8 @@ export default function WideNarrowDetails(props /* : WideNarrowDetailsProps */)
53
57
  field.config.displayAsStatus = true;
54
58
  }
55
59
 
56
- return getPConnect().createComponent(field);
60
+ return getPConnect().createComponent(field,
61
+ '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
57
62
  });
58
63
  }
59
64
 
@@ -1,7 +1,5 @@
1
1
  import React, { Children } from "react";
2
-
3
- // import { TwoColumnPage as TwoColumn } from "@pega/cosmos-react-core";
4
- import WideNarrow from '@pega/react-sdk-components/lib/components/template/WideNarrow/WideNarrow';
2
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
3
 
6
4
  // WideNarrowPage does NOT have getPConnect. So, no need to extend from PConnProps
7
5
  interface WideNarrowPageProps {
@@ -18,6 +16,9 @@ interface WideNarrowPageProps {
18
16
  * to the Cosmos template.
19
17
  */
20
18
  export default function WideNarrowPage(props: WideNarrowPageProps) {
19
+ // Get emitted components from map (so we can get any override that may exist)
20
+ const WideNarrow = getComponentFromMap('WideNarrow');
21
+
21
22
  const { children, title, templateCol = '1fr 1fr', icon = '' } = props;
22
23
  const childArray = Children.toArray(children);
23
24
 
@@ -4,9 +4,10 @@ import { Button } from '@material-ui/core';
4
4
  import React, { useState, useEffect } from 'react';
5
5
  import { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize, getIconForAttachment } from '@pega/react-sdk-components/lib/components/helpers/attachmentHelpers';
6
6
  import './Attachment.css';
7
- import SummaryList from '@pega/react-sdk-components/lib/components/widget/SummaryList'
8
7
  import { CircularProgress } from "@material-ui/core";
9
8
  import download from "downloadjs";
9
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
10
+
10
11
  // import type { PConnProps } from '../../../types/PConnProps';
11
12
 
12
13
  // Remove this and use "real" PCore type once .d.ts is fixed (currently shows 2 errors)
@@ -27,6 +28,9 @@ function getCurrentAttachmentsList(key, context) {
27
28
  }
28
29
 
29
30
  export default function Attachment(props /* :AttachmentProps */) {
31
+ // Get emitted components from map (so we can get any override that may exist)
32
+ const SummaryList = getComponentFromMap('SummaryList');
33
+
30
34
  const PCoreVersion = PCore.getPCoreVersion();
31
35
  const {value, getPConnect, label, validatemessage} = props;
32
36
  /* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */
@@ -2,14 +2,16 @@ import React, { useEffect, useState } from "react";
2
2
  import TextField from '@material-ui/core/TextField';
3
3
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
4
4
  import download from "downloadjs";
5
- import SummaryList from '@pega/react-sdk-components/lib/components/widget/SummaryList';
6
- import ActionButtonsForFileUtil from '@pega/react-sdk-components/lib/components/widget/FileUtility/ActionButtonsForFileUtil';
5
+ // import SummaryList from '../../SummaryList';
6
+ // import ActionButtonsForFileUtil from '../ActionButtonsForFileUtil';
7
7
  import './FileUtility.css';
8
8
  import { IconButton, Menu, MenuItem } from '@material-ui/core';
9
9
  import MoreVertIcon from '@material-ui/icons/MoreVert';
10
10
  import { Button } from '@material-ui/core';
11
11
  import { validateMaxSize } from '@pega/react-sdk-components/lib/components/helpers/attachmentHelpers';
12
12
  import { CircularProgress } from "@material-ui/core";
13
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
14
+
13
15
  import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
14
16
 
15
17
 
@@ -23,6 +25,10 @@ declare const PCore: any;
23
25
 
24
26
 
25
27
  export default function FileUtility(props:FileUtilityProps) {
28
+ // Get emitted components from map (so we can get any override that may exist)
29
+ const SummaryList = getComponentFromMap('SummaryList');
30
+ const ActionButtonsForFileUtil = getComponentFromMap('ActionButtonsForFileUtil');
31
+
26
32
  const { getPConnect } = props;
27
33
  const thePConn = getPConnect();
28
34
  const required = true;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import WssQuickCreate from '@pega/react-sdk-components/lib/components/designSystemExtension/WssQuickCreate';
3
2
  import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
3
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
4
4
  // import type { PConnProps } from '../../../types/PConnProps';
5
5
 
6
6
  // Can't add PConnTypes until we can resolve type problems with
@@ -11,6 +11,9 @@ import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
11
11
 
12
12
 
13
13
  export default function QuickCreate(props /* : QuickCreateProps */) {
14
+ // Get emitted components from map (so we can get any override that may exist)
15
+ const WssQuickCreate = getComponentFromMap('WssQuickCreate');
16
+
14
17
  const { getPConnect, heading, showCaseIcons, classFilter } = props;
15
18
  const pConn = getPConnect();
16
19
  const createCase = (className) => {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import SummaryItem from '@pega/react-sdk-components/lib/components/widget/SummaryItem/index'
2
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
3
3
 
4
4
  // SummaryList does NOT have getPConnect. So, no need to extend from PConnProps
5
5
 
@@ -12,6 +12,9 @@ interface SummaryListProps {
12
12
 
13
13
 
14
14
  export default function SummaryList(props: SummaryListProps) {
15
+ // Get emitted components from map (so we can get any override that may exist)
16
+ const SummaryItem = getComponentFromMap('SummaryItem');
17
+
15
18
  const { menuIconOverride$: menuOverride = ""} = props;
16
19
  return (
17
20
  <div>
@@ -31,22 +31,21 @@ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps
31
31
 
32
32
  interface ToDoProps extends PConnProps {
33
33
  // If any, enter additional props that only exist on this component
34
- datasource?: any,
35
- myWorkList?: any,
34
+ datasource?: any;
35
+ myWorkList?: any;
36
36
  // eslint-disable-next-line react/no-unused-prop-types
37
- caseInfoID?: string,
38
- headerText?: string,
37
+ caseInfoID?: string;
38
+ headerText?: string;
39
39
  // eslint-disable-next-line react/no-unused-prop-types
40
- itemKey?: string,
41
- showTodoList?: boolean,
42
- type?: string,
40
+ itemKey?: string;
41
+ showTodoList?: boolean;
42
+ type?: string;
43
43
  // eslint-disable-next-line react/no-unused-prop-types
44
- context?: string,
45
- isConfirm?: boolean
44
+ context?: string;
45
+ isConfirm?: boolean;
46
46
  }
47
47
 
48
-
49
- const isChildCase = assignment => {
48
+ const isChildCase = (assignment) => {
50
49
  return assignment.isChild;
51
50
  };
52
51
 
@@ -65,7 +64,7 @@ function getID(assignment: any) {
65
64
  }
66
65
  }
67
66
 
68
- const useStyles = makeStyles(theme => ({
67
+ const useStyles = makeStyles((theme) => ({
69
68
  root: {
70
69
  marginTop: theme.spacing(1),
71
70
  marginBottom: theme.spacing(1),
@@ -86,15 +85,7 @@ const useStyles = makeStyles(theme => ({
86
85
  }));
87
86
 
88
87
  export default function ToDo(props: ToDoProps) {
89
- const {
90
- getPConnect,
91
- datasource = [],
92
- headerText = 'To do',
93
- showTodoList = true,
94
- myWorkList = {},
95
- type = 'worklist',
96
- isConfirm = false
97
- } = props;
88
+ const { getPConnect, datasource = [], headerText = 'To do', showTodoList = true, myWorkList = {}, type = 'worklist', isConfirm = false } = props;
98
89
 
99
90
  const CONSTS = PCore.getConstants();
100
91
 
@@ -130,15 +121,15 @@ export default function ToDo(props: ToDoProps) {
130
121
  }
131
122
  }
132
123
 
133
- const getAssignmentId = assignment => {
124
+ const getAssignmentId = (assignment) => {
134
125
  return type === CONSTS.TODO ? assignment.ID : assignment.id;
135
126
  };
136
127
 
137
- const getPriority = assignment => {
128
+ const getPriority = (assignment) => {
138
129
  return type === CONSTS.TODO ? assignment.urgency : assignment.priority;
139
130
  };
140
131
 
141
- const getAssignmentName = assignment => {
132
+ const getAssignmentName = (assignment) => {
142
133
  return type === CONSTS.TODO ? assignment.name : assignment.stepName;
143
134
  };
144
135
 
@@ -173,7 +164,7 @@ export default function ToDo(props: ToDoProps) {
173
164
  const sTarget = thePConn.getContainerName();
174
165
  const sTargetContainerName = sTarget;
175
166
 
176
- const options = { containerName: sTargetContainerName, channelName: "" };
167
+ const options = { containerName: sTargetContainerName, channelName: '' };
177
168
 
178
169
  if (classname === null || classname === '') {
179
170
  classname = thePConn.getCaseInfo().getClassName();
@@ -208,30 +199,26 @@ export default function ToDo(props: ToDoProps) {
208
199
 
209
200
  if ((showTodoList && type !== CONSTS.TODO) || assignment.isChild === true) {
210
201
  /* Supress link for todo inside flow step */
211
- return (
212
- <Button size='small' color='primary'>{`${assignment.name} ${getID(assignment)}`}</Button>
213
- );
202
+ return <Button size="small" color="primary">{`${assignment.name} ${getID(assignment)}`}</Button>;
214
203
  }
215
204
  return displayID;
216
205
  };
217
206
 
218
- const getListItemComponent = assignment => {
207
+ const getListItemComponent = (assignment) => {
219
208
  if (isDesktop) {
220
209
  return (
221
210
  <>
222
211
  {localizedVal('Task in', localeCategory)}
223
212
  {renderTaskId(type, getPConnect, showTodoList, assignment)}
224
213
  {type === CONSTS.WORKLIST && assignment.status ? `\u2022 ` : undefined}
225
- {type === CONSTS.WORKLIST && assignment.status ? (
226
- <span className='psdk-todo-assignment-status'>{assignment.status}</span>
227
- ) : undefined}
214
+ {type === CONSTS.WORKLIST && assignment.status ? <span className="psdk-todo-assignment-status">{assignment.status}</span> : undefined}
228
215
  {` \u2022 ${localizedVal('Urgency', localeCategory)} ${getPriority(assignment)}`}
229
216
  </>
230
217
  );
231
218
  }
232
219
  return (
233
220
  <>
234
- <Button size='small' color='primary'>{`${assignment.name} ${getID(assignment)}`}</Button>
221
+ <Button size="small" color="primary">{`${assignment.name} ${getID(assignment)}`}</Button>
235
222
  {` \u2022 ${localizedVal('Urgency', localeCategory)} ${getPriority(assignment)}`}
236
223
  </>
237
224
  );
@@ -242,37 +229,33 @@ export default function ToDo(props: ToDoProps) {
242
229
  {showTodoList && (
243
230
  <CardHeader
244
231
  title={
245
- <Badge badgeContent={assignmentCount} color='primary'>
246
- <Typography variant='h6'>{headerText}&nbsp;&nbsp;&nbsp;</Typography>
232
+ <Badge badgeContent={assignmentCount} overlap="rectangular" color="primary">
233
+ <Typography variant="h6">{headerText}&nbsp;&nbsp;&nbsp;</Typography>
247
234
  </Badge>
248
235
  }
249
236
  ></CardHeader>
250
237
  )}
251
238
  <List>
252
- {assignments.map(assignment => (
253
- <>
254
- <div className='psdk-todo-avatar-header' key={getAssignmentId(assignment)}>
255
- <Avatar className={classes.avatar} style={{ marginRight: '16px' }}>
256
- {currentUserInitials}
257
- </Avatar>
258
- <div style={{ display: 'block' }}>
259
- <Typography variant='h6'>{assignment?.name}</Typography>
260
- {`${localizedVal('Task in', localeCategory)} ${renderTaskId(
261
- type,
262
- getPConnect,
263
- showTodoList,
264
- assignment
265
- )} \u2022 ${localizedVal('Urgency', localeCategory)} ${getPriority(assignment)}`}
266
- </div>
267
- {!isConfirm && (
268
- <div style={{ marginLeft: 'auto' }}>
269
- <IconButton onClick={() => clickGo(assignment)}>
270
- <ArrowForwardIosOutlinedIcon />
271
- </IconButton>
272
- </div>
273
- )}
239
+ {assignments.map((assignment) => (
240
+ <div className="psdk-todo-avatar-header" key={getAssignmentId(assignment)}>
241
+ <Avatar className={classes.avatar} style={{ marginRight: '16px' }}>
242
+ {currentUserInitials}
243
+ </Avatar>
244
+ <div style={{ display: 'block' }}>
245
+ <Typography variant="h6">{assignment?.name}</Typography>
246
+ {`${localizedVal('Task in', localeCategory)} ${renderTaskId(type, getPConnect, showTodoList, assignment)} \u2022 ${localizedVal(
247
+ 'Urgency',
248
+ localeCategory
249
+ )} ${getPriority(assignment)}`}
274
250
  </div>
275
- </>
251
+ {!isConfirm && (
252
+ <div style={{ marginLeft: 'auto' }}>
253
+ <IconButton onClick={() => clickGo(assignment)}>
254
+ <ArrowForwardIosOutlinedIcon />
255
+ </IconButton>
256
+ </div>
257
+ )}
258
+ </div>
276
259
  ))}
277
260
  </List>
278
261
  </>
@@ -285,8 +268,8 @@ export default function ToDo(props: ToDoProps) {
285
268
  {showTodoList && (
286
269
  <CardHeader
287
270
  title={
288
- <Badge badgeContent={assignmentCount} color='primary'>
289
- <Typography variant='h6'>{headerText}&nbsp;&nbsp;&nbsp;</Typography>
271
+ <Badge badgeContent={assignmentCount} overlap="rectangular" color="primary">
272
+ <Typography variant="h6">{headerText}&nbsp;&nbsp;&nbsp;</Typography>
290
273
  </Badge>
291
274
  }
292
275
  avatar={<Avatar className={classes.avatar}>{currentUserInitials}</Avatar>}
@@ -294,17 +277,9 @@ export default function ToDo(props: ToDoProps) {
294
277
  )}
295
278
  <CardContent>
296
279
  <List>
297
- {assignments.map(assignment => (
298
- <ListItem
299
- key={getAssignmentId(assignment)}
300
- dense
301
- divider
302
- onClick={() => clickGo(assignment)}
303
- >
304
- <ListItemText
305
- primary={getAssignmentName(assignment)}
306
- secondary={getListItemComponent(assignment)}
307
- />
280
+ {assignments.map((assignment) => (
281
+ <ListItem key={getAssignmentId(assignment)} dense divider onClick={() => clickGo(assignment)}>
282
+ <ListItemText primary={getAssignmentName(assignment)} secondary={getListItemComponent(assignment)} />
308
283
  <ListItemSecondaryAction>
309
284
  <IconButton onClick={() => clickGo(assignment)}>
310
285
  <ArrowForwardIosOutlinedIcon />
@@ -317,21 +292,17 @@ export default function ToDo(props: ToDoProps) {
317
292
  </Card>
318
293
  )}
319
294
 
320
- {type === CONSTS.TODO && !isConfirm && (
321
- <Card className={classes.todoWrapper}>{toDoContent}</Card>
322
- )}
295
+ {type === CONSTS.TODO && !isConfirm && <Card className={classes.todoWrapper}>{toDoContent}</Card>}
323
296
  {type === CONSTS.TODO && isConfirm && <Fragment>{toDoContent}</Fragment>}
324
297
 
325
298
  {assignmentCount > 3 && (
326
- <Box display='flex' justifyContent='center'>
299
+ <Box display="flex" justifyContent="center">
327
300
  {bShowMore ? (
328
- <Button color='primary' onClick={_showMore}>
329
- {showMoreLocalizedValue === 'show_more' ? 'Show more': showMoreLocalizedValue}
301
+ <Button color="primary" onClick={_showMore}>
302
+ {showMoreLocalizedValue === 'show_more' ? 'Show more' : showMoreLocalizedValue}
330
303
  </Button>
331
304
  ) : (
332
- <Button onClick={_showLess}>
333
- {showlessLocalizedValue === 'show_less' ? 'Show less': showlessLocalizedValue}
334
- </Button>
305
+ <Button onClick={_showLess}>{showlessLocalizedValue === 'show_less' ? 'Show less' : showlessLocalizedValue}</Button>
335
306
  )}
336
307
  </Box>
337
308
  )}
@@ -342,8 +313,8 @@ export default function ToDo(props: ToDoProps) {
342
313
  onClose={handleSnackbarClose}
343
314
  message={snackbarMessage}
344
315
  action={
345
- <IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>
346
- <CloseIcon fontSize='small' />
316
+ <IconButton size="small" aria-label="close" color="inherit" onClick={handleSnackbarClose}>
317
+ <CloseIcon fontSize="small" />
347
318
  </IconButton>
348
319
  }
349
320
  />
@@ -102,7 +102,7 @@ const PegaDxilMyTextInput = props => {
102
102
  } else if (!hasSuggestions && status !== 'success') {
103
103
  setStatus(validatemessage !== '' ? 'error' : undefined);
104
104
  }
105
- }, [validatemessage, hasSuggestions]);
105
+ }, [validatemessage, hasSuggestions, status]);
106
106
 
107
107
  const onResolveSuggestionHandler = (accepted) => {
108
108
  suggestionsHandler(accepted, pConn, setStatus);
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { Alert } from '@material-ui/lab';
3
+
4
+
5
+ // AlertBanner is one of the few components that does NOT have getPConnect.
6
+ // So, no need to extend PConnProps
7
+ interface AlertBannerProps {
8
+ // If any, enter additional props that only exist on Date here
9
+ id: string,
10
+ variant: string,
11
+ messages: Array<string>,
12
+ onDismiss?: any
13
+ }
14
+
15
+
16
+ const SEVERITY_MAP = {
17
+ urgent: 'error',
18
+ warning: 'warning',
19
+ success: 'success',
20
+ info: 'info'
21
+ };
22
+
23
+ export default function AlertBanner(props:AlertBannerProps) {
24
+ const { id, variant, messages, onDismiss } = props;
25
+ let additionalProps = {};
26
+
27
+ if (onDismiss) {
28
+ additionalProps = {
29
+ onClose: onDismiss
30
+ };
31
+ }
32
+
33
+ return (
34
+ <div id={id}>
35
+ {messages.map(message => (
36
+ <Alert
37
+ key={message}
38
+ variant='outlined'
39
+ severity={SEVERITY_MAP[variant]}
40
+ {...additionalProps}
41
+ >
42
+ {message}
43
+ </Alert>
44
+ ))}
45
+ </div>
46
+ );
47
+ }
@@ -1,11 +1,10 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import isDeepEqual from 'fast-deep-equal/react';
3
-
4
3
  import Grid from '@material-ui/core/Grid';
5
4
  import TextField from '@material-ui/core/TextField';
6
- import Operator from '@pega/react-sdk-components/lib/components/designSystemExtension/Operator';
7
5
  import { getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
8
6
  import { getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
7
+ import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
9
8
 
10
9
  import './CaseSummaryFields.css';
11
10
 
@@ -21,7 +20,10 @@ interface CaseSummaryFieldsProps{
21
20
  }
22
21
 
23
22
 
24
- export default function CaseSummaryFields(props:CaseSummaryFieldsProps) {
23
+ export default function CaseSummaryFields(props: CaseSummaryFieldsProps) {
24
+ // Get emitted components from map (so we can get any override that may exist)
25
+ const Operator = getComponentFromMap("Operator");
26
+
25
27
  const { status, showStatus, theFields } = props;
26
28
 
27
29
  const [theFieldsToRender, setFieldsToRender] = useState([]);
@@ -0,0 +1,121 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { Editor } from '@tinymce/tinymce-react';
3
+ import { FormControl, FormHelperText, InputLabel, makeStyles } from '@material-ui/core';
4
+ import { useAfterInitialEffect, useConsolidatedRef, useUID } from '@pega/react-sdk-components/lib/hooks';
5
+
6
+ const useStyles = makeStyles((theme) => ({
7
+ fieldLabel: {
8
+ position: 'relative',
9
+ transform: 'translate(0, 0px) scale(1)',
10
+ marginBottom: '5px',
11
+ color: theme.palette.text.secondary
12
+ }
13
+ }));
14
+
15
+ interface RichTextEditorProps {
16
+ id?: string;
17
+ defaultValue: string;
18
+ label: string;
19
+ labelHidden: boolean;
20
+ info: string;
21
+ testId: string;
22
+ placeholder: string;
23
+ disabled: boolean;
24
+ required: boolean;
25
+ readOnly: boolean;
26
+ error: boolean;
27
+ onBlur: React.EventHandler<any>;
28
+ onChange: React.EventHandler<any>;
29
+ }
30
+
31
+ const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorProps, ref) {
32
+ const classes = useStyles();
33
+ const uid = useUID();
34
+ const { id = uid, defaultValue, label, labelHidden, info, testId, placeholder, disabled, required, readOnly, error, onBlur, onChange } = props;
35
+
36
+ const editorRef: any = useConsolidatedRef(ref);
37
+ let richTextComponent: any = null;
38
+
39
+ useAfterInitialEffect(() => {
40
+ editorRef?.current.mode.set(readOnly || disabled ? 'readonly' : 'design');
41
+ }, [readOnly, disabled]);
42
+
43
+ const filePickerCallback = (cb) => {
44
+ const input = document.createElement('input');
45
+ input.setAttribute('type', 'file');
46
+ input.setAttribute('accept', 'image/*');
47
+
48
+ input.addEventListener('change', (e: any) => {
49
+ const file = e.target.files[0];
50
+
51
+ const reader: any = new FileReader();
52
+ reader.addEventListener('load', () => {
53
+ /*
54
+ Note: Now we need to register the blob in TinyMCEs image blob
55
+ registry. In the next release this part hopefully won't be
56
+ necessary, as we are looking to handle it internally.
57
+ */
58
+ const blobId = `blobid${new Date().getTime()}`;
59
+ const blobCache = editorRef.current.editorUpload.blobCache;
60
+ const base64 = reader.result.split(',')[1];
61
+ const blobInfo = blobCache.create(blobId, file, base64);
62
+ blobCache.add(blobInfo);
63
+
64
+ /* call the callback and populate the Title field with the file name */
65
+ cb(blobInfo.blobUri(), { title: file.name });
66
+ });
67
+ reader.readAsDataURL(file);
68
+ });
69
+
70
+ input.click();
71
+ };
72
+
73
+ if (readOnly) {
74
+ const value = defaultValue || '--';
75
+ // eslint-disable-next-line react/no-danger
76
+ richTextComponent = <div key={id} id={id} className="readonly-richtext-editor" dangerouslySetInnerHTML={{ __html: value }} />;
77
+ } else {
78
+ richTextComponent = (
79
+ <Editor
80
+ tinymceScriptSrc="tinymce/tinymce.min.js"
81
+ onInit={(_evt, editor) => {
82
+ editorRef.current = editor;
83
+ }}
84
+ id={id}
85
+ initialValue={defaultValue}
86
+ disabled={disabled}
87
+ init={{
88
+ placeholder,
89
+ menubar: false,
90
+ statusbar: false,
91
+ min_height: 130,
92
+ plugins: ['lists', 'advlist', 'autolink', 'image', 'link', 'autoresize'],
93
+ autoresize_bottom_margin: 0,
94
+ toolbar: disabled ? false : 'blocks | bold italic strikethrough | bullist numlist outdent indent | link image',
95
+ toolbar_location: 'bottom',
96
+ content_style: 'body { font-family:Helvetica, Arial,sans-serif; font-size:14px }',
97
+ branding: false,
98
+ paste_data_images: true,
99
+ file_picker_types: 'image',
100
+ file_picker_callback: filePickerCallback
101
+ }}
102
+ onBlur={onBlur}
103
+ onEditorChange={onChange}
104
+ />
105
+ );
106
+ }
107
+
108
+ return (
109
+ <FormControl data-test-id={testId} error={error} required={required}>
110
+ {!labelHidden && (
111
+ <InputLabel id="demo-simple-select-error-label" className={classes.fieldLabel}>
112
+ {label}
113
+ </InputLabel>
114
+ )}
115
+ {richTextComponent}
116
+ {info && <FormHelperText>{info}</FormHelperText>}
117
+ </FormControl>
118
+ );
119
+ });
120
+
121
+ export default RichTextEditor;