@pega/dx-component-builder-sdk 0.1.4 → 0.1.5

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 (18) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/create/templates/SDK-React/Field/Date/demo.stories.jsx.mustache +1 -1
  3. package/src/tasks/create/templates/SDK-React/Field/Date/index.tsx.mustache +3 -1
  4. package/src/tasks/create/templates/SDK-React/Field/DateTime/demo.stories.jsx.mustache +1 -1
  5. package/src/tasks/create/templates/SDK-React/Field/DateTime/index.tsx.mustache +3 -1
  6. package/src/tasks/create/templates/SDK-React/Field/Text/demo.stories.jsx.mustache +19 -3
  7. package/src/tasks/create/templates/SDK-React/Field/Text-Email/demo.stories.jsx.mustache +20 -4
  8. package/src/tasks/create/templates/SDK-React/Field/Text-Input/demo.stories.jsx.mustache +20 -3
  9. package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/demo.stories.jsx.mustache +19 -4
  10. package/src/tasks/create/templates/SDK-React/Field/Text-Phone/demo.stories.jsx.mustache +19 -3
  11. package/src/tasks/create/templates/SDK-React/Field/Text-URL/demo.stories.jsx.mustache +20 -4
  12. package/src/tasks/create/templates/SDK-React/Field/TimeofDay/demo.stories.jsx.mustache +1 -1
  13. package/src/tasks/create/templates/SDK-React/Field/TimeofDay/index.tsx.mustache +1 -0
  14. package/src/tasks/create/templates/SDK-React/Widget/CASE/demo.stories.jsx.mustache +70 -0
  15. package/src/tasks/create/templates/SDK-React/Widget/CASE/mock.stories.js.mustache +390 -0
  16. package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/demo.stories.jsx.mustache +60 -0
  17. package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/index.tsx.mustache +2 -2
  18. package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/mock.stories.js.mustache +52 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/dx-component-builder-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -3,7 +3,7 @@ import { withKnobs } from '@storybook/addon-knobs';
3
3
 
4
4
  import { configProps, stateProps } from './mock.stories';
5
5
 
6
- import {{COMPONENT_CLASS_NAME}} from './index.jsx';
6
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
7
7
 
8
8
  export default {
9
9
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -6,8 +6,10 @@ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event
6
6
  import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldValueList';
7
7
  import PropTypes from 'prop-types';
8
8
 
9
+
9
10
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
10
11
 
12
+
11
13
  // Duplicated runtime code from React SDK
12
14
 
13
15
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
@@ -88,7 +90,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: any) {
88
90
  InputProps={{ ...testProp }}
89
91
  <%={{ }}=%> {{! revert delimiteres for mustache }}
90
92
  />
91
- </MuiPickersUtilsProvider>
93
+ </MuiPickersUtilsProvider>
92
94
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
93
95
  );
94
96
  }
@@ -3,7 +3,7 @@ import { withKnobs } from '@storybook/addon-knobs';
3
3
 
4
4
  import { configProps, stateProps } from './mock.stories';
5
5
 
6
- import {{COMPONENT_CLASS_NAME}} from './index.jsx';
6
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
7
7
 
8
8
  export default {
9
9
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -6,8 +6,10 @@ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event
6
6
  import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldValueList';
7
7
  import PropTypes from 'prop-types';
8
8
 
9
+
9
10
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
10
11
 
12
+
11
13
  // Duplicated runtime code from React SDK
12
14
 
13
15
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
@@ -78,7 +80,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: any) {
78
80
  onAccept={handleAccept}
79
81
  data-test-id={testId}
80
82
  />
81
- </MuiPickersUtilsProvider>
83
+ </MuiPickersUtilsProvider>
82
84
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
83
85
  );
84
86
  }
@@ -1,4 +1,5 @@
1
- import {{COMPONENT_CLASS_NAME}} from './index.jsx';
1
+ import { useState } from 'react';
2
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
2
3
  import { withKnobs } from '@storybook/addon-knobs';
3
4
  import { configProps } from './mock.stories';
4
5
 
@@ -9,9 +10,10 @@ export default {
9
10
  };
10
11
 
11
12
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
+ const [value, setValue] = useState(configProps.value);
12
14
 
13
15
  const props = {
14
- value: configProps.value,
16
+ value,
15
17
  placeholder: configProps.placeholder,
16
18
  label: configProps.label,
17
19
  testId: configProps.testId,
@@ -21,7 +23,21 @@ export const Base{{COMPONENT_CLASS_NAME}} = () => {
21
23
  required: configProps.required,
22
24
  readOnly: configProps.readOnly,
23
25
  displayMode: configProps.displayMode,
24
- onchange: () => { return configProps.value; },
26
+ getPConnect: () => {
27
+ return {
28
+ getActionsApi: () => {
29
+ return {
30
+ updateFieldValue: (propName, theValue) => {
31
+ setValue(theValue);
32
+ }
33
+ };
34
+ },
35
+ getStateProps: () => {
36
+ return { value: '.name' };
37
+ }
38
+ };
39
+ },
40
+ onChange: (event) => { setValue(event.target.value); },
25
41
  onBlur: () => { return configProps.value; }
26
42
  };
27
43
 
@@ -1,4 +1,5 @@
1
- import {{COMPONENT_CLASS_NAME}} from './index.jsx';
1
+ import { useState } from 'react';
2
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
2
3
  import { withKnobs } from '@storybook/addon-knobs';
3
4
  import { configProps } from './mock.stories';
4
5
 
@@ -9,9 +10,10 @@ export default {
9
10
  };
10
11
 
11
12
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
12
-
13
+ const [value, setValue] = useState(configProps.value);
14
+
13
15
  const props = {
14
- value: configProps.value,
16
+ value,
15
17
  placeholder: configProps.placeholder,
16
18
  label: configProps.label,
17
19
  testId: configProps.testId,
@@ -21,7 +23,21 @@ export const Base{{COMPONENT_CLASS_NAME}} = () => {
21
23
  required: configProps.required,
22
24
  readOnly: configProps.readOnly,
23
25
  displayMode: configProps.displayMode,
24
- onchange: () => { return configProps.value; },
26
+ getPConnect: () => {
27
+ return {
28
+ getActionsApi: () => {
29
+ return {
30
+ updateFieldValue: (propName, theValue) => {
31
+ setValue(theValue);
32
+ }
33
+ };
34
+ },
35
+ getStateProps: () => {
36
+ return { value: '.name' };
37
+ }
38
+ };
39
+ },
40
+ onChange: (event) => { setValue(event.target.value); },
25
41
  onBlur: () => { return configProps.value; }
26
42
  };
27
43
  return (
@@ -1,4 +1,5 @@
1
- import {{COMPONENT_CLASS_NAME}} from './index.jsx';
1
+ import { useState } from 'react';
2
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
2
3
  import { withKnobs } from '@storybook/addon-knobs';
3
4
  import { configProps, fieldMetadata } from './mock.stories';
4
5
 
@@ -9,15 +10,31 @@ export default {
9
10
  };
10
11
 
11
12
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
+ const [value, setValue] = useState(configProps.value);
14
+
12
15
  const props = {
13
- value: configProps.value,
16
+ value,
14
17
  placeholder: configProps.placeholder,
15
18
  label: configProps.label,
16
19
  helperText: configProps.helperText,
17
20
  testId: configProps.testId,
18
21
  hasSuggestions: configProps.hasSuggestions,
19
22
  fieldMetadata,
20
- onchange: () => { return configProps.value; },
23
+ getPConnect: () => {
24
+ return {
25
+ getActionsApi: () => {
26
+ return {
27
+ updateFieldValue: (propName, theValue) => {
28
+ setValue(theValue);
29
+ }
30
+ };
31
+ },
32
+ getStateProps: () => {
33
+ return { value: '.name' };
34
+ }
35
+ };
36
+ },
37
+ onChange: (event) => { setValue(event.target.value); },
21
38
  onBlur: () => { return configProps.value; }
22
39
  };
23
40
 
@@ -1,5 +1,5 @@
1
-
2
- import {{COMPONENT_CLASS_NAME}} from './index.jsx';
1
+ import { useState } from 'react';
2
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
3
3
  import { configProps, fieldMetadata } from './mock.stories';
4
4
  import { withKnobs } from '@storybook/addon-knobs';
5
5
 
@@ -10,9 +10,10 @@ export default {
10
10
  };
11
11
 
12
12
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
+ const [value, setValue] = useState(configProps.value);
13
14
 
14
15
  const props = {
15
- value: configProps.value,
16
+ value,
16
17
  placeholder: configProps.placeholder,
17
18
  label: configProps.label,
18
19
  testId: configProps.testId,
@@ -23,7 +24,21 @@ export const Base{{COMPONENT_CLASS_NAME}} = () => {
23
24
  readOnly: configProps.readOnly,
24
25
  displayMode: configProps.displayMode,
25
26
  fieldMetadata,
26
- onchange: () => { return configProps.value; },
27
+ getPConnect: () => {
28
+ return {
29
+ getActionsApi: () => {
30
+ return {
31
+ updateFieldValue: (propName, theValue) => {
32
+ setValue(theValue);
33
+ }
34
+ };
35
+ },
36
+ getStateProps: () => {
37
+ return { value: '.name' };
38
+ }
39
+ };
40
+ },
41
+ onChange: (event) => { setValue(event.target.value); },
27
42
  onBlur: () => { return configProps.value; }
28
43
  };
29
44
 
@@ -1,4 +1,5 @@
1
- import {{COMPONENT_CLASS_NAME}} from './index.jsx';
1
+ import { useState } from 'react';
2
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
2
3
  import { withKnobs } from '@storybook/addon-knobs';
3
4
  import { configProps } from './mock.stories';
4
5
 
@@ -9,9 +10,10 @@ export default {
9
10
  };
10
11
 
11
12
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
+ const [value, setValue] = useState(configProps.value);
12
14
 
13
15
  const props = {
14
- value: configProps.value,
16
+ value,
15
17
  placeholder: configProps.placeholder,
16
18
  label: configProps.label,
17
19
  testId: configProps.testId,
@@ -21,7 +23,21 @@ export const Base{{COMPONENT_CLASS_NAME}} = () => {
21
23
  required: configProps.required,
22
24
  readOnly: configProps.readOnly,
23
25
  displayMode: configProps.displayMode,
24
- onchange: () => { return configProps.value; },
26
+ getPConnect: () => {
27
+ return {
28
+ getActionsApi: () => {
29
+ return {
30
+ updateFieldValue: (propName, theValue) => {
31
+ setValue(theValue);
32
+ }
33
+ };
34
+ },
35
+ getStateProps: () => {
36
+ return { value: '.name' };
37
+ }
38
+ };
39
+ },
40
+ onChange: (event) => { setValue(event.target.value); },
25
41
  onBlur: () => { return configProps.value; }
26
42
  };
27
43
 
@@ -1,5 +1,6 @@
1
+ import { useState } from 'react';
1
2
  import { withKnobs } from '@storybook/addon-knobs';
2
- import {{COMPONENT_CLASS_NAME}} from './index.jsx';
3
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
3
4
  import { configProps } from './mock.stories';
4
5
 
5
6
  export default {
@@ -9,9 +10,10 @@ export default {
9
10
  };
10
11
 
11
12
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
+ const [value, setValue] = useState(configProps.value);
12
14
 
13
15
  const props = {
14
- value: configProps.value,
16
+ value,
15
17
  placeholder: configProps.placeholder,
16
18
  label: configProps.label,
17
19
  testId: configProps.testId,
@@ -21,8 +23,22 @@ export const Base{{COMPONENT_CLASS_NAME}} = () => {
21
23
  required: configProps.required,
22
24
  readOnly: configProps.readOnly,
23
25
  displayMode: configProps.displayMode,
24
- onchange: () => { return configProps.value; },
25
- onBlur: ( return configProps.value; ) => {}
26
+ getPConnect: () => {
27
+ return {
28
+ getActionsApi: () => {
29
+ return {
30
+ updateFieldValue: (propName, theValue) => {
31
+ setValue(theValue);
32
+ }
33
+ };
34
+ },
35
+ getStateProps: () => {
36
+ return { value: '.name' };
37
+ }
38
+ };
39
+ },
40
+ onChange: (event) => { setValue(event.target.value); },
41
+ onBlur: () => { return configProps.value; }
26
42
  };
27
43
 
28
44
  return (
@@ -3,7 +3,7 @@ import { withKnobs } from '@storybook/addon-knobs';
3
3
 
4
4
  import { configProps, stateProps } from './mock.stories';
5
5
 
6
- import {{COMPONENT_CLASS_NAME}} from './index.jsx';
6
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
7
7
 
8
8
  export default {
9
9
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
9
9
 
10
10
  import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
11
11
 
12
+
12
13
  // Duplicated runtime code from React SDK
13
14
 
14
15
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
@@ -0,0 +1,70 @@
1
+ import { withKnobs } from '@storybook/addon-knobs';
2
+
3
+ import { historyData } from './mock.stories';
4
+
5
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
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.getDataApiUtils = () => {
26
+ return {
27
+ getData: () => {
28
+ return new Promise(resolve => {
29
+ resolve(historyData);
30
+ });
31
+ }
32
+ };
33
+ };
34
+
35
+ export const Base{{COMPONENT_CLASS_NAME}} = () => {
36
+
37
+ const props = {
38
+ label: 'Case history',
39
+
40
+ getPConnect: () => {
41
+ return {
42
+ getValue: value => {
43
+ return value;
44
+ },
45
+ getContextName: () => {
46
+ return 'app/primary_1';
47
+ },
48
+ getLocalizedValue: value => {
49
+ return value;
50
+ },
51
+ getActionsApi: () => {
52
+ return {
53
+ updateFieldValue: () => {/* nothing */},
54
+ triggerFieldChange: () => {/* nothing */}
55
+ };
56
+ },
57
+ ignoreSuggestion: () => {/* nothing */},
58
+ acceptSuggestion: () => {/* nothing */},
59
+ setInheritedProps: () => {/* nothing */},
60
+ resolveConfigProps: () => {/* nothing */}
61
+ };
62
+ }
63
+ };
64
+
65
+ return (
66
+ <>
67
+ <{{COMPONENT_CLASS_NAME}} {...props} />
68
+ </>
69
+ );
70
+ };
@@ -0,0 +1,390 @@
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export const historyData = {
3
+ data: {
4
+ fetchDateTime: '2023-01-18T12:04:56.517Z',
5
+ pxObjClass: 'Pega-API-DataExploration-Data',
6
+ resultCount: 31,
7
+ data: [
8
+ {
9
+ pxTimeCreated: '2023-01-13T21:46:33.339Z',
10
+ pxObjClass: 'History-DXIL-DigV2-Work',
11
+ pyPerformer: 'User DigV2',
12
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214633.339 GMT',
13
+ pxLongitude: null,
14
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214633.339 GMT',
15
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
16
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
17
+ pyMemo: null,
18
+ pxLatitude: null
19
+ },
20
+ {
21
+ pxTimeCreated: '2023-01-13T21:46:33.332Z',
22
+ pxObjClass: 'History-DXIL-DigV2-Work',
23
+ pyPerformer: 'User DigV2',
24
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214633.332 GMT',
25
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214633.332 GMT',
26
+ pxLongitude: null,
27
+ pyMessageKey: "Assignment to 'complete task' completed by performing a 'EmbeddedData'.",
28
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
29
+ pyMemo: null,
30
+ pxLatitude: null
31
+ },
32
+ {
33
+ pxTimeCreated: '2023-01-13T21:46:32.005Z',
34
+ pxObjClass: 'History-DXIL-DigV2-Work',
35
+ pyPerformer: 'User DigV2',
36
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214632.005 GMT',
37
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214632.005 GMT',
38
+ pxLongitude: null,
39
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
40
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
41
+ pyMemo: null,
42
+ pxLatitude: null
43
+ },
44
+ {
45
+ pxTimeCreated: '2023-01-13T21:46:31.998Z',
46
+ pxObjClass: 'History-DXIL-DigV2-Work',
47
+ pyPerformer: 'User DigV2',
48
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214631.998 GMT',
49
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214631.998 GMT',
50
+ pxLongitude: null,
51
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
52
+ pyMessageKey: "Assignment to 'complete task' removed via ticket.",
53
+ pxLatitude: null,
54
+ pyMemo: null
55
+ },
56
+ {
57
+ pxTimeCreated: '2023-01-13T21:46:31.175Z',
58
+ pxObjClass: 'History-DXIL-DigV2-Work',
59
+ pyPerformer: 'User DigV2',
60
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214631.175 GMT',
61
+ pxLongitude: null,
62
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214631.175 GMT',
63
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
64
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
65
+ pxLatitude: null,
66
+ pyMemo: null
67
+ },
68
+ {
69
+ pxTimeCreated: '2023-01-13T21:46:31.168Z',
70
+ pxObjClass: 'History-DXIL-DigV2-Work',
71
+ pyPerformer: 'User DigV2',
72
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214631.168 GMT',
73
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214631.168 GMT',
74
+ pxLongitude: null,
75
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
76
+ pyMessageKey: "Assignment to 'complete task' completed by performing a 'EmbeddedData'.",
77
+ pyMemo: null,
78
+ pxLatitude: null
79
+ },
80
+ {
81
+ pxObjClass: 'History-DXIL-DigV2-Work',
82
+ pxTimeCreated: '2023-01-13T21:46:29.893Z',
83
+ pyPerformer: 'User DigV2',
84
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214629.893 GMT',
85
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214629.893 GMT',
86
+ pxLongitude: null,
87
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
88
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
89
+ pyMemo: null,
90
+ pxLatitude: null
91
+ },
92
+ {
93
+ pxObjClass: 'History-DXIL-DigV2-Work',
94
+ pxTimeCreated: '2023-01-13T21:46:29.887Z',
95
+ pyPerformer: 'User DigV2',
96
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214629.887 GMT',
97
+ pxLongitude: null,
98
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214629.887 GMT',
99
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
100
+ pyMessageKey: "Assignment to 'complete task' removed via ticket.",
101
+ pxLatitude: null,
102
+ pyMemo: null
103
+ },
104
+ {
105
+ pxTimeCreated: '2023-01-13T21:46:28.248Z',
106
+ pxObjClass: 'History-DXIL-DigV2-Work',
107
+ pyPerformer: 'User DigV2',
108
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214628.248 GMT',
109
+ pxLongitude: null,
110
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214628.248 GMT',
111
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
112
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
113
+ pxLatitude: null,
114
+ pyMemo: null
115
+ },
116
+ {
117
+ pxObjClass: 'History-DXIL-DigV2-Work',
118
+ pxTimeCreated: '2023-01-13T21:46:28.242Z',
119
+ pyPerformer: 'User DigV2',
120
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214628.242 GMT',
121
+ pxLongitude: null,
122
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214628.242 GMT',
123
+ pyMessageKey: "Assignment to 'complete task' completed by performing a 'EmbeddedData'.",
124
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
125
+ pyMemo: null,
126
+ pxLatitude: null
127
+ },
128
+ {
129
+ pxObjClass: 'History-DXIL-DigV2-Work',
130
+ pxTimeCreated: '2023-01-13T21:46:08.399Z',
131
+ pyPerformer: 'User DigV2',
132
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214608.399 GMT',
133
+ pxLongitude: null,
134
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214608.399 GMT',
135
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
136
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
137
+ pxLatitude: null,
138
+ pyMemo: null
139
+ },
140
+ {
141
+ pxTimeCreated: '2023-01-13T21:46:08.393Z',
142
+ pxObjClass: 'History-DXIL-DigV2-Work',
143
+ pyPerformer: 'User DigV2',
144
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214608.393 GMT',
145
+ pxLongitude: null,
146
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214608.393 GMT',
147
+ pyMessageKey: "Assignment to 'complete task' removed via ticket.",
148
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
149
+ pxLatitude: null,
150
+ pyMemo: null
151
+ },
152
+ {
153
+ pxObjClass: 'History-DXIL-DigV2-Work',
154
+ pxTimeCreated: '2023-01-13T21:46:07.584Z',
155
+ pyPerformer: 'User DigV2',
156
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214607.584 GMT',
157
+ pxLongitude: null,
158
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214607.584 GMT',
159
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
160
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
161
+ pyMemo: null,
162
+ pxLatitude: null
163
+ },
164
+ {
165
+ pxObjClass: 'History-DXIL-DigV2-Work',
166
+ pxTimeCreated: '2023-01-13T21:46:07.579Z',
167
+ pyPerformer: 'User DigV2',
168
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214607.579 GMT',
169
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214607.579 GMT',
170
+ pxLongitude: null,
171
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
172
+ pyMessageKey: "Assignment to 'complete task' completed by performing a 'EmbeddedData'.",
173
+ pxLatitude: null,
174
+ pyMemo: null
175
+ },
176
+ {
177
+ pxObjClass: 'History-DXIL-DigV2-Work',
178
+ pxTimeCreated: '2023-01-13T21:46:06.262Z',
179
+ pyPerformer: 'User DigV2',
180
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214606.262 GMT',
181
+ pxLongitude: null,
182
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214606.262 GMT',
183
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
184
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
185
+ pyMemo: null,
186
+ pxLatitude: null
187
+ },
188
+ {
189
+ pxObjClass: 'History-DXIL-DigV2-Work',
190
+ pxTimeCreated: '2023-01-13T21:46:06.256Z',
191
+ pyPerformer: 'User DigV2',
192
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214606.256 GMT',
193
+ pxLongitude: null,
194
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214606.256 GMT',
195
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
196
+ pyMessageKey: "Assignment to 'complete task' removed via ticket.",
197
+ pxLatitude: null,
198
+ pyMemo: null
199
+ },
200
+ {
201
+ pxObjClass: 'History-DXIL-DigV2-Work',
202
+ pxTimeCreated: '2023-01-13T21:45:57.503Z',
203
+ pyPerformer: 'User DigV2',
204
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214557.503 GMT',
205
+ pxLongitude: null,
206
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214557.503 GMT',
207
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
208
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
209
+ pxLatitude: null,
210
+ pyMemo: null
211
+ },
212
+ {
213
+ pxObjClass: 'History-DXIL-DigV2-Work',
214
+ pxTimeCreated: '2023-01-13T21:45:57.496Z',
215
+ pyPerformer: 'User DigV2',
216
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214557.496 GMT',
217
+ pxLongitude: null,
218
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214557.496 GMT',
219
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
220
+ pyMessageKey: "Assignment to 'complete task' completed by performing a 'EmbeddedData'.",
221
+ pyMemo: null,
222
+ pxLatitude: null
223
+ },
224
+ {
225
+ pxObjClass: 'History-DXIL-DigV2-Work',
226
+ pxTimeCreated: '2023-01-13T21:45:36.250Z',
227
+ pyPerformer: 'User DigV2',
228
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214536.250 GMT',
229
+ pxLongitude: null,
230
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214536.250 GMT',
231
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
232
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
233
+ pxLatitude: null,
234
+ pyMemo: null
235
+ },
236
+ {
237
+ pxObjClass: 'History-DXIL-DigV2-Work',
238
+ pxTimeCreated: '2023-01-13T21:45:36.244Z',
239
+ pyPerformer: 'User DigV2',
240
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214536.244 GMT',
241
+ pxLongitude: null,
242
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214536.244 GMT',
243
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
244
+ pyMessageKey: "Assignment to 'complete task' removed via ticket.",
245
+ pxLatitude: null,
246
+ pyMemo: null
247
+ },
248
+ {
249
+ pxTimeCreated: '2023-01-13T21:45:35.364Z',
250
+ pxObjClass: 'History-DXIL-DigV2-Work',
251
+ pyPerformer: 'User DigV2',
252
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214535.364 GMT',
253
+ pxLongitude: null,
254
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214535.364 GMT',
255
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
256
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
257
+ pxLatitude: null,
258
+ pyMemo: null
259
+ },
260
+ {
261
+ pxTimeCreated: '2023-01-13T21:45:35.356Z',
262
+ pxObjClass: 'History-DXIL-DigV2-Work',
263
+ pyPerformer: 'User DigV2',
264
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214535.356 GMT',
265
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214535.356 GMT',
266
+ pxLongitude: null,
267
+ pyMessageKey: "Assignment to 'complete task' completed by performing a 'EmbeddedData'.",
268
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
269
+ pyMemo: null,
270
+ pxLatitude: null
271
+ },
272
+ {
273
+ pxObjClass: 'History-DXIL-DigV2-Work',
274
+ pxTimeCreated: '2023-01-13T21:45:33.224Z',
275
+ pyPerformer: 'User DigV2',
276
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214533.224 GMT',
277
+ pxLongitude: null,
278
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214533.224 GMT',
279
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
280
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
281
+ pxLatitude: null,
282
+ pyMemo: null
283
+ },
284
+ {
285
+ pxTimeCreated: '2023-01-13T21:45:33.218Z',
286
+ pxObjClass: 'History-DXIL-DigV2-Work',
287
+ pyPerformer: 'User DigV2',
288
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214533.218 GMT',
289
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214533.218 GMT',
290
+ pxLongitude: null,
291
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
292
+ pyMessageKey: "Assignment to 'complete task' removed via ticket.",
293
+ pxLatitude: null,
294
+ pyMemo: null
295
+ },
296
+ {
297
+ pxTimeCreated: '2023-01-13T21:45:32.436Z',
298
+ pxObjClass: 'History-DXIL-DigV2-Work',
299
+ pyPerformer: 'User DigV2',
300
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214532.436 GMT',
301
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214532.436 GMT',
302
+ pxLongitude: null,
303
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
304
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
305
+ pxLatitude: null,
306
+ pyMemo: null
307
+ },
308
+ {
309
+ pxTimeCreated: '2023-01-13T21:45:32.430Z',
310
+ pxObjClass: 'History-DXIL-DigV2-Work',
311
+ pyPerformer: 'User DigV2',
312
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214532.430 GMT',
313
+ pxLongitude: null,
314
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214532.430 GMT',
315
+ pyMessageKey: "Assignment to 'complete task' completed by performing a 'EmbeddedData'.",
316
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
317
+ pxLatitude: null,
318
+ pyMemo: null
319
+ },
320
+ {
321
+ pxTimeCreated: '2023-01-13T21:45:25.003Z',
322
+ pxObjClass: 'History-DXIL-DigV2-Work',
323
+ pyPerformer: 'User DigV2',
324
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214525.003 GMT',
325
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214525.003 GMT',
326
+ pxLongitude: null,
327
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
328
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
329
+ pxLatitude: null,
330
+ pyMemo: null
331
+ },
332
+ {
333
+ pxObjClass: 'History-DXIL-DigV2-Work',
334
+ pxTimeCreated: '2023-01-13T21:45:24.994Z',
335
+ pyPerformer: 'User DigV2',
336
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214524.994 GMT',
337
+ pxLongitude: null,
338
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214524.994 GMT',
339
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
340
+ pyMessageKey: "Assignment to 'complete task' completed by performing a 'Select Test'.",
341
+ pyMemo: null,
342
+ pxLatitude: null
343
+ },
344
+ {
345
+ pxObjClass: 'History-DXIL-DigV2-Work',
346
+ pxTimeCreated: '2023-01-13T21:45:23.570Z',
347
+ pyPerformer: 'User DigV2',
348
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214523.570 GMT',
349
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214523.570 GMT',
350
+ pxLongitude: null,
351
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
352
+ pyMessageKey: "Assigned to User DigV2 to 'complete task' ",
353
+ pyMemo: null,
354
+ pxLatitude: null
355
+ },
356
+ {
357
+ pxObjClass: 'History-DXIL-DigV2-Work',
358
+ pxTimeCreated: '2023-01-13T21:45:23.563Z',
359
+ pyPerformer: 'User DigV2',
360
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214523.563 GMT',
361
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214523.563 GMT',
362
+ pxLongitude: null,
363
+ pyMessageKey: 'ChangeStageAutomatic\tCreate\tPick Test',
364
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
365
+ pxLatitude: null,
366
+ pyMemo: 'ChangeStageAutomatic\tCreate\tPick Test'
367
+ },
368
+ {
369
+ pxObjClass: 'History-DXIL-DigV2-Work',
370
+ pxTimeCreated: '2023-01-13T21:45:23.550Z',
371
+ pyPerformer: 'User DigV2',
372
+ pxInsName: 'DXIL-DIGV2-WORK C-7430!20230113T214523.550 GMT',
373
+ pzInsKey: 'HISTORY-DXIL-DIGV2-WORK DXIL-DIGV2-WORK C-7430!20230113T214523.550 GMT',
374
+ pxLongitude: null,
375
+ pyMessageKey: 'Item created.',
376
+ pxHistoryForReference: 'DXIL-DIGV2-WORK C-7430',
377
+ pyMemo: null,
378
+ pxLatitude: null
379
+ }
380
+ ],
381
+ hasMoreResults: false
382
+ },
383
+ status: 200,
384
+ statusText: '',
385
+ headers: {
386
+ 'content-length': '1328',
387
+ 'content-type': 'application/json;charset=UTF-8'
388
+ },
389
+ request: {}
390
+ };
@@ -0,0 +1,60 @@
1
+ import { withKnobs } from '@storybook/addon-knobs';
2
+
3
+ import { configProps, operatorDetails } from './mock.stories';
4
+
5
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
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.getUserApi = () => {
18
+ return {
19
+ getOperatorDetails: () => {
20
+ return new Promise(resolve => {
21
+ resolve(operatorDetails);
22
+ });
23
+ }
24
+ };
25
+ };
26
+
27
+ export const Base{{COMPONENT_CLASS_NAME}} = () => {
28
+
29
+ const props = {
30
+ label: configProps.label,
31
+ createLabel: configProps.createLabel,
32
+ updateLabel: configProps.updateLabel,
33
+ createOperator: configProps.createOperator,
34
+ updateOperator: configProps.updateOperator,
35
+ createDateTime: configProps.createDateTime,
36
+ updateDateTime: configProps.updateDateTime,
37
+ hideLabel: configProps.hideLabel,
38
+
39
+ getPConnect: () => {
40
+ return {
41
+ getActionsApi: () => {
42
+ return {
43
+ updateFieldValue: () => {/* nothing */},
44
+ triggerFieldChange: () => {/* nothing */}
45
+ };
46
+ },
47
+ ignoreSuggestion: () => {/* nothing */},
48
+ acceptSuggestion: () => {/* nothing */},
49
+ setInheritedProps: () => {/* nothing */},
50
+ resolveConfigProps: () => {/* nothing */}
51
+ };
52
+ }
53
+ };
54
+
55
+ return (
56
+ <>
57
+ <{{COMPONENT_CLASS_NAME}} {...props} />
58
+ </>
59
+ );
60
+ };
@@ -52,12 +52,12 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
52
52
  let caseOpId = "";
53
53
  let caseTime = null;
54
54
 
55
- if (fieldLabel === "created") {
55
+ if (fieldLabel === "create operator") {
56
56
  caseOpLabel = createLabel;
57
57
  caseOpName = createOperator.userName;
58
58
  caseTime = createDateTime;
59
59
  caseOpId = createOperator.userId;
60
- } else if (fieldLabel === "updated") {
60
+ } else if (fieldLabel === "update operator") {
61
61
  caseOpLabel = updateLabel;
62
62
  caseOpName = updateOperator.userName;
63
63
  caseTime = updateDateTime;
@@ -0,0 +1,52 @@
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export const configProps = {
3
+ label: 'Create operator',
4
+ createLabel: 'Created',
5
+ updateLabel: 'Updated',
6
+ updateDateTime: '2023-01-16T14:53:33.280Z',
7
+ createDateTime: '2023-01-16T14:53:33.198Z',
8
+ updateOperator: {
9
+ userId: 'admin@mediaco',
10
+ userName: 'admin'
11
+ },
12
+ createOperator: {
13
+ userId: 'admin@mediaco',
14
+ userName: 'admin'
15
+ },
16
+ hideLabel: true,
17
+ key: '_532zx1dah',
18
+ displayMode: 'LABELS_LEFT'
19
+ };
20
+
21
+ export const operatorDetails = {
22
+ data: {
23
+ pzLoadTime: 'January 18, 2023 10:33:19 AM EST',
24
+ pzPageNameHash: '_pa1519192551088960pz',
25
+ pyOperatorInfo: {
26
+ pyUserName: 'french DigV2',
27
+ pyPosition: '',
28
+ pyImageInsKey: '',
29
+ pySkills: [
30
+ {
31
+ pySkillName: '',
32
+ pzIndexOwnerKey: 'DATA-ADMIN-OPERATOR-ID FRENCHTEST.DIGV2',
33
+ pySkillRating: 0
34
+ }
35
+ ],
36
+ pyReportToUserName: '',
37
+ pyReportTo: '',
38
+ pyOrganization: 'DXIL',
39
+ pyTitle: '',
40
+ pyLabel: 'frenchTest.DigV2',
41
+ pyEmailAddress: 'User@DigV2',
42
+ pyTelephone: ''
43
+ }
44
+ },
45
+ status: 200,
46
+ statusText: '',
47
+ headers: {
48
+ 'content-length': '435',
49
+ 'content-type': 'application/json;charset=UTF-8'
50
+ },
51
+ request: {}
52
+ };