@pega/custom-dx-components 0.242.15 → 0.242.17

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 (92) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +2 -3
  3. package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +0 -1
  4. package/src/tasks/create/templates/Constellation/Field/Boolean/mock.ts.mustache +0 -1
  5. package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +3 -5
  6. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +1 -2
  7. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +1 -2
  8. package/src/tasks/create/templates/Constellation/Field/Decimal/event-utils.ts.mustache +1 -1
  9. package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +1 -4
  10. package/src/tasks/create/templates/Constellation/Field/Decimal/mock.ts.mustache +0 -1
  11. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +1 -2
  12. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/event-utils.ts.mustache +1 -1
  13. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +0 -2
  14. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.ts.mustache +0 -2
  15. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +1 -2
  16. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/event-utils.ts.mustache +1 -1
  17. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +1 -4
  18. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.ts.mustache +2 -3
  19. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +4 -5
  20. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +0 -2
  21. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/mock.ts.mustache +0 -1
  22. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +1 -2
  23. package/src/tasks/create/templates/Constellation/Field/Integer/event-utils.ts.mustache +1 -1
  24. package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +2 -9
  25. package/src/tasks/create/templates/Constellation/Field/Integer/mock.ts.mustache +3 -2
  26. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +4 -6
  27. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +7 -14
  28. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +4 -6
  29. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache +26 -23
  30. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +10 -52
  31. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/mock.ts.mustache +0 -1
  32. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +4 -6
  33. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +1 -6
  34. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/mock.ts.mustache +0 -2
  35. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +2 -3
  36. package/src/tasks/create/templates/Constellation/Field/Text/mock.ts.mustache +0 -1
  37. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +1 -2
  38. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +0 -2
  39. package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.ts.mustache +2 -2
  40. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +1 -2
  41. package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.ts.mustache +0 -1
  42. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +1 -2
  43. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +0 -2
  44. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.ts.mustache +0 -2
  45. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +1 -3
  46. package/src/tasks/create/templates/Constellation/Field/Text-Phone/event-utils.ts.mustache +1 -1
  47. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +2 -6
  48. package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.ts.mustache +0 -2
  49. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +1 -3
  50. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +0 -2
  51. package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.ts.mustache +0 -2
  52. package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache +13 -8
  53. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +1 -2
  54. package/src/tasks/create/templates/Constellation/Field/TimeofDay/mock.ts.mustache +0 -2
  55. package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +3 -5
  56. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +8 -7
  57. package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +0 -2
  58. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +1 -3
  59. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +15 -14
  60. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +2 -5
  61. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +1 -3
  62. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache +4 -8
  63. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +67 -7
  64. package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +3 -3
  65. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +1 -1
  66. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +4 -5
  67. package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +0 -1
  68. package/src/tasks/create/templates/Constellation/Template/PAGE/mock.ts.mustache +0 -2
  69. package/src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache +6 -19
  70. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +4 -6
  71. package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +1 -4
  72. package/src/tasks/create/templates/Constellation/Widget/CASE/mock.ts.mustache +0 -1
  73. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +3 -4
  74. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +2 -6
  75. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +2 -5
  76. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +2 -3
  77. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.ts.mustache +0 -1
  78. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +4 -5
  79. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +0 -2
  80. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/mock.ts.mustache +0 -1
  81. package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.tsx.mustache +4 -6
  82. package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +1 -4
  83. package/src/tasks/create/templates/Launchpad/Widget/CASE/mock.ts.mustache +1 -1
  84. package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +3 -5
  85. package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +2 -6
  86. package/src/tasks/create/templates/Launchpad/Widget/PAGE/mock.ts.mustache +0 -1
  87. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.tsx.mustache +1 -3
  88. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/demo.stories.tsx.mustache +2 -3
  89. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/mock.ts.mustache +0 -1
  90. package/src/tasks/init/template/package.json.mustache +1 -1
  91. package/src/tasks/list/helper.js +4 -1
  92. package/src/tasks/revert-webpack/index.js +10 -28
@@ -1,7 +1,6 @@
1
1
 
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
3
  /* eslint-disable react/no-unstable-nested-components */
4
- // @ts-nocheck
5
4
  import type { Meta, StoryObj } from '@storybook/react';
6
5
 
7
6
  import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
@@ -18,14 +17,14 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
18
17
  export default meta;
19
18
  type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
20
19
 
21
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
20
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
22
21
  if (!window.PCore) {
23
22
  window.PCore = {};
24
23
  }
25
24
 
26
25
  window.PCore.getLocaleUtils = () => {
27
26
  return {
28
- getLocaleValue: val => {
27
+ getLocaleValue: (val: any) => {
29
28
  return val;
30
29
  }
31
30
  };
@@ -59,13 +58,13 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
59
58
  getComponentName: () => {
60
59
  return '';
61
60
  },
62
- getLocalizedValue: value => {
61
+ getLocalizedValue: (value: any) => {
63
62
  return value;
64
63
  },
65
64
  getRawMetadata: () => {
66
65
  return pyHome1Raw;
67
66
  },
68
- createComponent: config => {
67
+ createComponent: (config: any) => {
69
68
  if (config.type === 'AppAnnouncement') {
70
69
  return (
71
70
  <PegaAppAnnouncement
@@ -54,7 +54,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
54
54
 
55
55
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
56
56
  <OneColumn
57
- // @ts-ignore
58
57
  a={useConfigurableLayout ? <ConfigurableLayout items={layoutItemsA} /> : childArray[0]}
59
58
  title={title}
60
59
  icon={tempIcon?.replace('pi pi-', '')}
@@ -1,5 +1,3 @@
1
-
2
- // @ts-nocheck
3
1
  export const pyHome1Raw = {
4
2
  name: 'pyHome1',
5
3
  type: 'View',
@@ -2,7 +2,7 @@ import { createUID } from '@pega/cosmos-react-core';
2
2
 
3
3
  // import { LazyMap as LazyComponentMap } from '../../components_map';
4
4
 
5
- const LazyComponentMap = {};
5
+ const LazyComponentMap: any = {};
6
6
 
7
7
  /**
8
8
  * Given the PConnect object of a Template component, retrieve the children
@@ -53,47 +53,40 @@ export function getAllFields(pConnect: Function) {
53
53
  export function prepareComponentInCaseSummary(configObject: any, getPConnect: Function, displayMode: string) {
54
54
  const { config, children } = configObject;
55
55
  let { type } = configObject;
56
- const caseSummaryComponentObject = {};
56
+ const caseSummaryComponentObject: any = {};
57
57
  let showAddressLabel = true;
58
58
  if (config && config.value === '@P .pyStatusWork') {
59
59
  config.displayAsStatus = true;
60
60
  type = 'TextInput'; // force the type to be TextInput for status field.
61
61
  // As TextInput is loaded forcefully sometimes, TextInput component might not be available in lazy map.
62
62
  // Load TextInput if it is not available.
63
- // @ts-ignore
64
63
  if (!LazyComponentMap[type]) {
65
64
  PCore.getAssetLoader().getLoader('component-loader')([type]);
66
65
  }
67
66
  }
68
67
 
69
- // @ts-ignore
70
68
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
71
69
  label: config.label
72
70
  }).label;
73
71
  if (type === 'CaseOperator') {
74
- // @ts-ignore
75
72
  switch (caseSummaryComponentObject.name) {
76
73
  case 'Create operator':
77
- // @ts-ignore
78
74
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
79
75
  createLabel: config.createLabel
80
76
  }).createLabel;
81
77
  break;
82
78
  case 'Update operator':
83
- // @ts-ignore
84
79
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
85
80
  updateLabel: config.updateLabel
86
81
  }).updateLabel;
87
82
  break;
88
83
  default:
89
- // @ts-ignore
90
84
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
91
85
  resolveLabel: config.resolveLabel
92
86
  }).resolveLabel;
93
87
  break;
94
88
  }
95
89
  } else if (type === 'Checkbox') {
96
- // @ts-ignore
97
90
  caseSummaryComponentObject.name = getPConnect().resolveConfigProps({
98
91
  label: config.caption
99
92
  }).label;
@@ -115,10 +108,8 @@ export function prepareComponentInCaseSummary(configObject: any, getPConnect: Fu
115
108
  createdComponent.props.getPConnect().setInheritedProp('showAddressLabel', showAddressLabel);
116
109
  }
117
110
  // createdComponent.props.getPConnect().setInheritedProp("hideLabel", true);
118
- // @ts-ignore
119
111
  caseSummaryComponentObject.value = createdComponent;
120
112
  if (type === 'reference') {
121
- // @ts-ignore
122
113
  caseSummaryComponentObject.name = createdComponent.props.getPConnect().getInheritedProps().label;
123
114
  }
124
115
 
@@ -188,16 +179,13 @@ export function getLayoutDataFromRegion(regionData: object[]) {
188
179
  export function getIsAssignmentView(pConnect: Function) {
189
180
  // Get caseInfo content from the store which contains the view info about the current assignment/step
190
181
  // TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available
191
- // @ts-ignore
192
- const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);
193
- // @ts-ignore
194
- const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);
182
+ const assignmentViewClass = pConnect().getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);
183
+ const assignmentViewName = pConnect().getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);
195
184
 
196
185
  const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;
197
186
 
198
187
  // Get the info about the current view from pConnect
199
- // @ts-ignore
200
- const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;
188
+ const currentViewId = `${pConnect().getCurrentView()}!${pConnect().getCurrentClassID()}`;
201
189
 
202
190
  return assignmentViewId === currentViewId;
203
191
  }
@@ -208,8 +196,7 @@ export function getIsAssignmentView(pConnect: Function) {
208
196
  * @param {string} [instructions="casestep"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)
209
197
  */
210
198
  export function getInstructions(pConnect: Function, instructions: string = 'casestep') {
211
- // @ts-ignore
212
- const caseStepInstructions = pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);
199
+ const caseStepInstructions = pConnect().getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);
213
200
 
214
201
  // Determine if this view is the current assignment/step view
215
202
  const isCurrentAssignmentView = getIsAssignmentView(pConnect);
@@ -1,6 +1,4 @@
1
-
2
1
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
2
  import type { Meta, StoryObj } from '@storybook/react';
5
3
 
6
4
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -30,7 +28,7 @@ window.PCore.getConstants = () => {
30
28
 
31
29
  window.PCore.getLocaleUtils = () => {
32
30
  return {
33
- getLocaleValue: value => {
31
+ getLocaleValue: (value: any) => {
34
32
  return value;
35
33
  }
36
34
  };
@@ -46,19 +44,19 @@ window.PCore.getDataApiUtils = () => {
46
44
  };
47
45
  };
48
46
 
49
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
47
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
50
48
 
51
49
  const props = {
52
50
 
53
51
  getPConnect: () => {
54
52
  return {
55
- getValue: value => {
53
+ getValue: (value: any) => {
56
54
  return value;
57
55
  },
58
56
  getContextName: () => {
59
57
  return 'app/primary_1';
60
58
  },
61
- getLocalizedValue: value => {
59
+ getLocalizedValue: (value: any) => {
62
60
  return value;
63
61
  },
64
62
  getActionsApi: () => {
@@ -31,13 +31,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
31
31
  ];
32
32
 
33
33
  useEffect(() => {
34
- // @ts-ignore
35
34
  const payload = { dataViewParameters: [{ CaseInstanceKey: caseID }] };
36
35
  PCore.getDataApiUtils()
37
- // @ts-ignore
38
36
  .getData('D_pyWorkHistory', payload, context)
39
- // @ts-ignore
40
- .then((response) => {
37
+ .then((response: any) => {
41
38
  setIsLoading(false);
42
39
  if (response.data.data !== null) {
43
40
  setHistory(
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  const historyData = {
3
2
  data: {
4
3
  fetchDateTime: '2023-01-18T12:04:56.517Z',
@@ -1,6 +1,5 @@
1
1
 
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
3
  import type { Meta, StoryObj } from '@storybook/react';
5
4
 
6
5
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -63,19 +62,19 @@ window.PCore.getDataApiUtils = () => {
63
62
 
64
63
 
65
64
 
66
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
65
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
67
66
 
68
67
  const props = {
69
68
  ...configProps,
70
69
  getPConnect: () => {
71
70
  return {
72
- getValue: value => {
71
+ getValue: (value: any) => {
73
72
  return value;
74
73
  },
75
74
  getContextName: () => {
76
75
  return 'app/primary_1';
77
76
  },
78
- getLocalizedValue: value => {
77
+ getLocalizedValue: (value: any) => {
79
78
  return value;
80
79
  },
81
80
  getActionsApi: () => {
@@ -8,7 +8,7 @@ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
8
8
  // interface for props
9
9
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
10
10
  // If any, enter additional props that only exist on TextInput here
11
- datasource: Array<any>;
11
+ datasource: any;
12
12
  header: string;
13
13
  description: string;
14
14
  whatsnewlink: string;
@@ -27,10 +27,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
27
27
  const context = PConnect.getContextName();
28
28
 
29
29
  let details = [];
30
- // @ts-ignore
31
30
  if (datasource && datasource.source) {
32
- // @ts-ignore
33
- details = datasource.source.map((item) => {
31
+ details = datasource.source.map((item: { name: any; }) => {
34
32
  return item.name;
35
33
  });
36
34
  }
@@ -50,9 +48,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
50
48
  useEffect(() => {
51
49
 
52
50
  PCore.getDataApiUtils()
53
- // @ts-ignore
54
51
  .getData(dataViewName, {}, context)
55
- // @ts-ignore
56
52
  .then((response: any) => {
57
53
  setIsLoading(false);
58
54
  if (response.data.data !== null) {
@@ -46,22 +46,19 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
46
46
  const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
47
47
  const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
48
48
 
49
- // @ts-ignore
50
- const handleUserStateChange = ({ state }) => {
49
+ const handleUserStateChange = ({ state }: any) => {
51
50
  setUserState(state === 'online' ? 'active' : 'inactive');
52
51
  };
53
52
 
54
53
  useEffect(() => {
55
54
  const subId = PCore.getMessagingServiceManager()
56
55
  .getUserPresence()
57
- // @ts-ignore
58
- .subscribe(userIdentifier, handleUserStateChange);
56
+ .subscribe(userIdentifier, handleUserStateChange, '');
59
57
 
60
58
  return function cleanup() {
61
59
  PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
62
60
  };
63
61
  }, [userIdentifier, handleUserStateChange]);
64
- // @ts-ignore
65
62
  return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
66
63
  }
67
64
 
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable react/jsx-no-useless-fragment */
2
- // @ts-nocheck
3
2
  import type { Meta, StoryObj } from '@storybook/react';
4
3
 
5
4
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -21,7 +20,7 @@ if (!window.PCore) {
21
20
 
22
21
  window.PCore.getLocaleUtils = () => {
23
22
  return {
24
- getLocaleValue: value => {
23
+ getLocaleValue: (value: any) => {
25
24
  return value;
26
25
  }
27
26
  };
@@ -37,7 +36,7 @@ window.PCore.getUserApi = () => {
37
36
  };
38
37
  };
39
38
 
40
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
39
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
41
40
 
42
41
  const props = {
43
42
  label: configProps.label,
@@ -1,5 +1,4 @@
1
1
 
2
- // @ts-nocheck
3
2
  export const configProps = {
4
3
  label: 'Create operator',
5
4
  createLabel: 'Created',
@@ -1,10 +1,9 @@
1
1
 
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
3
  import type { Meta, StoryObj } from '@storybook/react';
5
4
 
6
5
  import {{COMPONENT_CLASS_NAME}} from './index';
7
- import { stateProps, configProps } from './mock';
6
+ import { configProps } from './mock';
8
7
 
9
8
  const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
10
9
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -51,18 +50,18 @@ window.PCore.getDataPageUtils = () => {
51
50
  };
52
51
  };
53
52
 
54
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
53
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
55
54
 
56
55
  const props = {
57
56
  getPConnect: () => {
58
57
  return {
59
- getValue: value => {
58
+ getValue: (value: any) => {
60
59
  return value;
61
60
  },
62
61
  getContextName: () => {
63
62
  return 'app/primary_1';
64
63
  },
65
- getLocalizedValue: value => {
64
+ getLocalizedValue: (value: any) => {
66
65
  return value;
67
66
  },
68
67
  getActionsApi: () => {
@@ -116,9 +116,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
116
116
  // only retrieve table data if table is shown
117
117
  if (showTable) {
118
118
  PCore.getDataPageUtils()
119
- // @ts-ignore
120
119
  .getDataAsync(dataViewName, context, params, null, null)
121
- // @ts-ignore
122
120
  .then((response: any) => {
123
121
  setIsLoading(false);
124
122
  // table requires an index or will get setExtraStackFrame error
@@ -1,5 +1,4 @@
1
1
 
2
- // @ts-nocheck
3
2
  export const configProps = {
4
3
 
5
4
  };
@@ -1,6 +1,4 @@
1
-
2
1
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
2
  import type { Meta, StoryObj } from '@storybook/react';
5
3
 
6
4
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -30,7 +28,7 @@ window.PCore.getConstants = () => {
30
28
 
31
29
  window.PCore.getLocaleUtils = () => {
32
30
  return {
33
- getLocaleValue: value => {
31
+ getLocaleValue: (value: any) => {
34
32
  return value;
35
33
  }
36
34
  };
@@ -46,20 +44,20 @@ window.PCore.getDataApiUtils = () => {
46
44
  };
47
45
  };
48
46
 
49
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
47
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
50
48
 
51
49
  const props = {
52
50
  label: 'Case history',
53
51
 
54
52
  getPConnect: () => {
55
53
  return {
56
- getValue: value => {
54
+ getValue: (value: any) => {
57
55
  return value;
58
56
  },
59
57
  getContextName: () => {
60
58
  return 'app/primary_1';
61
59
  },
62
- getLocalizedValue: value => {
60
+ getLocalizedValue: (value: any) => {
63
61
  return value;
64
62
  },
65
63
  getActionsApi: () => {
@@ -29,13 +29,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
29
29
  ];
30
30
 
31
31
  useEffect(() => {
32
- // @ts-ignore
33
32
  const payload = { dataViewParameters: [{ ObjectID: caseID }] };
34
33
  PCore.getDataApiUtils()
35
- // @ts-ignore
36
34
  .getData('ObjectHistory', payload, context)
37
- // @ts-ignore
38
- .then((response) => {
35
+ .then((response: any) => {
39
36
  setIsLoading(false);
40
37
  if (response.data.data !== null) {
41
38
  setHistory(
@@ -1,4 +1,4 @@
1
- // @ts-nocheck
1
+
2
2
  const historyData = {
3
3
  data: {
4
4
  fetchDateTime: '2023-01-18T12:04:56.517Z',
@@ -1,6 +1,4 @@
1
-
2
1
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
2
  import type { Meta, StoryObj } from '@storybook/react';
5
3
 
6
4
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -64,19 +62,19 @@ window.PCore.getDataApiUtils = () => {
64
62
 
65
63
 
66
64
 
67
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
65
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
68
66
 
69
67
  const props = {
70
68
  ...configProps,
71
69
  getPConnect: () => {
72
70
  return {
73
- getValue: value => {
71
+ getValue: (value: any) => {
74
72
  return value;
75
73
  },
76
74
  getContextName: () => {
77
75
  return 'app/primary_1';
78
76
  },
79
- getLocalizedValue: value => {
77
+ getLocalizedValue: (value: any) => {
80
78
  return value;
81
79
  },
82
80
  getActionsApi: () => {
@@ -8,7 +8,7 @@ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
8
8
  // interface for props
9
9
  interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
10
10
  // If any, enter additional props that only exist on TextInput here
11
- datasource: Array<any>;
11
+ datasource: any;
12
12
  header: string;
13
13
  description: string;
14
14
  whatsnewlink: string;
@@ -27,10 +27,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
27
27
  const context = PConnect.getContextName();
28
28
 
29
29
  let details = [];
30
- // @ts-ignore
31
30
  if (datasource && datasource.source) {
32
- // @ts-ignore
33
- details = datasource.source.map((item) => {
31
+ details = datasource.source.map((item: any) => {
34
32
  return item.name;
35
33
  });
36
34
  }
@@ -50,9 +48,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
50
48
  useEffect(() => {
51
49
 
52
50
  PCore.getDataApiUtils()
53
- // @ts-ignore
54
51
  .getData(dataViewName, {}, context)
55
- // @ts-ignore
56
52
  .then((response: any) => {
57
53
  setIsLoading(false);
58
54
  if (response.data.data !== null) {
@@ -1,5 +1,4 @@
1
1
 
2
- // @ts-nocheck
3
2
  const configProps = {
4
3
  label: 'App announcement',
5
4
  header: 'Announcements',
@@ -46,8 +46,7 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
46
46
  const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
47
47
  const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
48
48
 
49
- // @ts-ignore
50
- const handleUserStateChange = ({ state }) => {
49
+ const handleUserStateChange = ({ state } : any) => {
51
50
  setUserState(state === 'online' ? 'active' : 'inactive');
52
51
  };
53
52
 
@@ -61,7 +60,6 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
61
60
  PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
62
61
  };
63
62
  }, [userIdentifier, handleUserStateChange]);
64
- // @ts-ignore
65
63
  return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
66
64
  }
67
65
 
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable react/jsx-no-useless-fragment */
2
- // @ts-nocheck
3
2
  import type { Meta, StoryObj } from '@storybook/react';
4
3
 
5
4
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -21,7 +20,7 @@ if (!window.PCore) {
21
20
 
22
21
  window.PCore.getLocaleUtils = () => {
23
22
  return {
24
- getLocaleValue: value => {
23
+ getLocaleValue: (value: any) => {
25
24
  return value;
26
25
  }
27
26
  };
@@ -37,7 +36,7 @@ window.PCore.getUserApi = () => {
37
36
  };
38
37
  };
39
38
 
40
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
39
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
41
40
 
42
41
  const props = {
43
42
  label: configProps.label,
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  export const configProps = {
3
2
  label: 'Create operator',
4
3
  createLabel: 'Created',
@@ -80,7 +80,7 @@
80
80
  },
81
81
  "devDependencies": {
82
82
  "@pega/configs": "^0.6.0",
83
- "@pega/custom-dx-components": "0.242.15",
83
+ "@pega/custom-dx-components": "0.242.17",
84
84
  "@pega/pcore-pconnect-typedefs": "~3.0.0",
85
85
  "@storybook/addon-actions": "^7.6.7",
86
86
  "@storybook/addon-essentials": "^7.6.19",
@@ -102,7 +102,10 @@ async function fetchComponentsFromInfinity(apiUrl, headers) {
102
102
  })
103
103
  .then((response) => {
104
104
  status = response.status;
105
- if (status === 404){
105
+ if (status === 401) {
106
+ throw new Error('Error occurred in authentication. Please regenerate using authenticate');
107
+ }
108
+ else if (status === 404){
106
109
  throw new Error('404: Server resource not found');
107
110
  }
108
111
  else if (status === 405){
@@ -1,51 +1,34 @@
1
-
2
1
  import fs from 'fs';
3
- import path, { join } from 'path';
4
- import { URL, fileURLToPath } from 'url';
2
+ import path from 'path';
5
3
 
6
4
  import chalk from 'chalk';
7
- import { up } from 'inquirer/lib/utils/readline.js';
8
-
9
- import {
10
- convertIntoPascalCase,
11
- showVersion,
12
- updateUseWebPackPromotion,
13
- getLibraryBased
14
- } from '../../util.js';
15
- import {
16
- WEBPACK_CONFIG_JS_FILENAME,
17
- BUILDER_INDEX_FILE_PATH
18
- } from '../../constants.js';
19
5
 
20
- const isLibraryBased = await getLibraryBased();
6
+ import { showVersion, updateUseWebPackPromotion, getLibraryBased } from '../../util.js';
7
+ import { WEBPACK_CONFIG_JS_FILENAME } from '../../constants.js';
21
8
 
9
+ const isLibraryBased = await getLibraryBased();
22
10
 
23
11
  export const renamePromotedWebPack = async () => {
24
-
25
12
  // call this function from top level
26
13
  // fs.copyFileSync("./webpack.config.js", "webpack.config.js")
27
14
 
28
15
  const promoteWebPackDir = path.resolve(WEBPACK_CONFIG_JS_FILENAME);
29
- const renamedPromoteWebPackDir = path.resolve(`${WEBPACK_CONFIG_JS_FILENAME }.notused`);
16
+ const renamedPromoteWebPackDir = path.resolve(`${WEBPACK_CONFIG_JS_FILENAME}.notused`);
30
17
 
31
18
  try {
32
19
  fs.renameSync(promoteWebPackDir, renamedPromoteWebPackDir);
33
- }
34
- catch (ex) {
20
+ } catch (ex) {
35
21
  console.log(chalk.bold.red(`File ${promoteWebPackDir} not found.`));
36
22
  process.exit();
37
23
  }
38
24
 
39
- console.log(chalk.bold.green("Bundler reverted to using internal webpack.config.js."));
25
+ console.log(chalk.bold.green('Bundler reverted to using internal webpack.config.js.'));
40
26
  console.log(chalk.bold.green(`File ${promoteWebPackDir} marked as not used.`));
27
+ };
41
28
 
42
- }
43
-
44
-
45
-
46
- export default async options => {
29
+ export default async () => {
47
30
  if (isLibraryBased) {
48
- console.log(`Command only supported for ${chalk.bold.green('non library based')} components.`)
31
+ console.log(`Command only supported for ${chalk.bold.green('non library based')} components.`);
49
32
  process.exit();
50
33
  }
51
34
 
@@ -53,5 +36,4 @@ export default async options => {
53
36
 
54
37
  await renamePromotedWebPack();
55
38
  await updateUseWebPackPromotion(false);
56
-
57
39
  };