Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,240 changes: 2,294 additions & 3,946 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
},
"devDependencies": {
"@pega/configs": "^0.7.1",
"@pega/constellationjs": "~0.242.5",
"@pega/constellationjs": "~24.2.1",
"@pega/eslint-config": "^0.7.2",
"@pega/pcore-pconnect-typedefs": "~3.2.1",
"@pega/pcore-pconnect-typedefs": "~3.2.2",
"@pega/tsconfig": "^0.6.0",
"@playwright/test": "^1.52.0",
"@testing-library/jest-dom": "^5.17.0",
Expand Down
5 changes: 0 additions & 5 deletions packages/react-sdk-components/src/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
// 3) Awaits a message from the host page and when received immediately postMessages back with the code

// For enabling logging via debugger (do not let it be a const...then can't change in debugger)
// eslint-disable-next-line prefer-const
let bDebug = false;

const queryString = window.location.search;
Expand All @@ -20,14 +19,12 @@
const error = urlParams.get('error');
const errorDesc = urlParams.get('error_description');
// Silent authentication will work with just regular console.log
// eslint-disable-next-line no-console
let fnLog = console.log;
try {
// Check if in a popup window. If so use main window console.
if (window.opener.console.log) {
fnLog = window.opener.console.log;
}
// eslint-disable-next-line no-empty
} catch (e0) {}
const doLog = arg => {
if (bDebug) {
Expand All @@ -44,15 +41,13 @@
if (state) {
embedOrigin = window.atob(state.split('.')[0]);
}
// eslint-disable-next-line no-empty
} catch (e) {}
if (!embedOrigin) {
embedOrigin = window.location.origin;
}
return embedOrigin;
};

// eslint-disable-next-line sonarjs/cognitive-complexity
function main() {
if (code || error) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -84,7 +82,6 @@ export default function CancelAlert(props: CancelAlertProps) {
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 });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export default function Dropdown(props: DropdownProps) {
return (
<FieldValueList
name={hideLabel ? '' : label}
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
/>
);
Expand All @@ -179,7 +178,6 @@ export default function Dropdown(props: DropdownProps) {
return (
<FieldValueList
name={hideLabel ? '' : label}
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
variant='stacked'
/>
Expand Down Expand Up @@ -224,7 +222,6 @@ export default function Dropdown(props: DropdownProps) {
>
{options.map((option: any) => (
<MenuItem key={option.key} value={option.key}>
{/* @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv' */}
{thePConn.getLocalizedValue(option.value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
</MenuItem>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export default function RadioButtons(props: RadioButtonsProps) {
return (
<FieldValueList
name={hideLabel ? '' : label}
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
/>
);
Expand All @@ -75,7 +74,6 @@ export default function RadioButtons(props: RadioButtonsProps) {
return (
<FieldValueList
name={hideLabel ? '' : label}
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
variant='stacked'
/>
Expand All @@ -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={<Radio key={theOption.key} color='primary' disabled={readOnly} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ 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'
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@ 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) => {
.then(res => {
const ddDataSource = res.data.data.map(listItem => ({
key: listItem.pyUserIdentifier,
value: listItem.pyUserName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {

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 });
})
Expand All @@ -189,10 +188,8 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
// 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) {
Expand Down Expand Up @@ -275,7 +272,6 @@ export default function Assignment(props: PropsWithChildren<AssignmentProps>) {
}

// 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
if (caseViewMode && caseViewMode === 'review') {
return true;
}
// eslint-disable-next-line sonarjs/prefer-single-boolean-return
if (caseViewMode && caseViewMode === 'perform') {
return false;
}

return true;
return !(caseViewMode && caseViewMode === 'perform');
}

function initComponent() {
Expand Down Expand Up @@ -181,11 +176,7 @@ export const FlowContainer = (props: FlowContainerProps) => {

const childCases = ourPConn.getValue(pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS, ''); // 2nd arg empty string until typedefs properly allow optional
// const allAssignments = [];
// eslint-disable-next-line sonarjs/prefer-single-boolean-return
if (childCases && childCases.length > 0) {
return true;
}
return false;
return !!(childCases && childCases.length > 0);
}

function hasAssignments() {
Expand Down Expand Up @@ -276,7 +267,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@ export const hasAssignments = pConnect => {
const assignments = pConnect.getValue(CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
const childCasesAssignments = getChildCaseAssignments(pConnect);

// eslint-disable-next-line sonarjs/prefer-single-boolean-return
if (assignments || childCasesAssignments || isCaseWideLocalAction(pConnect)) {
return true;
}
return false;
return !!(assignments || childCasesAssignments || isCaseWideLocalAction(pConnect));
};

export const showBanner = getPConnect => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-shadow */
/* eslint-disable operator-assignment */
import { forwardRef, PropsWithChildren, useEffect, useRef, useState } from 'react';
import { TextField } from '@mui/material';
import { v4 as uuidv4 } from 'uuid';
Expand Down Expand Up @@ -35,7 +34,7 @@ export default function DashboardFilter(props: PropsWithChildren<DashboardFilter
} else if (type === 'RadioButtons') {
const reference = getPConnect().getFullReference() + filterProp;
const radList = document.getElementsByName(reference);
for (let i = 0; i < radList.length; i = i + 1) {
for (let i = 0; i < radList.length; i += 1) {
if ((radList[i] as HTMLInputElement).value === '') {
(radList[i] as HTMLInputElement).checked = true;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' };
Expand Down Expand Up @@ -82,7 +81,6 @@ export const buildFilterComponents = (getPConnect, allFilters) => {
<Link
style={{ cursor: 'pointer' }}
onClick={() => {
// @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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,7 @@ export default function MultiStep(props: PropsWithChildren<MultiStepProps>) {
}

function _showHLine(index: number): boolean {
// eslint-disable-next-line sonarjs/prefer-single-boolean-return
if (index < arNavigationSteps.length - 1) {
return true;
}

return false;
return index < arNavigationSteps.length - 1;
}

function buttonPress(sAction: string, sButtonType: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default function RootContainer(props: PropsWithChildren<RootContainerProp
}
};

if (prevRootConfig && !PCore.isDeepEqual(currentRootConfig, prevRootConfig)) {
if (prevRootConfig === null || !PCore.isDeepEqual(currentRootConfig, prevRootConfig)) {
rootView.current = createElement(createPConnectComponent(), PCore.createPConnect(currentRootConfig)) as any;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export default function CaseView(props: PropsWithChildren<CaseViewProps>) {

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]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand All @@ -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);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -642,7 +641,6 @@ export default function ListView(props: ListViewProps) {

thePConn
.getActionsApi()
// @ts-ignore
.openAssignment(pzInsKey, pxRefObjectClass, options)
.then(() => {
// console.log("openAssignment successful");
Expand Down Expand Up @@ -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: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
if (allowEditingInModal) {
getPConnect()
.getListActions()
// @ts-ignore - An argument for 'uniqueField' was not provided.
.initDefaultPageInstructions(
getPConnect().getReferenceList(),
fieldDefs.filter(item => item.name).map(item => item.name)
Expand Down Expand Up @@ -326,7 +325,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
// @ts-ignore
.openEmbeddedDataModal(defaultView, pConn, referenceListStr, referenceList.length, PCore.getConstants().RESOURCE_STATUS.CREATE);
} else {
// @ts-ignore - An argument for 'pageRef' was not provided.
pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
}

Expand All @@ -353,12 +351,10 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa

const deleteRecord = () => {
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);
};

Expand Down
Loading