@pega/dx-component-builder-sdk 0.242.8 → 0.242.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +6 -0
  3. package/src/constants.js +3 -0
  4. package/src/tasks/create/templates/Constellation/field/Decimal/index.tsx.mustache +3 -6
  5. package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.tsx.mustache +1 -3
  6. package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.tsx.mustache +2 -5
  7. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/index.tsx.mustache +10 -52
  8. package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
  9. package/src/tasks/create/templates/Constellation/template/DETAILS/Avatar.tsx.mustache +5 -7
  10. package/src/tasks/create/templates/Constellation/template/DETAILS-region/Avatar.tsx.mustache +5 -7
  11. package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Avatar.tsx.mustache +5 -7
  12. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +3 -3
  13. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +3 -3
  14. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.ts.mustache +3 -2
  15. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +4 -4
  16. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.ts.mustache +3 -3
  17. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/demo.stories.tsx.mustache +10 -0
  18. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +2 -2
  19. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/demo.stories.tsx.mustache +10 -0
  20. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.ts.mustache +1 -1
  21. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.ts.mustache +3 -3
  22. package/src/tasks/create/templates/SDK-Angular/field/Picklist-Autocomplete/picklist-autocomplete.component.ts.mustache +3 -3
  23. package/src/tasks/create/templates/SDK-Angular/field/Picklist-RadioButtons/picklist-radio-buttons.component.ts.mustache +2 -2
  24. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.ts.mustache +4 -2
  25. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.ts.mustache +1 -1
  26. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.ts.mustache +1 -1
  27. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.ts.mustache +1 -1
  28. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.ts.mustache +1 -1
  29. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +1 -1
  30. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +1 -1
  31. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +1 -1
  32. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.ts.mustache +1 -1
  33. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.ts.mustache +1 -1
  34. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +1 -1
  35. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.ts.mustache +1 -1
  36. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/mock.ts.mustache +1 -1
  37. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.ts.mustache +1 -1
  38. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.ts.mustache +1 -1
  39. package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +1 -1
  40. package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +1 -1
  41. package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +1 -1
  42. package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +21 -19
  43. package/src/tasks/index.js +1 -0
  44. package/src/tasks/map/map.js +2 -1
  45. package/src/tasks/quarantine/index.js +81 -0
  46. package/src/util.js +29 -1
  47. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  48. package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +5 -5
  49. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.css +0 -1
  50. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +28 -29
  51. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
  52. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/index.tsx +1 -3
  53. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/index.tsx +3 -6
  54. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/index.tsx +2 -5
  55. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +10 -52
  56. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +1 -1
  57. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Avatar.tsx +5 -7
  58. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +5 -7
  59. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +5 -7
  60. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +1 -1
  61. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +1 -1
  62. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +1 -1
  63. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +5 -5
  64. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +8 -21
  65. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
  66. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +5 -5
  67. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.css +0 -1
  68. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +28 -29
  69. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/dx-component-builder-sdk",
3
- "version": "0.242.8",
3
+ "version": "0.242.10",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
package/src/cli.js CHANGED
@@ -19,6 +19,7 @@ import {
19
19
  publishComponent,
20
20
  publishAllComponents,
21
21
  renameComponent,
22
+ quarantine,
22
23
  updateComponent,
23
24
  validate,
24
25
  upgrade
@@ -37,6 +38,7 @@ const TASKS = {
37
38
  PUBLISH: 'publish',
38
39
  PUBLISH_ALL: 'publishAll',
39
40
  RENAME: 'rename',
41
+ QUARANTINE: 'quarantine',
40
42
  LIST: 'list',
41
43
  VALIDATE_SCHEMA: 'validateSchema',
42
44
  UPDATE: 'update',
@@ -106,6 +108,10 @@ export default async (args = []) => {
106
108
  renameComponent(options);
107
109
  break;
108
110
  }
111
+ case TASKS.QUARANTINE: {
112
+ quarantine(options);
113
+ break;
114
+ }
109
115
  case TASKS.BUILD: {
110
116
  buildComponent(options);
111
117
  break;
package/src/constants.js CHANGED
@@ -59,6 +59,9 @@ export const JEST_ASSETS_SDK_A = 'sdk-a/components';
59
59
  export const JEST_ASSETS_SDK_R = 'sdk-r/components';
60
60
  export const JEST_CREATE_PATH = 'create/';
61
61
  export const JEST_CREATE_ALL_PATH = 'createAll/';
62
+ export const JEST_TESTS_FUNCTIONAL_PATH = 'node_modules/@pega/dx-component-builder-sdk/tests/functional/';
63
+
64
+
62
65
 
63
66
  /* dxcbConfig.componentDefaults LINT setting/value constants */
64
67
  export const LINT_SETTING_KEY = 'lintAction'; // LINT_SETTING_KEY is expected to be in sdk-config's dxcbConfig.componentDefaults
@@ -88,9 +88,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
88
88
  }, [validatemessage, hasSuggestions, status]);
89
89
 
90
90
  const { decimalPrecision, currencyDecimalPrecision } = props;
91
- let numberOfDecimals = parseInt(decimalPrecision, 10);
91
+ let numberOfDecimals: number | undefined = parseInt(decimalPrecision, 10);
92
92
  if (Number.isNaN(numberOfDecimals)) {
93
- // @ts-ignore
94
93
  numberOfDecimals = decimalPrecision === '' ? undefined : 2;
95
94
  }
96
95
  let noOfFractionDigits = currencyDecimalPrecision === 'auto' ? undefined : parseInt(currencyDecimalPrecision, 10);
@@ -226,15 +225,13 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
226
225
  }
227
226
  setDecimalValue(enteredValue);
228
227
  if (value !== (enteredValue !== '' ? Number(enteredValue) : '')) {
229
- // @ts-ignore
230
- handleEvent(actions, 'change', propName, enteredValue !== '' ? Number(enteredValue) : '');
228
+ handleEvent(actions, 'change', propName, enteredValue !== '' ? Number(enteredValue).toString() : '');
231
229
  hasValueChange.current = true;
232
230
  }
233
231
  }}
234
232
  onBlur={() => {
235
233
  if (!value || hasValueChange.current) {
236
- // @ts-ignore
237
- handleEvent(actions, 'blur', propName, decimalValue !== '' ? Number(decimalValue) : '');
234
+ handleEvent(actions, 'blur', propName, decimalValue !== '' ? Number(decimalValue).toString() : '');
238
235
  if (hasSuggestions) {
239
236
  pConn.ignoreSuggestion("");
240
237
  }
@@ -1,4 +1,3 @@
1
-
2
1
  import { useState, useEffect } from 'react';
3
2
  import {
4
3
  CurrencyInput as CosmosCurrency,
@@ -265,9 +264,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
265
264
  });
266
265
  }}
267
266
  onBlur={(enteredValue) => {
268
- const parsedValue = enteredValue !== '' ? Number(enteredValue) : enteredValue;
267
+ const parsedValue = enteredValue !== '' ? Number(enteredValue).toString() : enteredValue;
269
268
  if (!readOnly && (!value || value !== parsedValue)) {
270
- // @ts-ignore
271
269
  handleEvent(actions, 'changeNblur', propName, parsedValue);
272
270
  if (hasSuggestions) {
273
271
  pConn.ignoreSuggestion('');
@@ -94,9 +94,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
94
94
  }
95
95
  }, [validatemessage, hasSuggestions, status]);
96
96
 
97
- let numberOfDecimals = parseInt(decimalPrecision, 10);
97
+ let numberOfDecimals : number | undefined = parseInt(decimalPrecision, 10);
98
98
  if (Number.isNaN(numberOfDecimals)) {
99
- // @ts-ignore
100
99
  numberOfDecimals = decimalPrecision === '' ? undefined : 2;
101
100
  }
102
101
 
@@ -247,15 +246,13 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
247
246
  }
248
247
  setPercentageValue(enteredValue);
249
248
  if (value !== enteredValue) {
250
- // @ts-ignore
251
249
  handleEvent(actions, 'change', propName, enteredValue);
252
250
  hasValueChange.current = true;
253
251
  }
254
252
  }}
255
253
  onBlur={() => {
256
- const parsedValue = percentageValue !== '' ? Number(percentageValue) : '';
254
+ const parsedValue = percentageValue !== '' ? Number(percentageValue).toString() : '';
257
255
  if (!value || hasValueChange.current) {
258
- // @ts-ignore
259
256
  handleEvent(actions, 'blur', propName, parsedValue);
260
257
  if (hasSuggestions) {
261
258
  pConn.ignoreSuggestion("");
@@ -497,14 +497,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
497
497
  const pConn = getPConnect();
498
498
  const contextName = getPConnect().getContextName();
499
499
  const actions = pConn.getActionsApi();
500
- const [dataApiObj, setDataApiObj] = useState(() => ({}));
500
+ const [dataApiObj, setDataApiObj] = useState(() => ({} as any));
501
501
  const [filterValue, setFilterValue] = useState('');
502
502
  const [loading, setLoading] = useState(listType !== 'associated');
503
503
  // const selected = useMemo(() => menuHelpers.getSelected(items)[0], [items]);
504
504
  const [selected, setSelected] = useState();
505
505
  const hasMoreResults = useRef(true);
506
506
  const inputValueRef = useRef('');
507
- const displayFieldMeta = useRef(null);
507
+ const displayFieldMeta: any = useRef(null);
508
508
  const [actualValue, setActualValue] = useState();
509
509
  const [newRecordCreated, setNewRecordCreated] = useState();
510
510
 
@@ -645,15 +645,13 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
645
645
  }
646
646
  PCore.getDataApi()
647
647
  .init(dataConfig, contextName)
648
- .then(dataObj => {
649
- // @ts-ignore
648
+ .then((dataObj: any) => {
650
649
  setDataApiObj(dataObj);
651
650
  // To avoid calling doSearch if someone types/pastes value before the API call is made
652
651
  if (!filterValue)
653
652
  doSearch(
654
653
  '',
655
654
  getDisplayFieldsMetaData(dataConfig.columns),
656
- // @ts-ignore
657
655
  dataObj,
658
656
  setItems as any,
659
657
  setLoading,
@@ -679,12 +677,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
679
677
  if (!dataRefMount && !displayMode && listType === 'datapage') {
680
678
  PCore.getDataApi()
681
679
  .init(dataConfig, contextName)
682
- .then(dataObj => {
683
- // @ts-ignore
680
+ .then((dataObj: any) => {
684
681
  setDataApiObj(dataObj);
685
682
  // To avoid calling doSearch if someone types/pastes value before the API call is made
686
683
  if (!filterValue) {
687
- // @ts-ignore
688
684
  if (displayFieldMeta?.current?.key === displayFieldMeta?.current?.primary) {
689
685
  const displayItem = {
690
686
  id: value,
@@ -696,7 +692,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
696
692
  doSearch(
697
693
  '',
698
694
  getDisplayFieldsMetaData(dataConfig.columns),
699
- // @ts-ignore
700
695
  dataObj,
701
696
  setItems as any,
702
697
  setLoading,
@@ -716,7 +711,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
716
711
  doSearch(
717
712
  '',
718
713
  getDisplayFieldsMetaData(dataConfig.columns),
719
- // @ts-ignore
720
714
  dataObj,
721
715
  setItems as any,
722
716
  setLoading,
@@ -775,22 +769,16 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
775
769
  ) {
776
770
  PCore.getDataApi()
777
771
  .init(dataConfig, contextName)
778
- .then(dataObj => {
779
- // @ts-ignore
772
+ .then((dataObj: any) => {
780
773
  setDataApiObj(dataObj);
781
- // @ts-ignore
782
774
  buildColumnForDisplayValue(dataObj);
783
775
  // SET matchPosition to EQUALS to return exact matching record
784
- // @ts-ignore
785
776
  dataObj.matchPosition = 'equals';
786
- // @ts-ignore
787
777
  dataObj
788
778
  .fetchData(value)
789
779
  .then((displayResponse: { data: Array<never> }) => {
790
780
  let columnsWithSetProperty: string | Array<any> = [];
791
- // @ts-ignore
792
781
  if (dataApiObj.columns) {
793
- // @ts-ignore
794
782
  columnsWithSetProperty = dataApiObj.columns
795
783
  .filter(
796
784
  (col: { setProperty: string }) =>
@@ -805,12 +793,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
805
793
  const searchedItem = displayResponseData.map((entry: { [x: string]: any }) => {
806
794
  const secondaryArr: Array<any> = [];
807
795
  const secondaryFieldValues: Array<any> = [];
808
- // @ts-ignore
809
796
  displayFieldMeta.current.secondary.forEach((col: string) => {
810
- // @ts-ignore
811
797
  if (!displayFieldMeta.hidden.includes(col)) secondaryArr.push(entry[col]);
812
798
  if (columnsWithSetProperty.includes(col)) {
813
- // @ts-ignore
814
799
  if (dataApiObj.isQueryable) {
815
800
  secondaryFieldValues.push(entry[col]);
816
801
  } else {
@@ -819,9 +804,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
819
804
  }
820
805
  });
821
806
  return {
822
- // @ts-ignore
823
807
  id: entry[displayFieldMeta.current.key],
824
- // @ts-ignore
825
808
  primary: entry[displayFieldMeta.current.primary],
826
809
  secondary: secondaryArr,
827
810
  secondaryFieldValues
@@ -832,13 +815,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
832
815
  setSelected(searchedItem[0]);
833
816
  setActualValue(value);
834
817
  // RESET matchPosition
835
- // @ts-ignore
836
818
  dataObj.matchPosition = dataConfig.matchPosition;
837
819
  })
838
820
  .catch(() => {
839
821
  setActualValue(value);
840
822
  // RESET matchPosition
841
- // @ts-ignore
842
823
  dataObj.matchPosition = dataConfig.matchPosition;
843
824
  });
844
825
  });
@@ -856,21 +837,17 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
856
837
  };
857
838
  })
858
839
  );
859
- // @ts-ignore
860
- setSelected(null);
840
+ setSelected(undefined);
861
841
  inputValueRef.current = '';
862
842
  };
863
843
 
864
844
  const onChangeHandler = (ev: { target: { value: any } }) => {
865
845
  if (hasSuggestions) {
866
- // @ts-ignore
867
- pConn.ignoreSuggestion();
846
+ pConn.ignoreSuggestion('');
868
847
  setStatus(undefined);
869
848
  }
870
849
 
871
- // @ts-ignore
872
850
  dataApiObj.columns = dataConfig.columns;
873
- // @ts-ignore
874
851
  dataApiObj.matchPosition = dataConfig.matchPosition;
875
852
  const searchText = ev.target.value;
876
853
  inputValueRef.current = searchText;
@@ -879,15 +856,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
879
856
  clearSelections();
880
857
  }
881
858
  setFilterValue(searchText);
882
- // @ts-ignore
883
859
  if (listType === 'datapage' && dataApiObj.isQueryable) {
884
860
  hasMoreResults.current = true;
885
861
  if (searchText.length < 5) {
886
862
  searchHandlerThrottled(
887
863
  searchText,
888
- // @ts-ignore
889
864
  displayFieldMeta.current,
890
865
  dataApiObj,
866
+ // @ts-ignore
891
867
  setItems,
892
868
  setLoading,
893
869
  hasMoreResults
@@ -895,9 +871,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
895
871
  } else {
896
872
  searchHandlerDebounced(
897
873
  searchText,
898
- // @ts-ignore
899
874
  displayFieldMeta.current,
900
875
  dataApiObj,
876
+ // @ts-ignore
901
877
  setItems,
902
878
  setLoading,
903
879
  hasMoreResults
@@ -905,14 +881,12 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
905
881
  }
906
882
  } else if (
907
883
  listType === 'associated' ||
908
- // @ts-ignore
909
884
  (listType === 'datapage' && dataApiObj?.isQueryable === false)
910
885
  ) {
911
886
  paginateHelperApis.resetIndexes();
912
887
  const progressivePaginatedRecords = paginateHelperApis.fetchData(
913
888
  inputValueRef.current,
914
889
  false,
915
- // @ts-ignore
916
890
  dataApiObj.columns
917
891
  );
918
892
  setItems(progressivePaginatedRecords);
@@ -939,21 +913,19 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
939
913
 
940
914
  setFilterValue('');
941
915
  if (!selected && inputValueRef.current !== '') {
942
- // @ts-ignore
943
916
  if (listType === 'datapage' && dataApiObj.isQueryable) {
944
917
  hasMoreResults.current = true;
945
918
  searchHandlerThrottled(
946
919
  '',
947
- // @ts-ignore
948
920
  displayFieldMeta.current,
949
921
  dataApiObj,
922
+ // @ts-ignore
950
923
  setItems,
951
924
  setLoading,
952
925
  hasMoreResults
953
926
  );
954
927
  } else if (
955
928
  listType === 'associated' ||
956
- // @ts-ignore
957
929
  (listType === 'datapage' && dataApiObj?.isQueryable === false)
958
930
  ) {
959
931
  paginateHelperApis.resetIndexes();
@@ -976,7 +948,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
976
948
  // @ts-ignore
977
949
  setSelected(menuHelpers.getSelected(updatedItems)[0]);
978
950
  // const { id: itemId } = menuHelpers.getSelected(updatedItems)[0];
979
- // @ts-ignore
980
951
  const assocProp = pConn.getStateProps().value;
981
952
  const propValue = setValueToAssocProp(
982
953
  assocProp,
@@ -1009,7 +980,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1009
980
  const loadMore = () => {
1010
981
  if (
1011
982
  (listType === 'associated' ||
1012
- // @ts-ignore
1013
983
  (listType === 'datapage' && dataApiObj?.isQueryable === false)) &&
1014
984
  paginateHelperApis.hasMoreResults(inputValueRef.current)
1015
985
  ) {
@@ -1019,23 +989,18 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1019
989
  progressivePaginatedRecords = removeDuplicates(previousItems, progressivePaginatedRecords);
1020
990
  return [...previousItems, ...progressivePaginatedRecords];
1021
991
  });
1022
- // @ts-ignore
1023
992
  } else if (listType === 'datapage' && dataApiObj.isQueryable && hasMoreResults.current) {
1024
993
  setLoading(true);
1025
994
  dataApiObj
1026
- // @ts-ignore
1027
995
  .fetchPaginatedData(inputValueRef.current)
1028
996
  .then((response: { pageSize: number; data: Array<never> }) => {
1029
997
  setLoading(false);
1030
- // @ts-ignore
1031
998
  if (response.pageSize === 0 || response.pageSize < dataApiObj.pageSize) {
1032
999
  hasMoreResults.current = false;
1033
1000
  }
1034
1001
  const listObjData = response.data || [];
1035
1002
  let columnsWithSetProperty: string | Array<any> = [];
1036
- // @ts-ignore
1037
1003
  if (dataApiObj.columns) {
1038
- // @ts-ignore
1039
1004
  columnsWithSetProperty = dataApiObj.columns
1040
1005
  .filter(
1041
1006
  (col: { setProperty: string }) =>
@@ -1049,12 +1014,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1049
1014
  const searchedItems = listObjData.map((entry: { [x: string]: any }) => {
1050
1015
  const secondaryArr: Array<any> = [];
1051
1016
  const secondaryFieldValues: Array<any> = [];
1052
- // @ts-ignore
1053
1017
  displayFieldMeta.current.secondary.forEach((col: string) => {
1054
- // @ts-ignore
1055
1018
  if (!displayFieldMeta.current.hidden.includes(col)) secondaryArr.push(entry[col]);
1056
1019
  if (columnsWithSetProperty.includes(col)) {
1057
- // @ts-ignore
1058
1020
  if (dataApiObj.isQueryable) {
1059
1021
  secondaryFieldValues.push(entry[col]);
1060
1022
  } else {
@@ -1063,9 +1025,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1063
1025
  }
1064
1026
  });
1065
1027
  return {
1066
- // @ts-ignore
1067
1028
  id: entry[displayFieldMeta.current.key],
1068
- // @ts-ignore
1069
1029
  primary: entry[displayFieldMeta.current.primary],
1070
1030
  secondary: secondaryArr,
1071
1031
  secondaryFieldValues
@@ -1076,7 +1036,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1076
1036
  })
1077
1037
  .catch(() => {
1078
1038
  setLoading(false);
1079
- // @ts-ignore
1080
1039
  dataApiObj.pageSize -= 1;
1081
1040
  });
1082
1041
  }
@@ -1162,7 +1121,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1162
1121
  selected: item.items ? undefined : !!item.selected || item.id === selected?.id
1163
1122
  })),
1164
1123
  onItemClick: selectItem,
1165
- // @ts-ignore
1166
1124
  emptyText: pConn.getLocalizedValue('No items'),
1167
1125
  loading,
1168
1126
  loadMore,
@@ -187,7 +187,7 @@ export const updatePropertiesForNewRecord = (
187
187
  dataObj
188
188
  .fetchData(newCaseId)
189
189
  // @ts-ignore
190
- .then(displayResponse => {
190
+ .then((displayResponse: any) => {
191
191
  let columnsWithSetProperty = [];
192
192
  if (dataApiObj.columns) {
193
193
  columnsWithSetProperty = dataApiObj.columns
@@ -22,8 +22,8 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
22
22
  // TODO Below if conditions can be removed once we have apis to get worklist/mywork info
23
23
  // This is non CaseView case (Dashboard, MyWork etc)
24
24
  if (!metaObj) {
25
- userName = PCore.getEnvironmentInfo().getOperatorName();
26
- userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
25
+ userName = PCore.getEnvironmentInfo().getOperatorName() ?? "";
26
+ userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier() ?? "";
27
27
  } else {
28
28
  userName = metaObj.name;
29
29
  userIdentifier = metaObj.ID;
@@ -46,22 +46,20 @@ 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
62
+
65
63
  return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
66
64
  }
67
65
 
@@ -22,8 +22,8 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
22
22
  // TODO Below if conditions can be removed once we have apis to get worklist/mywork info
23
23
  // This is non CaseView case (Dashboard, MyWork etc)
24
24
  if (!metaObj) {
25
- userName = PCore.getEnvironmentInfo().getOperatorName();
26
- userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
25
+ userName = PCore.getEnvironmentInfo().getOperatorName() ?? "";
26
+ userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier() ?? "";
27
27
  } else {
28
28
  userName = metaObj.name;
29
29
  userIdentifier = metaObj.ID;
@@ -46,22 +46,20 @@ 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
62
+
65
63
  return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
66
64
  }
67
65
 
@@ -22,8 +22,8 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
22
22
  // TODO Below if conditions can be removed once we have apis to get worklist/mywork info
23
23
  // This is non CaseView case (Dashboard, MyWork etc)
24
24
  if (!metaObj) {
25
- userName = PCore.getEnvironmentInfo().getOperatorName();
26
- userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
25
+ userName = PCore.getEnvironmentInfo().getOperatorName() ?? "";
26
+ userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier() ?? "";
27
27
  } else {
28
28
  userName = metaObj.name;
29
29
  userIdentifier = metaObj.ID;
@@ -46,22 +46,20 @@ 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
62
+
65
63
  return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
66
64
  }
67
65
 
@@ -146,7 +146,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
146
146
  }
147
147
 
148
148
  this.actionsApi = this.pConn$.getActionsApi();
149
- this.propName = (this.pConn$.getStateProps() as any).value;
149
+ this.propName = this.pConn$.getStateProps().value;
150
150
 
151
151
  // multi case
152
152
  this.selectionMode = this.configProps$.selectionMode;
@@ -159,7 +159,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
159
159
  this.datasource = this.configProps$.datasource;
160
160
  this.selectionKey = this.configProps$.selectionKey;
161
161
  const listSourceItems = this.datasource?.source ?? [];
162
- const dataField: any = this.selectionKey?.split?.('.')[1];
162
+ const dataField = this.selectionKey?.split?.('.')[1] ?? '';
163
163
  const listToDisplay: any[] = [];
164
164
  listSourceItems.forEach(element => {
165
165
  element.selected = this.selectedvalues?.some?.(data => data[dataField] === element.key);
@@ -203,7 +203,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
203
203
  this.fieldControl.enable();
204
204
  }
205
205
 
206
- this.componentReference = (this.pConn$.getStateProps() as any).value;
206
+ this.componentReference = this.pConn$.getStateProps().value;
207
207
 
208
208
  // eslint-disable-next-line sonarjs/no-redundant-boolean
209
209
  if (this.value$ === 'true' || this.value$ == true) {
@@ -21,7 +21,7 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
21
21
  }
22
22
 
23
23
  class MyFormat {
24
- theDateFormat: any = getDateFormatInfo();
24
+ theDateFormat = getDateFormatInfo();
25
25
 
26
26
  get display() {
27
27
  return {
@@ -83,7 +83,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
83
83
  // Start with default dateFormatInfo
84
84
  dateFormatInfo = dateFormatInfoDefault;
85
85
  // and then update, as needed, based on locale, etc.
86
- theDateFormat: any = getDateFormatInfo();
86
+ theDateFormat = getDateFormatInfo();
87
87
 
88
88
  constructor(
89
89
  private angularPConnect: AngularPConnectService,
@@ -194,7 +194,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
194
194
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
195
195
  }
196
196
 
197
- this.componentReference = (this.pConn$.getStateProps() as any).value;
197
+ this.componentReference = this.pConn$.getStateProps().value;
198
198
 
199
199
  // trigger display of error message with field control
200
200
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -61,7 +61,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
61
61
  // Start with default dateFormatInfo
62
62
  dateFormatInfo = dateFormatInfoDefault;
63
63
  // and then update, as needed, based on locale, etc.
64
- theDateFormat: any = getDateFormatInfo();
64
+ theDateFormat = getDateFormatInfo();
65
65
  placeholder: string;
66
66
 
67
67
  constructor(
@@ -155,7 +155,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
155
155
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
156
156
  }
157
157
 
158
- this.componentReference = (this.pConn$.getStateProps() as any).value;
158
+ this.componentReference = this.pConn$.getStateProps().value;
159
159
 
160
160
  // trigger display of error message with field control
161
161
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -169,6 +169,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
169
169
  }
170
170
 
171
171
  fieldOnDateChange(event: any) {
172
+ // this comes from the date pop up
172
173
  if (typeof event.value === 'object') {
173
174
  // convert date to pega "date" format
174
175
  event.value = event.value?.toISOString();
@@ -140,7 +140,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
140
140
  this.helperText = this.configProps$.helperText;
141
141
  this.placeholder = this.configProps$.placeholder || '';
142
142
  const showGroupSeparators = this.configProps$.showGroupSeparators;
143
- const currencyISOCode: any = this.configProps$?.currencyISOCode;
143
+ const currencyISOCode = this.configProps$?.currencyISOCode ?? '';
144
144
 
145
145
  const theSymbols = getCurrencyCharacters(currencyISOCode);
146
146
  this.currDec = theSymbols.theDecimalIndicator;
@@ -152,7 +152,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
152
152
  if (this.formatter === 'Currency') {
153
153
  this.formattedValue = format(this.value$, this.formatter.toLowerCase(), theCurrencyOptions);
154
154
  } else {
155
- this.formattedValue = format(this.value$, this.pConn$.getComponentName().toLowerCase(), theCurrencyOptions);
155
+ this.formattedValue = format(this.value$, this.pConn$.getComponentName()?.toLowerCase(), theCurrencyOptions);
156
156
  }
157
157
 
158
158
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
@@ -189,12 +189,12 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
189
189
  }
190
190
  this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2;
191
191
 
192
- this.componentReference = (this.pConn$.getStateProps() as any).value;
192
+ this.componentReference = this.pConn$.getStateProps().value;
193
193
  }
194
194
 
195
195
  fieldOnBlur(event: any) {
196
196
  const actionsApi = this.pConn$?.getActionsApi();
197
- const propName = (this.pConn$?.getStateProps() as any).value;
197
+ const propName = this.pConn$?.getStateProps().value;
198
198
  let value = event?.target?.value;
199
199
  if (this.currSep === ',') {
200
200
  value = value.replace(/,/g, '');