From 988e8bbd340a5977170a5cd54151bce3b6c4f6e7 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 7 Nov 2024 19:23:15 +0530 Subject: [PATCH] Typedef changes --- package-lock.json | 8 +++--- package.json | 2 +- .../field/CancelAlert/CancelAlert.tsx | 5 +--- .../components/field/Currency/Currency.tsx | 2 +- .../src/components/field/Decimal/Decimal.tsx | 2 +- .../components/field/Dropdown/Dropdown.tsx | 3 --- .../field/Percentage/Percentage.tsx | 2 +- .../field/RadioButtons/RadioButtons.tsx | 3 --- .../field/ScalarList/ScalarList.tsx | 4 +-- .../field/UserReference/UserReference.tsx | 2 -- .../src/components/helpers/utils.ts | 2 +- .../infra/Assignment/Assignment.tsx | 8 ++---- .../FlowContainer/FlowContainer.tsx | 4 +-- .../infra/DashboardFilter/filterUtils.tsx | 2 -- .../components/infra/DeferLoad/DeferLoad.tsx | 3 +-- .../infra/ErrorBoundary/ErrorBoundary.tsx | 1 - .../components/infra/Reference/Reference.tsx | 4 +-- .../infra/RootContainer/RootContainer.tsx | 2 +- .../components/template/AppShell/AppShell.tsx | 10 +++---- .../components/template/CaseView/CaseView.tsx | 1 - .../template/Confirmation/Confirmation.tsx | 2 +- .../Details/DynamicTabs/DynamicTabs.tsx | 1 - .../FieldGroupTemplate/FieldGroupTemplate.tsx | 4 +-- .../components/template/ListView/ListView.tsx | 3 --- .../src/components/template/ListView/utils.ts | 1 - .../PromotedFilters/PromotedFilters.tsx | 1 - .../SimpleTable/SimpleTable/SimpleTable.tsx | 2 -- .../SimpleTableManual/SimpleTableManual.tsx | 26 ++++++++++++------- .../SimpleTableSelect/SimpleTableSelect.tsx | 6 ++--- .../widget/Attachment/Attachment.tsx | 11 ++------ .../FileUtility/FileUtility/FileUtility.tsx | 3 +-- .../widget/QuickCreate/QuickCreate.tsx | 1 - .../src/samples/FullPortal/index.tsx | 2 +- 33 files changed, 46 insertions(+), 87 deletions(-) diff --git a/package-lock.json b/package-lock.json index 841824e9..77904bb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "@pega/configs": "^0.7.1", "@pega/constellationjs": "~0.242.5", "@pega/eslint-config": "^0.7.2", - "@pega/pcore-pconnect-typedefs": "~3.0.0", + "@pega/pcore-pconnect-typedefs": "^3.2.0-alpha.2", "@pega/tsconfig": "^0.6.0", "@playwright/test": "^1.40.1", "@testing-library/jest-dom": "^5.17.0", @@ -4350,9 +4350,9 @@ } }, "node_modules/@pega/pcore-pconnect-typedefs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@pega/pcore-pconnect-typedefs/-/pcore-pconnect-typedefs-3.0.0.tgz", - "integrity": "sha512-++pN8e3EkeKS8f+IDZ5QxaIHTrka0wPpCHK7czI7ceSbj8xxQXbwm8xzoq6YYInfJsHS5xtsKVbcRei4imOFiw==", + "version": "3.2.0-alpha.2", + "resolved": "https://registry.npmjs.org/@pega/pcore-pconnect-typedefs/-/pcore-pconnect-typedefs-3.2.0-alpha.2.tgz", + "integrity": "sha512-iah6HSS7l9LZTE3TI8vuOeKPEr9PsNhepBOcZJ51FZMN0CIyLoZp//VZuFJpmU2sKWynTdBkQuLgbVSCQAmUAw==", "dev": true }, "node_modules/@pega/prettier-config": { diff --git a/package.json b/package.json index d0078036..dc471e5f 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "@pega/configs": "^0.7.1", "@pega/constellationjs": "~0.242.5", "@pega/eslint-config": "^0.7.2", - "@pega/pcore-pconnect-typedefs": "~3.0.0", + "@pega/pcore-pconnect-typedefs": "^3.2.0-alpha.2", "@pega/tsconfig": "^0.6.0", "@playwright/test": "^1.40.1", "@testing-library/jest-dom": "^5.17.0", diff --git a/packages/react-sdk-components/src/components/field/CancelAlert/CancelAlert.tsx b/packages/react-sdk-components/src/components/field/CancelAlert/CancelAlert.tsx index 02bc1b4d..aadd8f38 100644 --- a/packages/react-sdk-components/src/components/field/CancelAlert/CancelAlert.tsx +++ b/packages/react-sdk-components/src/components/field/CancelAlert/CancelAlert.tsx @@ -58,14 +58,12 @@ export default function CancelAlert(props: CancelAlertProps) { function cancelHandler() { if (isReverseCoexistence) { dismiss(true); - // @ts-ignore - An argument for 'payload' was not provided. PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD); } else if (!isDataObject && !isLocalAction && !isBulkAction) { disableButton(btnIds.DELETE); actionsAPI .deleteCaseInCreateStage(containerItemID, hideDelete) .then(() => { - // @ts-ignore - An argument for 'payload' was not provided. PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL); }) .catch(() => { @@ -78,13 +76,12 @@ export default function CancelAlert(props: CancelAlertProps) { }); } else if (isLocalAction) { dismiss(true); - actionsAPI.cancelAssignment(containerItemID); + actionsAPI.cancelAssignment(containerItemID, false); } else if (isBulkAction) { dismiss(true); actionsAPI.cancelBulkAction(containerItemID); } else { dismiss(true); - // @ts-ignore - Argument of type '{ containerItemID: string; skipReleaseLockRequest: any; }' is not assignable to parameter of type 'ContainerInfo'. containerManagerAPI.removeContainerItem({ containerItemID, skipReleaseLockRequest }); } } diff --git a/packages/react-sdk-components/src/components/field/Currency/Currency.tsx b/packages/react-sdk-components/src/components/field/Currency/Currency.tsx index 027936a9..88117d5e 100644 --- a/packages/react-sdk-components/src/components/field/Currency/Currency.tsx +++ b/packages/react-sdk-components/src/components/field/Currency/Currency.tsx @@ -56,7 +56,7 @@ export default function Currency(props: CurrrencyProps) { const theCurrSep = theSymbols.theDigitGroupSeparator; const theCurrencyOptions = getCurrencyOptions(currencyISOCode); - const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions); + const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions); let readOnlyProp = {}; // Note: empty if NOT ReadOnly diff --git a/packages/react-sdk-components/src/components/field/Decimal/Decimal.tsx b/packages/react-sdk-components/src/components/field/Decimal/Decimal.tsx index b624e534..dfc57230 100644 --- a/packages/react-sdk-components/src/components/field/Decimal/Decimal.tsx +++ b/packages/react-sdk-components/src/components/field/Decimal/Decimal.tsx @@ -68,7 +68,7 @@ export default function Decimal(props: DecimalProps) { if (formatter === 'Currency') { formattedValue = format(value, formatter.toLowerCase(), theCurrencyOptions); } else { - formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions); + formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions); } if (displayMode === 'DISPLAY_ONLY') { diff --git a/packages/react-sdk-components/src/components/field/Dropdown/Dropdown.tsx b/packages/react-sdk-components/src/components/field/Dropdown/Dropdown.tsx index 8cd4e685..a43afddc 100644 --- a/packages/react-sdk-components/src/components/field/Dropdown/Dropdown.tsx +++ b/packages/react-sdk-components/src/components/field/Dropdown/Dropdown.tsx @@ -169,7 +169,6 @@ export default function Dropdown(props: DropdownProps) { return ( ); @@ -179,7 +178,6 @@ export default function Dropdown(props: DropdownProps) { return ( @@ -224,7 +222,6 @@ export default function Dropdown(props: DropdownProps) { > {options.map((option: any) => ( - {/* @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv' */} {thePConn.getLocalizedValue(option.value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))} ))} diff --git a/packages/react-sdk-components/src/components/field/Percentage/Percentage.tsx b/packages/react-sdk-components/src/components/field/Percentage/Percentage.tsx index f5b8d088..64e497c0 100644 --- a/packages/react-sdk-components/src/components/field/Percentage/Percentage.tsx +++ b/packages/react-sdk-components/src/components/field/Percentage/Percentage.tsx @@ -50,7 +50,7 @@ export default function Percentage(props: PercentageProps) { const helperTextToDisplay = validatemessage || helperText; const theCurrencyOptions = getCurrencyOptions(currencyISOCode); - const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions); + const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions); let readOnlyProp = {}; // Note: empty if NOT ReadOnly diff --git a/packages/react-sdk-components/src/components/field/RadioButtons/RadioButtons.tsx b/packages/react-sdk-components/src/components/field/RadioButtons/RadioButtons.tsx index dd865bd9..02db2b0d 100644 --- a/packages/react-sdk-components/src/components/field/RadioButtons/RadioButtons.tsx +++ b/packages/react-sdk-components/src/components/field/RadioButtons/RadioButtons.tsx @@ -65,7 +65,6 @@ export default function RadioButtons(props: RadioButtonsProps) { return ( ); @@ -75,7 +74,6 @@ export default function RadioButtons(props: RadioButtonsProps) { return ( @@ -102,7 +100,6 @@ export default function RadioButtons(props: RadioButtonsProps) { label={thePConn.getLocalizedValue( theOption.value, localePath, - // @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv' thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName) )} control={} diff --git a/packages/react-sdk-components/src/components/field/ScalarList/ScalarList.tsx b/packages/react-sdk-components/src/components/field/ScalarList/ScalarList.tsx index 45146ea9..373cf868 100644 --- a/packages/react-sdk-components/src/components/field/ScalarList/ScalarList.tsx +++ b/packages/react-sdk-components/src/components/field/ScalarList/ScalarList.tsx @@ -36,17 +36,15 @@ export default function ScalarList(props: ScalarListProps) { { type: componentType, config: { - // @ts-ignore - Type '{ readOnly: true; displayInModal: boolean; value: any; displayMode: string; label: string; }' is not assignable to type 'ComponentMetadataConfig'. value: scalarValue, displayMode: 'DISPLAY_ONLY', label, ...restProps, - // @ts-ignore - Type 'string' is not assignable to type 'boolean | undefined'. readOnly: 'true' } }, '', - '', + 0, {} ); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional; }); diff --git a/packages/react-sdk-components/src/components/field/UserReference/UserReference.tsx b/packages/react-sdk-components/src/components/field/UserReference/UserReference.tsx index 9485c9d8..6de284bc 100644 --- a/packages/react-sdk-components/src/components/field/UserReference/UserReference.tsx +++ b/packages/react-sdk-components/src/components/field/UserReference/UserReference.tsx @@ -80,8 +80,6 @@ const UserReference = (props: UserReferenceProps) => { }; PCore.getRestClient() - // @ts-ignore - Argument of type '{ queryPayload: { dataViewName: string; }; }' is not assignable to parameter of type 'RestApiOptionsObject' - // @ts-ignore - Expected 3 arguments, but got 2 .invokeRestApi('getListData', { queryPayload }) .then((res: any) => { const ddDataSource = res.data.data.map(listItem => ({ diff --git a/packages/react-sdk-components/src/components/helpers/utils.ts b/packages/react-sdk-components/src/components/helpers/utils.ts index 516f793a..aa768094 100644 --- a/packages/react-sdk-components/src/components/helpers/utils.ts +++ b/packages/react-sdk-components/src/components/helpers/utils.ts @@ -70,7 +70,7 @@ export class Utils { return arReturn; } - static getInitials(userName: string): string { + static getInitials(userName: string | undefined): string { let userInitials = userName; if (userName && userName !== '') { diff --git a/packages/react-sdk-components/src/components/infra/Assignment/Assignment.tsx b/packages/react-sdk-components/src/components/infra/Assignment/Assignment.tsx index bf79b54c..c017f4af 100644 --- a/packages/react-sdk-components/src/components/infra/Assignment/Assignment.tsx +++ b/packages/react-sdk-components/src/components/infra/Assignment/Assignment.tsx @@ -147,7 +147,7 @@ export default function Assignment(props: PropsWithChildren) { } function onSaveActionSuccess(data) { - actionsAPI.cancelAssignment(itemKey).then(() => { + actionsAPI.cancelAssignment(itemKey, false).then(() => { PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_SAVED, data); }); } @@ -174,7 +174,6 @@ export default function Assignment(props: PropsWithChildren) { savePromise .then(() => { - // @ts-ignore - Property 'c11nEnv' is private and only accessible within class 'CaseInfo'. const caseType = thePConn.getCaseInfo().c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID); onSaveActionSuccess({ caseType, caseID, assignmentID }); }) @@ -189,10 +188,8 @@ export default function Assignment(props: PropsWithChildren) { // check if create stage (modal) const { PUB_SUB_EVENTS } = PCore.getConstants(); const { publish } = PCore.getPubSubUtils(); - // @ts-ignore - Property 'isAssignmentInCreateStage' is private and only accessible within class 'CaseInfo' const isAssignmentInCreateStage = thePConn.getCaseInfo().isAssignmentInCreateStage(); const isLocalAction = - // @ts-ignore - Property 'isLocalAction' is private and only accessible within class 'CaseInfo'. thePConn.getCaseInfo().isLocalAction() || (PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION && getPConnect().getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION)); if (isAssignmentInCreateStage && isInModal && !isLocalAction) { @@ -206,7 +203,7 @@ export default function Assignment(props: PropsWithChildren) { showToast(`${localizedVal('Cancel failed!', localeCategory)}`); }); } else { - const cancelPromise = cancelAssignment(itemKey); + const cancelPromise = cancelAssignment(itemKey, false); cancelPromise .then(data => { @@ -275,7 +272,6 @@ export default function Assignment(props: PropsWithChildren) { } // expected format of refreshConditions : [{field: ".Name", event: "Changes"}] - // @ts-ignore - Property 'getActionRefreshConditions' is private and only accessible within class 'CaseInfo' const refreshConditions = thePConn.getCaseInfo()?.getActionRefreshConditions(); const context = thePConn.getContextName(); const pageReference = thePConn.getPageReference(); diff --git a/packages/react-sdk-components/src/components/infra/Containers/FlowContainer/FlowContainer.tsx b/packages/react-sdk-components/src/components/infra/Containers/FlowContainer/FlowContainer.tsx index 5ec28857..be6378b8 100644 --- a/packages/react-sdk-components/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +++ b/packages/react-sdk-components/src/components/infra/Containers/FlowContainer/FlowContainer.tsx @@ -153,8 +153,7 @@ export const FlowContainer = (props: FlowContainerProps) => { }, []); useEffect(() => { - // @ts-ignore - Property 'getMetadata' is private and only accessible within class 'C11nEnv' - if (isInitialized && pConnectOfFlowContainer.getMetadata().children && !hasItems) { + if (isInitialized && pConnectOfFlowContainer.getMetadata()?.children && !hasItems) { // ensuring not to add container items, if container already has items // because during multi doc mode, we will have container items already in store addContainerItem(pConnectOfFlowContainer); @@ -274,7 +273,6 @@ export const FlowContainer = (props: FlowContainerProps) => { setShowConfirm(true); // publish this "assignmentFinished" for mashup, need to get approved as a standard - // @ts-ignore - second parameter “payload” for publish method should be optional PCore.getPubSubUtils().publish('assignmentFinished'); // debugger; diff --git a/packages/react-sdk-components/src/components/infra/DashboardFilter/filterUtils.tsx b/packages/react-sdk-components/src/components/infra/DashboardFilter/filterUtils.tsx index 25ded5a3..87fc2d40 100644 --- a/packages/react-sdk-components/src/components/infra/DashboardFilter/filterUtils.tsx +++ b/packages/react-sdk-components/src/components/infra/DashboardFilter/filterUtils.tsx @@ -46,7 +46,6 @@ export const createFilterComponent = (getPConnect, filterMeta, index) => { } let propInfo: any = PCore.getMetadataUtils().getPropertyMetadata(cleanedName, filterMeta.config.ruleClass); if (!propInfo) { - // @ts-ignore - PCore.getMetadataUtils().getPropertyMetadata - An argument for 'currentClassID' was not provided. propInfo = PCore.getMetadataUtils().getPropertyMetadata(cleanedName); } const { type: propertyType } = propInfo || { type: 'Text' }; @@ -82,7 +81,6 @@ export const buildFilterComponents = (getPConnect, allFilters) => { { - // @ts-ignore - second parameter “payload” for publish method should be optional PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CLEAR_ALL); }} underline='hover' diff --git a/packages/react-sdk-components/src/components/infra/DeferLoad/DeferLoad.tsx b/packages/react-sdk-components/src/components/infra/DeferLoad/DeferLoad.tsx index db6865e4..7e8edf34 100644 --- a/packages/react-sdk-components/src/components/infra/DeferLoad/DeferLoad.tsx +++ b/packages/react-sdk-components/src/components/infra/DeferLoad/DeferLoad.tsx @@ -113,7 +113,6 @@ export default function DeferLoad(props: DeferLoadProps) { getPConnect() .getActionsApi() .showData(name, dataContext, dataContextParameters, { - // @ts-ignore - Type 'boolean' is not assignable to type 'string' skipSemanticUrl: true, // @ts-ignore isDeferLoaded: true @@ -129,7 +128,7 @@ export default function DeferLoad(props: DeferLoadProps) { // Rendering defer loaded tabs in case/ page context getPConnect() .getActionsApi() - .loadView(encodeURI(loadViewCaseID), name, getViewOptions()) + .loadView(encodeURI(loadViewCaseID), name, getViewOptions() as any) .then(data => { onResponse(data); }); diff --git a/packages/react-sdk-components/src/components/infra/ErrorBoundary/ErrorBoundary.tsx b/packages/react-sdk-components/src/components/infra/ErrorBoundary/ErrorBoundary.tsx index 00c028d3..1954cfbb 100644 --- a/packages/react-sdk-components/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +++ b/packages/react-sdk-components/src/components/infra/ErrorBoundary/ErrorBoundary.tsx @@ -37,7 +37,6 @@ export default function ErrorBoundary(props: ErrorBoundaryProps) { if (pConn.getContainerName() === WORK_AREA || pConn.isInsideList() === true || pConn.getContainerName() === 'modal') { const { publish } = PCore.getPubSubUtils(); - // @ts-ignore - second parameter “payload” for publish method should be optional publish(ERROR_WHILE_RENDERING); return null; } diff --git a/packages/react-sdk-components/src/components/infra/Reference/Reference.tsx b/packages/react-sdk-components/src/components/infra/Reference/Reference.tsx index c05b3f91..95a59be0 100644 --- a/packages/react-sdk-components/src/components/infra/Reference/Reference.tsx +++ b/packages/react-sdk-components/src/components/infra/Reference/Reference.tsx @@ -12,7 +12,6 @@ export default function Reference(props: ReferenceProps) { const { visibility = true, context = '', getPConnect, readOnly = false, displayMode = '' } = props; const pConnect = getPConnect(); - // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'. const referenceConfig = { ...pConnect.getComponentConfig() } || {}; delete referenceConfig?.name; @@ -34,8 +33,7 @@ export default function Reference(props: ReferenceProps) { } }; - // @ts-ignore - Argument of type 'null' is not assignable to parameter of type 'string'. - const viewComponent: any = pConnect.createComponent(viewObject, null, null, { + const viewComponent: any = pConnect.createComponent(viewObject, '', 0, { pageReference: context && context.startsWith('@CLASS') ? '' : context }); diff --git a/packages/react-sdk-components/src/components/infra/RootContainer/RootContainer.tsx b/packages/react-sdk-components/src/components/infra/RootContainer/RootContainer.tsx index 1d2cc80c..b1776710 100644 --- a/packages/react-sdk-components/src/components/infra/RootContainer/RootContainer.tsx +++ b/packages/react-sdk-components/src/components/infra/RootContainer/RootContainer.tsx @@ -164,7 +164,7 @@ export default function RootContainer(props: PropsWithChildren{banners}; diff --git a/packages/react-sdk-components/src/components/template/AppShell/AppShell.tsx b/packages/react-sdk-components/src/components/template/AppShell/AppShell.tsx index 3da78191..e742922b 100644 --- a/packages/react-sdk-components/src/components/template/AppShell/AppShell.tsx +++ b/packages/react-sdk-components/src/components/template/AppShell/AppShell.tsx @@ -75,7 +75,7 @@ export default function AppShell(props: PropsWithChildren) { const imageKey = envInfo.getOperatorImageInsKey(); const userName = envInfo.getOperatorName(); const currentUserInitials = Utils.getInitials(userName); - const appNameToDisplay = showAppName ? envInfo.getApplicationLabel() : ''; + const appNameToDisplay: any = showAppName ? envInfo.getApplicationLabel() : ''; const portalClass = pConn.getValue('.classID', ''); // 2nd arg empty string until typedef marked correctly const envPortalName = envInfo.getPortalName(); const localizedVal = PCore.getLocaleUtils().getLocaleValue; @@ -86,7 +86,7 @@ export default function AppShell(props: PropsWithChildren) { const [imageBlobUrl, setImageBlobUrl] = useState(null); // useState for appName and mapChildren - note these are ONLY updated once (on component mount!) // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [appName, setAppName] = useState(''); + const [appName, setAppName] = useState(''); // eslint-disable-next-line @typescript-eslint/no-unused-vars const [mapChildren, setMapChildren] = useState([]); @@ -117,7 +117,7 @@ export default function AppShell(props: PropsWithChildren) { }, []); useEffect(() => { - // @ts-ignore + // @ts-ignore Property 'pyCaseTypesAvailableToCreateDP' does not exist on type ... const caseTypesAvailableToCreateDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP; if (caseTypesAvailableToCreateDP) { const portalID = pConn.getValue('.pyOwner'); @@ -126,8 +126,8 @@ export default function AppShell(props: PropsWithChildren) { PortalName: portalID }) .then(response => { - if (response?.pyCaseTypesAvailableToCreate) { - pConn.replaceState('.pyCaseTypesAvailableToCreate', response.pyCaseTypesAvailableToCreate, { + if ((response as any)?.pyCaseTypesAvailableToCreate) { + pConn.replaceState('.pyCaseTypesAvailableToCreate', (response as any).pyCaseTypesAvailableToCreate, { skipDirtyValidation: true }); } diff --git a/packages/react-sdk-components/src/components/template/CaseView/CaseView.tsx b/packages/react-sdk-components/src/components/template/CaseView/CaseView.tsx index e5db578f..e52fcea6 100644 --- a/packages/react-sdk-components/src/components/template/CaseView/CaseView.tsx +++ b/packages/react-sdk-components/src/components/template/CaseView/CaseView.tsx @@ -169,7 +169,6 @@ export default function CaseView(props: PropsWithChildren) { useEffect(() => { if (hasNewAttachments) { - // @ts-ignore - Argument of type 'boolean' is not assignable to parameter of type 'object' PCore.getPubSubUtils().publish((PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true); } }, [hasNewAttachments]); diff --git a/packages/react-sdk-components/src/components/template/Confirmation/Confirmation.tsx b/packages/react-sdk-components/src/components/template/Confirmation/Confirmation.tsx index b54196b5..ce4a57eb 100644 --- a/packages/react-sdk-components/src/components/template/Confirmation/Confirmation.tsx +++ b/packages/react-sdk-components/src/components/template/Confirmation/Confirmation.tsx @@ -41,7 +41,7 @@ export default function Confirmation(props: PropsWithChildren // Not using whatsNext at the moment, need to figure out the use of it // const whatsNext = datasource?.source; // const items = whatsNext.length > 0 ? whatsNext.map(item => item.label) : ''; - const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget()); + const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(getPConnect().getTarget() as any); const rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), activeContainerItemID); const onConfirmViewClose = () => { setShowConfirmView(false); diff --git a/packages/react-sdk-components/src/components/template/Details/DynamicTabs/DynamicTabs.tsx b/packages/react-sdk-components/src/components/template/Details/DynamicTabs/DynamicTabs.tsx index 14d45175..a4e2f2e8 100644 --- a/packages/react-sdk-components/src/components/template/Details/DynamicTabs/DynamicTabs.tsx +++ b/packages/react-sdk-components/src/components/template/Details/DynamicTabs/DynamicTabs.tsx @@ -26,7 +26,6 @@ function DynamicTabs(props: DynamicTabsProps) { // Get the inherited props from the parent to determine label settings const propsToUse = { label, showLabel, ...pConnect.getInheritedProps() }; const defaultTabIndex = 0; - // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'. const { tablabel } = pConnect.getComponentConfig(); const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel); const referenceListData: any = pConnect.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional diff --git a/packages/react-sdk-components/src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx b/packages/react-sdk-components/src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx index d191632a..29d79fba 100644 --- a/packages/react-sdk-components/src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx +++ b/packages/react-sdk-components/src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx @@ -42,7 +42,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) { useLayoutEffect(() => { if (!isReadonlyMode) { - // @ts-ignore - Expected 3 arguments, but got 1 + // @ts-ignore - Expected 2-3 arguments, but got 1 pConn.getListActions().initDefaultPageInstructions(resolvedList); } }, [referenceList?.length]); @@ -58,7 +58,6 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) { if (PCore.getPCoreVersion()?.includes('8.7')) { pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference); } else { - // @ts-ignore - An argument for 'pageRef' was not provided. pConn.getListActions().insert({}, referenceList.length); } }; @@ -71,7 +70,6 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) { if (PCore.getPCoreVersion()?.includes('8.7')) { pConn.getListActions().deleteEntry(index, pageReference); } else { - // @ts-ignore - An argument for 'pageRef' was not provided. pConn.getListActions().deleteEntry(index); } }; diff --git a/packages/react-sdk-components/src/components/template/ListView/ListView.tsx b/packages/react-sdk-components/src/components/template/ListView/ListView.tsx index 3cae5147..c1f23311 100644 --- a/packages/react-sdk-components/src/components/template/ListView/ListView.tsx +++ b/packages/react-sdk-components/src/components/template/ListView/ListView.tsx @@ -109,7 +109,6 @@ export default function ListView(props: ListViewProps) { }); const thePConn = getPConnect(); - // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'. const componentConfig = thePConn.getComponentConfig(); const resolvedConfigProps: any = thePConn.getConfigProps() as ListViewProps; @@ -642,7 +641,6 @@ export default function ListView(props: ListViewProps) { thePConn .getActionsApi() - // @ts-ignore .openAssignment(pzInsKey, pxRefObjectClass, options) .then(() => { // console.log("openAssignment successful"); @@ -875,7 +873,6 @@ export default function ListView(props: ListViewProps) { pzInsKey = row[`${associationCategory}:pzInsKey`]; } if (column.isAssignmentLink) { - // @ts-ignore thePConn.getActionsApi().openAssignment(pzInsKey, pxObjClass, { containerName: 'primary', channelName: '' diff --git a/packages/react-sdk-components/src/components/template/ListView/utils.ts b/packages/react-sdk-components/src/components/template/ListView/utils.ts index 05dc452c..709defa1 100644 --- a/packages/react-sdk-components/src/components/template/ListView/utils.ts +++ b/packages/react-sdk-components/src/components/template/ListView/utils.ts @@ -202,7 +202,6 @@ export function getConfigEmbeddedFieldsMeta(configFields, classID) { if (value.includes('[')) { value = value.substring(0, value.indexOf('[')) + value.substring(value.indexOf(']') + 1); } - // @ts-ignore - Expected 3 arguments, but got 2. const meta: any = PCore.getMetadataUtils().getEmbeddedPropertyMetadata(value, classID); meta.fieldID = field; configEmbeddedFieldsMeta.push(meta); diff --git a/packages/react-sdk-components/src/components/template/PromotedFilters/PromotedFilters.tsx b/packages/react-sdk-components/src/components/template/PromotedFilters/PromotedFilters.tsx index 059b1325..4aaa9f8c 100644 --- a/packages/react-sdk-components/src/components/template/PromotedFilters/PromotedFilters.tsx +++ b/packages/react-sdk-components/src/components/template/PromotedFilters/PromotedFilters.tsx @@ -87,7 +87,6 @@ export default function PromotedFilters(props: PromotedFilterProps) { }; return getPConnect().getContainerManager().addTransientItem({ id: viewName, - // @ts-ignore - Property 'coreHeaders' is missing in type '{ classID: string; }' but required in type '{ coreHeaders: any; }'. data: filtersWithClassID }); }, []); diff --git a/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTable/SimpleTable.tsx b/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTable/SimpleTable.tsx index ccea3033..a68b717f 100644 --- a/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTable/SimpleTable.tsx +++ b/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTable/SimpleTable.tsx @@ -50,11 +50,9 @@ export default function SimpleTable(props: SimpleTableProps) { let { contextClass } = props; if (!contextClass) { - // @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'. let listName = getPConnect().getComponentConfig().referenceList; listName = PCore.getAnnotationUtils().getPropertyName(listName); // was... contextClass = getPConnect().getFieldMetadata(listName)?.pageClass; - // @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'. const theFieldMetadata = getPConnect().getFieldMetadata(listName); if (theFieldMetadata) { contextClass = theFieldMetadata.pageClass; diff --git a/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx b/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx index a9cde864..45d36f76 100644 --- a/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +++ b/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx @@ -1,5 +1,6 @@ /* eslint-disable no-nested-ternary */ import React, { PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react'; +import { createElement } from 'react'; import Table from '@mui/material/Table'; import TableBody from '@mui/material/TableBody'; import TableCell from '@mui/material/TableCell'; @@ -9,7 +10,6 @@ import TableRow from '@mui/material/TableRow'; import Paper from '@mui/material/Paper'; import makeStyles from '@mui/styles/makeStyles'; import Link from '@mui/material/Link'; -import { createElement } from 'react'; import TableSortLabel from '@mui/material/TableSortLabel'; import MoreIcon from '@mui/icons-material/MoreVert'; import Menu from '@mui/material/Menu'; @@ -52,6 +52,7 @@ interface SimpleTableManualProps extends PConnProps { displayMode?: string; useSeparateViewForEdit: any; viewForEditModal: any; + targetClassLabel: string; } const useStyles = makeStyles((/* theme */) => ({ @@ -110,7 +111,8 @@ export default function SimpleTableManual(props: PropsWithChildren item.name).map(item => item.name) ); } else { - // @ts-ignore - An argument for 'fields' was not provided + // @ts-ignore Expected 2-3 arguments, but got 1 getPConnect().getListActions().initDefaultPageInstructions(getPConnect().getReferenceList()); } }, []); @@ -301,9 +302,15 @@ export default function SimpleTableManual(props: PropsWithChildren { setEditAnchorEl(null); - // @ts-ignore - An argument for 'pageRef' was not provided. pConn.getListActions().deleteEntry(selectedRowIndex.current); }; const deleteRecordFromInlineEditable = (index: number) => { - // @ts-ignore - An argument for 'pageRef' was not provided. pConn.getListActions().deleteEntry(index); }; diff --git a/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx b/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx index 859d3039..3da32fd3 100644 --- a/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +++ b/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx @@ -57,10 +57,8 @@ export default function SimpleTableSelect(props: SimpleTableSelectProps) { // Need to get this written so typedefs work const { datasource: { parameters: fieldParameters = {} } = {}, pageClass } = isMultiSelectMode - ? // @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'. - pConn.getFieldMetadata(`@P .${referenceProp}`) - : // @ts-ignore - Property 'getCurrentPageFieldMetadata' is private and only accessible within class 'C11nEnv'. - pConn.getCurrentPageFieldMetadata(contextPageReference); + ? pConn.getFieldMetadata(`@P .${referenceProp}`) + : pConn.getCurrentPageFieldMetadata(contextPageReference); const compositeKeys: any[] = []; Object.values(fieldParameters).forEach((param: any) => { diff --git a/packages/react-sdk-components/src/components/widget/Attachment/Attachment.tsx b/packages/react-sdk-components/src/components/widget/Attachment/Attachment.tsx index 1db878bc..ff165285 100644 --- a/packages/react-sdk-components/src/components/widget/Attachment/Attachment.tsx +++ b/packages/react-sdk-components/src/components/widget/Attachment/Attachment.tsx @@ -74,8 +74,7 @@ export default function Attachment(props: AttachmentProps) { const downloadFile = (fileObj: any) => { setAnchorEl(null); PCore.getAttachmentUtils() - // @ts-ignore - 3rd parameter "responseEncoding" should be optional - .downloadAttachment(fileObj.pzInsKey, pConn.getContextName()) + .downloadAttachment(fileObj.pzInsKey, pConn.getContextName(), '') .then((content: any) => { const extension = fileObj.pyAttachName.split('.').pop(); fileDownload(content.data, fileObj.pyFileName, extension); @@ -120,8 +119,7 @@ export default function Attachment(props: AttachmentProps) { }); updateAttachmentState(pConn, getAttachmentKey(valueRef), [...currentAttachmentList, ...attachmentsList]); if (file.inProgress) { - // @ts-ignore - 3rd parameter "responseEncoding" should be optional - PCore.getAttachmentUtils().cancelRequest(file.ID, pConn.getContextName()); + PCore.getAttachmentUtils().cancelRequest(file.ID); } } @@ -155,11 +153,9 @@ export default function Attachment(props: AttachmentProps) { const context = pConn.getContextName(); // set errors to property to block submit even on errors in file upload PCore.getMessageManager().addMessages({ - // @ts-ignore messages: [ { type: 'error', - // @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'. message: pConn.getLocalizedValue('Error with one or more files', '', '') } ], @@ -192,7 +188,6 @@ export default function Attachment(props: AttachmentProps) { const clearFieldErrorMessages = () => { const fieldName = (pConn.getStateProps() as any).value; const context = pConn.getContextName(); - // @ts-ignore PCore.getMessageManager().clearMessages({ type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR, property: fieldName, @@ -231,11 +226,9 @@ export default function Attachment(props: AttachmentProps) { const fieldName = (pConn.getStateProps() as any).value; const context = pConn.getContextName(); PCore.getMessageManager().addMessages({ - // @ts-ignore messages: [ { type: 'error', - // @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'. message: pConn.getLocalizedValue('Error with one or more files', '', '') } ], diff --git a/packages/react-sdk-components/src/components/widget/FileUtility/FileUtility/FileUtility.tsx b/packages/react-sdk-components/src/components/widget/FileUtility/FileUtility/FileUtility.tsx index a1a3f386..36bfb17f 100644 --- a/packages/react-sdk-components/src/components/widget/FileUtility/FileUtility/FileUtility.tsx +++ b/packages/react-sdk-components/src/components/widget/FileUtility/FileUtility/FileUtility.tsx @@ -179,8 +179,7 @@ export default function FileUtility(props: FileUtilityProps) { const context = thePConn.getContextName(); attachUtils - // @ts-ignore - 3rd parameter "responseEncoding" is optional - .downloadAttachment(ID, context) + .downloadAttachment(ID, context, '') .then((content: any) => { if (type === 'FILE') { fileDownload(content.data, name, extension); diff --git a/packages/react-sdk-components/src/components/widget/QuickCreate/QuickCreate.tsx b/packages/react-sdk-components/src/components/widget/QuickCreate/QuickCreate.tsx index d6e1a80d..e08e1d91 100644 --- a/packages/react-sdk-components/src/components/widget/QuickCreate/QuickCreate.tsx +++ b/packages/react-sdk-components/src/components/widget/QuickCreate/QuickCreate.tsx @@ -35,7 +35,6 @@ export default function QuickCreate(props: QuickCreateProps) { const defaultCases: any = []; const envInfo = PCore.getEnvironmentInfo(); if (envInfo?.environmentInfoObject?.pyCaseTypeList) { - // @ts-ignore - Property 'forEach' does not exist on type 'string' envInfo.environmentInfoObject.pyCaseTypeList.forEach(casetype => { if (casetype.pyWorkTypeName && casetype.pyWorkTypeImplementationClassName) { defaultCases.push({ diff --git a/packages/react-sdk-components/src/samples/FullPortal/index.tsx b/packages/react-sdk-components/src/samples/FullPortal/index.tsx index 9bcadd96..40338bfa 100644 --- a/packages/react-sdk-components/src/samples/FullPortal/index.tsx +++ b/packages/react-sdk-components/src/samples/FullPortal/index.tsx @@ -26,7 +26,7 @@ function useQuery() { export default function FullPortal() { const [portalSelectionScreen, setPortalSelectionScreen] = useState(false); - const [defaultPortalName, setDefaultPortalName] = useState(''); + const [defaultPortalName, setDefaultPortalName] = useState(''); const [availablePortals, setAvailablePortals] = useState([]); const navigate = useNavigate();