@pega/custom-dx-components 2.0.11 → 2.0.12

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 (117) hide show
  1. package/README.md +73 -57
  2. package/package.json +1 -1
  3. package/src/cli.js +18 -0
  4. package/src/tasks/authenticate/index.js +3 -1
  5. package/src/tasks/build/helper.js +123 -0
  6. package/src/tasks/build/index.js +54 -0
  7. package/src/tasks/{publish/bundle → bundle}/builder/index.js +0 -0
  8. package/src/tasks/{publish/bundle → bundle}/builder/modules.js +0 -0
  9. package/src/tasks/{publish/bundle → bundle}/builder/paths.js +0 -0
  10. package/src/tasks/{publish/bundle → bundle}/builder/webpack.config.js +0 -2
  11. package/src/tasks/{publish/bundle → bundle}/index.js +2 -2
  12. package/src/tasks/create/index.js +6 -3
  13. package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +1 -1
  14. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +29 -18
  15. package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +1 -2
  16. package/src/tasks/create/templates/Constellation/Field/Boolean/mock.stories.js.mustache +21 -0
  17. package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +61 -0
  18. package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +41 -0
  19. package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +179 -67
  20. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +39 -16
  21. package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +3 -1
  22. package/src/tasks/create/templates/Constellation/Field/Date/mock.stories.js.mustache +23 -0
  23. package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +0 -1
  24. package/src/tasks/create/templates/Constellation/Field/DateTime/{date-utils.js → date-utils.js.mustache} +1 -0
  25. package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +1 -0
  26. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +39 -15
  27. package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +2 -0
  28. package/src/tasks/create/templates/Constellation/Field/DateTime/mock.stories.js.mustache +23 -0
  29. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +22 -17
  30. package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +2 -1
  31. package/src/tasks/create/templates/Constellation/Field/Decimal/mock.stories.js.mustache +21 -0
  32. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +25 -17
  33. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +3 -4
  34. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.stories.js.mustache +23 -0
  35. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +22 -17
  36. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +8 -2
  37. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.stories.js.mustache +21 -0
  38. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +22 -17
  39. package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +2 -1
  40. package/src/tasks/create/templates/Constellation/Field/Integer/mock.stories.js.mustache +21 -0
  41. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +42 -14
  42. package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +44 -1
  43. package/src/tasks/create/templates/Constellation/Field/Picklist/mock.stories.js.mustache +67 -0
  44. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +21 -16
  45. package/src/tasks/create/templates/Constellation/Field/Text/mock.stories.js.mustache +13 -0
  46. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +20 -16
  47. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +44 -2
  48. package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.stories.js.mustache +22 -0
  49. package/src/tasks/create/templates/Constellation/Field/Text-Input/{StatusWork.js → StatusWork.jsx} +0 -1
  50. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +21 -17
  51. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +46 -3
  52. package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.stories.js.mustache +21 -0
  53. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +21 -17
  54. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +44 -2
  55. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.stories.js.mustache +20 -0
  56. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +19 -17
  57. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +46 -2
  58. package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.stories.js.mustache +37 -0
  59. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +19 -17
  60. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +174 -3
  61. package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.stories.js.mustache +22 -0
  62. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +24 -16
  63. package/src/tasks/create/templates/Constellation/Field/TimeofDay/mock.stories.js.mustache +20 -0
  64. package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache +1 -0
  65. package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.jsx.mustache +26 -0
  66. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +110 -0
  67. package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +14 -29
  68. package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.stories.js.mustache +179 -0
  69. package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +3 -77
  70. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.jsx.mustache +26 -0
  71. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +118 -0
  72. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +14 -29
  73. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.stories.js.mustache +215 -0
  74. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache +3 -74
  75. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +89 -0
  76. package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +6 -10
  77. package/src/tasks/create/templates/Constellation/Template/FORM/mock.stories.js.mustache +125 -0
  78. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +92 -0
  79. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +10 -8
  80. package/src/tasks/create/templates/Constellation/Template/FORM-region/mock.stories.js.mustache +125 -0
  81. package/src/tasks/create/templates/Constellation/Template/PAGE/{GetNextWork.js.mustache → GetNextWork.jsx.mustache} +6 -0
  82. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.jsx.mustache +102 -0
  83. package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +9 -7
  84. package/src/tasks/create/templates/Constellation/Template/PAGE/mock.stories.js.mustache +94 -0
  85. package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +4 -1
  86. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.jsx.mustache +78 -0
  87. package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +1 -0
  88. package/src/tasks/create/templates/Constellation/Widget/CASE/mock.stories.js.mustache +389 -0
  89. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.jsx.mustache +30 -0
  90. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +8 -8
  91. package/src/tasks/create/templates/Constellation/Widget/PAGE/mock.stories.js.mustache +22 -0
  92. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Avatar.js.mustache → Avatar.jsx.mustache} +2 -0
  93. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Operator.js.mustache → Operator.jsx.mustache} +2 -1
  94. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.jsx.mustache +68 -0
  95. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +9 -9
  96. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.stories.js.mustache +51 -0
  97. package/src/tasks/delete/helper.js +4 -0
  98. package/src/tasks/delete/index.js +4 -0
  99. package/src/tasks/delete-all/helper.js +175 -0
  100. package/src/tasks/delete-all/index.js +49 -0
  101. package/src/tasks/index.js +3 -0
  102. package/src/tasks/init/index.js +1 -1
  103. package/src/tasks/init/template/.eslintignore +8 -0
  104. package/src/tasks/init/template/.eslintrc.json +186 -5
  105. package/src/tasks/init/template/package.json.mustache +19 -4
  106. package/src/tasks/linter/index.js +46 -0
  107. package/src/tasks/list/index.js +4 -0
  108. package/src/tasks/publish/index.js +14 -1
  109. package/src/tasks/publish-all/helper.js +139 -0
  110. package/src/tasks/publish-all/index.js +84 -0
  111. package/src/util.js +10 -0
  112. package/src/tasks/create/templates/Constellation/Field/Picklist/picklist.js.mustache +0 -43
  113. package/src/tasks/create/templates/Constellation/Field/Text-Email/text-email.js.mustache +0 -43
  114. package/src/tasks/create/templates/Constellation/Field/Text-Input/text-input.js.mustache +0 -43
  115. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/text-paragraph.js.mustache +0 -43
  116. package/src/tasks/create/templates/Constellation/Field/Text-Phone/text-phone.js.mustache +0 -43
  117. package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.js.mustache +0 -172
@@ -0,0 +1,125 @@
1
+ export const pyReviewRaw = {
2
+ name: 'CollectInformation',
3
+ type: 'View',
4
+ config: {
5
+ template: 'DefaultForm',
6
+ ruleClass: 'OM5W9U-SampleApp-Work-Test',
7
+ localeReference: '@LR OM5W9U-SAMPLEAPP-WORK-TEST!VIEW!COLLECTINFORMATION',
8
+ context: '@P .pyViewContext'
9
+ },
10
+ children: [
11
+ {
12
+ name: 'Fields',
13
+ type: 'Region',
14
+ children: [
15
+ {
16
+ type: 'TextInput',
17
+ config: {
18
+ value: '@P .FirstName',
19
+ label: '@L First Name'
20
+ }
21
+ },
22
+ {
23
+ type: 'TextInput',
24
+ config: {
25
+ value: '@P .MiddleName',
26
+ label: '@L Middle Name'
27
+ }
28
+ },
29
+ {
30
+ type: 'TextInput',
31
+ config: {
32
+ value: '@P .LastName',
33
+ label: '@L Last Name'
34
+ }
35
+ },
36
+ {
37
+ type: 'Email',
38
+ config: {
39
+ value: '@P .Email',
40
+ label: '@L Email'
41
+ }
42
+ },
43
+ {
44
+ type: 'Phone',
45
+ config: {
46
+ value: '@P .PhoneNumber',
47
+ label: '@L Phone Number',
48
+ datasource: {
49
+ source: '@DATASOURCE D_pyCountryCallingCodeList.pxResults',
50
+ fields: {
51
+ value: '@P .pyCallingCode'
52
+ }
53
+ }
54
+ }
55
+ },
56
+ {
57
+ type: 'Date',
58
+ config: {
59
+ value: '@P .ServiceDate',
60
+ label: '@L Service Date'
61
+ }
62
+ }
63
+ ]
64
+ }
65
+ ],
66
+ classID: 'OM5W9U-SampleApp-Work-Test'
67
+ };
68
+
69
+ export const regionChildrenResolved = [
70
+ {
71
+ readOnly: undefined,
72
+ value: 'John',
73
+ label: 'First Name',
74
+ hasSuggestions: false
75
+ },
76
+ {
77
+ readOnly: undefined,
78
+ value: '',
79
+ label: 'Middle Name',
80
+ hasSuggestions: false
81
+ },
82
+ {
83
+ readOnly: undefined,
84
+ value: 'Doe',
85
+ label: 'Last Name',
86
+ hasSuggestions: false
87
+ },
88
+ {
89
+ readOnly: undefined,
90
+ value: 'John@doe.com',
91
+ label: 'Email',
92
+ hasSuggestions: false
93
+ },
94
+ {
95
+ readOnly: undefined,
96
+ value: '+16397975093',
97
+ label: 'Phone Number',
98
+ datasource: {
99
+ fields: {
100
+ value: undefined
101
+ },
102
+ source: [
103
+ {
104
+ value: '+1'
105
+ },
106
+ {
107
+ value: '+91'
108
+ },
109
+ {
110
+ value: '+48'
111
+ },
112
+ {
113
+ value: '+44'
114
+ }
115
+ ]
116
+ },
117
+ hasSuggestions: false
118
+ },
119
+ {
120
+ readOnly: undefined,
121
+ value: '2023-01-25',
122
+ label: 'Service Date',
123
+ hasSuggestions: false
124
+ }
125
+ ];
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-undef */
1
2
  import { Button, useToaster } from '@pega/cosmos-react-core';
2
3
 
3
4
  export default function GetNextWork(props) {
@@ -8,11 +9,16 @@ export default function GetNextWork(props) {
8
9
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
9
10
 
10
11
  const getNextWork = () => {
12
+
13
+ // alert('Get next work clicked');
14
+
11
15
  getPConnect()
12
16
  .getActionsApi()
13
17
  .getNextWork()
14
18
  .catch((err) => {
19
+ /* eslint-disable no-console */
15
20
  console.log(err);
21
+ /* eslint-enable no-console */
16
22
  if (err[0].status === 404) {
17
23
  toasterCtx.push({
18
24
  content: localizedVal('No task currently available')
@@ -0,0 +1,102 @@
1
+ import { withKnobs } from '@storybook/addon-knobs';
2
+
3
+ import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
4
+
5
+ import {{COMPONENT_CLASS_NAME}} from './index.jsx';
6
+ import { pyHome1Resolved, pyHome1Raw } from './mock.stories.js';
7
+
8
+ export default {
9
+ title: '{{COMPONENT_CLASS_NAME}}',
10
+ decorators: [withKnobs],
11
+ component: {{COMPONENT_CLASS_NAME}}
12
+ };
13
+
14
+ export const base{{COMPONENT_CLASS_NAME}} = () => {
15
+ if (!window.PCore) {
16
+ window.PCore = {};
17
+ }
18
+
19
+ window.PCore.getLocaleUtils = () => {
20
+ return {
21
+ getLocaleValue: val => {
22
+ return val;
23
+ }
24
+ };
25
+ };
26
+
27
+ const configProps = pyHome1Resolved.children[0].children[0].config;
28
+
29
+ const props = {
30
+ useConfigurableLayout: false,
31
+ enableGetNextWork: pyHome1Raw.config.enableGetNextWork,
32
+ icon: pyHome1Raw.config.icon,
33
+ title: 'Page Template',
34
+
35
+ getPConnect: () => {
36
+ return {
37
+ getStateProps: () => {
38
+ return {};
39
+ },
40
+ getActionsApi: () => {
41
+ return {
42
+ getNextWork: () => {
43
+ return new Promise(resolve => {
44
+ resolve({});
45
+ });
46
+ },
47
+ updateFieldValue: () => {},
48
+ triggerFieldChange: () => {}
49
+ };
50
+ },
51
+ getChildren: () => {
52
+ return pyHome1Raw.children;
53
+ },
54
+ getComponentName: () => {
55
+ return '';
56
+ },
57
+ getLocalizedValue: value => {
58
+ return value;
59
+ },
60
+ getRawMetadata: () => {
61
+ return pyHome1Raw;
62
+ },
63
+ createComponent: config => {
64
+ switch (config.type) {
65
+ case 'AppAnnouncement':
66
+ return (
67
+ <PegaAppAnnouncement
68
+ heading='Announcements'
69
+ description={configProps.description}
70
+ whatsNewLink={configProps.whatsnewlink}
71
+ image={configProps.image.replace(/ /g, '+')}
72
+ datasource={configProps.datasource}
73
+ label={configProps.label}
74
+ getPConnect={() => {
75
+ return {
76
+ getChildren: () => {
77
+ return pyHome1Resolved.children;
78
+ }
79
+ };
80
+ }}
81
+ />
82
+ );
83
+ }
84
+ },
85
+ ignoreSuggestion: () => {},
86
+ acceptSuggestion: () => {},
87
+ setInheritedProps: () => {},
88
+ resolveConfigProps: () => {}
89
+ };
90
+ }
91
+ };
92
+
93
+ const regionAChildren = pyHome1Raw.children[0].children.map(child => {
94
+ return props.getPConnect().createComponent(child);
95
+ });
96
+
97
+ return (
98
+ <>
99
+ <{{COMPONENT_CLASS_NAME}} {...props}>{regionAChildren}</{{COMPONENT_CLASS_NAME}}>
100
+ </>
101
+ );
102
+ };
@@ -1,19 +1,19 @@
1
1
  import { useMemo, Children } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { OneColumnPage as OneColumn } from '@pega/cosmos-react-core';
4
- import { registerIcon } from '@pega/cosmos-react-core';
5
4
  import { ConfigurableLayout } from '@pega/cosmos-react-work'
5
+ // import { registerIcon } from '@pega/cosmos-react-core';
6
6
 
7
7
  // temp
8
- //import * as headlineIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/headline.icon';
8
+ // import * as headlineIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/headline.icon';
9
9
 
10
10
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
11
11
 
12
- import GetNextWork from './GetNextWork';
12
+ import GetNextWork from './GetNextWork.jsx';
13
13
  import { getLayoutDataFromRegion } from './utils';
14
14
 
15
15
  // temp
16
- //registerIcon(headlineIcon);
16
+ // registerIcon(headlineIcon);
17
17
 
18
18
  // currently getting 'icon' from props is not supported with iconRegistry
19
19
  // have to manually get icon, so can't determine a runtime for now
@@ -27,7 +27,9 @@ import { getLayoutDataFromRegion } from './utils';
27
27
  // any default values in config.pros should be set in defaultProps at bottom of this file
28
28
  export default function {{COMPONENT_CLASS_NAME}}(props) {
29
29
 
30
- const { children, title, icon, useConfigurableLayout, getPConnect, enableGetNextWork } = props;
30
+ // add back in icon when working
31
+ // const { children, title, icon, useConfigurableLayout, getPConnect, enableGetNextWork } = props;
32
+ const { children, title, useConfigurableLayout, getPConnect, enableGetNextWork } = props;
31
33
  const childArray = useMemo(() => {
32
34
  return Children.toArray(children);
33
35
  }, [children]);
@@ -56,13 +58,13 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
56
58
  }
57
59
 
58
60
  {{COMPONENT_CLASS_NAME}}.defaultProps = {
59
- icon: '',
61
+ /* icon: '', */
60
62
  useConfigurableLayout: false
61
63
  };
62
64
 
63
65
  {{COMPONENT_CLASS_NAME}}.propTypes = {
64
66
  children: PropTypes.arrayOf(PropTypes.node).isRequired,
65
67
  title: PropTypes.string.isRequired,
66
- icon: PropTypes.string,
68
+ /* icon: PropTypes.string, */
67
69
  useConfigurableLayout: PropTypes.bool
68
70
  };
@@ -0,0 +1,94 @@
1
+ export const pyHome1Raw = {
2
+ name: 'pyHome1',
3
+ type: 'View',
4
+ config: {
5
+ type: 'landingpage',
6
+ template: 'OneColumnPage',
7
+ icon: 'home-solid',
8
+ title: '@ENV APPLICATION_DESC',
9
+ ruleClass: 'DIXL-MediaCo-UIPages',
10
+ localeReference: '@LR DIXL-MEDIACO-UIPAGES!PAGE!PYHOME1',
11
+ enableGetNextWork: true,
12
+ context: 'pyPortal'
13
+ },
14
+ children: [
15
+ {
16
+ name: 'A',
17
+ type: 'Region',
18
+ children: [
19
+ {
20
+ type: 'AppAnnouncement',
21
+ config: {
22
+ label: '@L App announcement',
23
+ description:
24
+ "We've launched a brand new experience to accelerate your workflow. Check out the guides to help you get the most of Cosmos.",
25
+ whatsnewlink: 'https://design.pega.com',
26
+ image:
27
+ 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOSAxMSI+PHRpdGxlPlBlZ2EgdGV4dC1vbmx5IGxvZ288L3RpdGxlPjxwYXRoIHN0eWxlPSJmaWxsLW9wYWNpdHk6IC4yNTsiIGZpbGw9IiNmZmYiIGQ9Ik03LjcyIDMuODJjMCAyLjI1LTEuNzggMy40MS00IDMuNDFoLTEuNnYzSDBWLjQyaDMuOTRjMi4zNiAwIDMuNzggMS4zOSAzLjc4IDMuNHptLTQtMS40N2gtMS42djNoMS43QTEuNDcgMS40NyAwIDAgMCA1LjUgMy44MmMwLS45MS0uNjUtMS40Ny0xLjc1LTEuNDd6bTcuNjggNS45MWg1LjN2Mkg5LjI5Vi40Mmg3LjM4djEuOTNoLTUuMjR2Mmg0LjI0djEuOWgtNC4yNHpNMjMuMTggMGE1IDUgMCAwIDEgMy41NyAxLjI4TDI1LjYzIDIuOGEzLjc4IDMuNzggMCAwIDAtMS4wNS0uN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}
38
+ ],
39
+ classID: 'DIXL-MediaCo-UIPages'
40
+ };
41
+
42
+ export const pyHome1Resolved = {
43
+ name: 'pyHome1',
44
+ type: 'View',
45
+ config: {
46
+ type: 'landingpage',
47
+ template: 'OneColumnPage',
48
+ icon: 'home-solid',
49
+ title: '@ENV APPLICATION_DESC',
50
+ ruleClass: 'DIXL-MediaCo-UIPages',
51
+ localeReference: '@LR DIXL-MEDIACO-UIPAGES!PAGE!PYHOME1',
52
+ enableGetNextWork: true,
53
+ context: 'pyPortal'
54
+ },
55
+ children: [
56
+ {
57
+ name: 'A',
58
+ type: 'Region',
59
+ getPConnect: () => {
60
+ return {
61
+ getComponentName: () => {
62
+ return '';
63
+ },
64
+ getComponent: () => {
65
+ return pyHome1Resolved.children[0];
66
+ },
67
+ getConfigProps: () => {
68
+ return {};
69
+ }
70
+ };
71
+ },
72
+ children: [
73
+ {
74
+ type: 'AppAnnouncement',
75
+ config: {
76
+ label: '@L App announcement',
77
+ description:
78
+ "We've launched a brand new experience to accelerate your workflow. Check out the guides to help you get the most of Cosmos.",
79
+ whatsnewlink: 'https://design.pega.com',
80
+ image:
81
+ 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOSAxMSI+PHRpdGxlPlBlZ2EgdGV4dC1vbmx5IGxvZ288L3RpdGxlPjxwYXRoIHN0eWxlPSJmaWxsLW9wYWNpdHk6IC4yNTsiIGZpbGw9IiNmZmYiIGQ9Ik03LjcyIDMuODJjMCAyLjI1LTEuNzggMy40MS00IDMuNDFoLTEuNnYzSDBWLjQyaDMuOTRjMi4zNiAwIDMuNzggMS4zOSAzLjc4IDMuNHptLTQtMS40N2gtMS42djNoMS43QTEuNDcgMS40NyAwIDAgMCA1LjUgMy44MmMwLS45MS0uNjUtMS40Ny0xLjc1LTEuNDd6bTcuNjggNS45MWg1LjN2Mkg5LjI5Vi40Mmg3LjM4djEuOTNoLTUu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+',
82
+ datasource: {
83
+ source: '@DATASOURCE D_pyAnnouncements.pxResults',
84
+ fields: {
85
+ name: '@P .pyLabel'
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ]
91
+ }
92
+ ],
93
+ classID: 'DIXL-MediaCo-UIPages'
94
+ };
@@ -1,6 +1,7 @@
1
+ /* eslint-disable no-undef */
1
2
  import { createUID } from '@pega/cosmos-react-core';
2
3
 
3
- //import { LazyMap as LazyComponentMap } from '../../components_map';
4
+ // import { LazyMap as LazyComponentMap } from '../../components_map';
4
5
 
5
6
  const LazyComponentMap = {};
6
7
 
@@ -212,7 +213,9 @@ export function getInstructions(pConnect, instructions = 'casestep') {
212
213
 
213
214
  // If the annotation wasn't processed correctly, don't return any instruction text
214
215
  if (instructions?.startsWith('@PARAGRAPH')) {
216
+ /* eslint-disable no-console */
215
217
  console.error('@PARAGRAPH annotation was not processed. Hiding custom instructions.');
218
+ /* eslint-enable no-console */
216
219
  return undefined;
217
220
  }
218
221
 
@@ -0,0 +1,78 @@
1
+ import { withKnobs } from '@storybook/addon-knobs';
2
+
3
+ import {{COMPONENT_CLASS_NAME}} from './index.jsx';
4
+
5
+ import { historyData } from './mock.stories';
6
+
7
+ export default {
8
+ title: '{{COMPONENT_CLASS_NAME}}',
9
+ decorators: [withKnobs],
10
+ component: {{COMPONENT_CLASS_NAME}}
11
+ };
12
+
13
+ if (!window.PCore) {
14
+ window.PCore = {};
15
+ }
16
+
17
+ window.PCore.getConstants = () => {
18
+ return {
19
+ CASE_INFO: {
20
+ CASE_INFO_ID: 'caseInfo.ID'
21
+ }
22
+ };
23
+ };
24
+
25
+ window.PCore.getLocaleUtils = () => {
26
+ return {
27
+ getLocaleValue: value => {
28
+ return value;
29
+ }
30
+ };
31
+ };
32
+
33
+ window.PCore.getDataApiUtils = () => {
34
+ return {
35
+ getData: () => {
36
+ return new Promise(resolve => {
37
+ resolve(historyData);
38
+ });
39
+ }
40
+ };
41
+ };
42
+
43
+ export const base{{COMPONENT_CLASS_NAME}} = () => {
44
+
45
+ const props = {
46
+ label: 'Case history',
47
+
48
+ getPConnect: () => {
49
+ return {
50
+ getValue: value => {
51
+ return value;
52
+ },
53
+ getContextName: () => {
54
+ return 'app/primary_1';
55
+ },
56
+ getLocalizedValue: value => {
57
+ return value;
58
+ },
59
+ getActionsApi: () => {
60
+ return {
61
+ updateFieldValue: () => {},
62
+ triggerFieldChange: () => {}
63
+ };
64
+ },
65
+ ignoreSuggestion: () => {},
66
+ acceptSuggestion: () => {},
67
+ setInheritedProps: () => {},
68
+ resolveConfigProps: () => {}
69
+ };
70
+ }
71
+ };
72
+
73
+ return (
74
+ <>
75
+ <{{COMPONENT_CLASS_NAME}} {...props} />
76
+ </>
77
+ );
78
+ };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-undef */
1
2
  import { useState, useEffect } from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { Table, Text } from '@pega/cosmos-react-core';