Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeDefs upgraded to 3.0.0 version #195

Merged
merged 2 commits into from
Jul 24, 2024
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
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"@pega/configs": "^0.7.1",
"@pega/constellationjs": "24.1.1-dev",
"@pega/eslint-config": "^0.7.1",
"@pega/pcore-pconnect-typedefs": "~2.1.1",
"@pega/pcore-pconnect-typedefs": "~3.0.0",
"@pega/prettier-config": "^0.7.1",
"@playwright/test": "^1.40.1",
"@types/jasmine": "~5.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export class CancelAlertComponent implements OnChanges {
this.psService.sendMessage(false);
this.dismissAlert();

// @ts-ignore - second parameter “payload” for publish method should be optional
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED);
})
.catch(() => {
Expand All @@ -92,7 +91,6 @@ export class CancelAlertComponent implements OnChanges {
.then(() => {
this.psService.sendMessage(false);
this.dismissAlert();
// @ts-ignore - second parameter “payload” for publish method should be optional
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
})
.catch(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export class DropdownComponent implements OnInit, OnDestroy {

this.componentReference = (this.pConn$.getStateProps() as any).value;

// @ts-ignore - parameter “contextName” for getDataObject method should be optional
const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())];
optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
this.options$ = optionsList;
Expand All @@ -184,7 +183,6 @@ export class DropdownComponent implements OnInit, OnDestroy {
this.localizedValue = this.pConn$.getLocalizedValue(
this.value$,
this.localePath,
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'.
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
);
// trigger display of error message with field control
Expand Down Expand Up @@ -223,7 +221,6 @@ export class DropdownComponent implements OnInit, OnDestroy {
return this.pConn$.getLocalizedValue(
opt.value,
this.localePath,
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'.
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {

this.componentReference = (this.pConn$.getStateProps() as any).value;

// @ts-ignore - parameter “contextName” for getDataObject method should be optional
this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject());

const propName = (this.pConn$.getStateProps() as any).value;
Expand All @@ -186,7 +185,6 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {
this.localizedValue = this.pConn$.getLocalizedValue(
this.value$,
this.localePath,
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
);
// trigger display of error message with field control
Expand Down Expand Up @@ -217,7 +215,6 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {
return this.pConn$.getLocalizedValue(
opt.value,
this.localePath,
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ export class ScalarListComponent implements OnInit, OnDestroy {
{
type: componentType,
config: {
// @ts-ignore - Object literal may only specify known properties, and 'value' does not exist in type 'ComponentMetadataConfig'.
value: scalarValue,
displayMode: 'LABELS_LEFT',
label: this.label$,
...restProps,
readOnly: 'true'
readOnly: true
}
},
'',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ export class TextAreaComponent implements OnInit, OnDestroy {
if (this.configProps$.value != undefined) {
this.value$ = this.configProps$.value;
}
// @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'.
// @ts-ignore - Property 'getRawConfigProps' is private and only accessible within class 'C11nEnv'
this.nMaxLength$ = this.pConn$.getFieldMetadata(this.pConn$.getRawConfigProps()?.value)?.maxLength || 100;
this.testId = this.configProps$.testId;
this.displayMode$ = this.configProps$.displayMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
}

getTodoVisibilty() {
// @ts-ignore - second parameter pageReference for getValue method should be optional
const caseViewMode = this.pConn$.getValue('context_data.caseViewMode');
if (caseViewMode && caseViewMode === 'review') {
const kid = this.pConn$.getChildren()[0];
Expand Down Expand Up @@ -273,7 +272,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {

hasAssignments() {
let hasAssignments = false;
// @ts-ignore - second parameter pageReference for getValue method should be optional
const assignmentsList: any[] = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
// const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
// 8.7 includes assignments in Assignments List that may be assigned to
Expand Down Expand Up @@ -308,9 +306,7 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
}

isCaseWideLocalAction() {
// @ts-ignore - second parameter pageReference for getValue method should be optional
const actionID = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID);
// @ts-ignore - second parameter pageReference for getValue method should be optional
const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS) as any[];
let bCaseWideAction = false;
if (caseActions && actionID) {
Expand All @@ -323,7 +319,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
}

hasChildCaseAssignments() {
// @ts-ignore - second parameter pageReference for getValue method should be optional
const childCases = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS);

return childCases && childCases.length > 0;
Expand All @@ -334,9 +329,7 @@ export class FlowContainerComponent implements OnInit, OnDestroy {

const { CASE_INFO: CASE_CONSTS } = PCore.getConstants();

// @ts-ignore - second parameter pageReference for getValue method should be optional
const caseActions = this.pConn$.getValue(CASE_CONSTS.CASE_INFO_ACTIONS) as any[];
// @ts-ignore - second parameter pageReference for getValue method should be optional
const activeActionID = this.pConn$.getValue(CASE_CONSTS.ACTIVE_ACTION_ID);
const activeAction = caseActions?.find(action => action.ID === activeActionID);
if (activeAction) {
Expand Down Expand Up @@ -376,7 +369,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
// const { getPConnect } = this.arChildren$[0].getPConnect();
const localPConn = this.arChildren$[0].getPConnect();

// @ts-ignore - second parameter pageReference for getValue method should be optional
const caseViewMode = this.pConn$.getValue('context_data.caseViewMode');
this.bShowBanner = showBanner(this.pConn$);

Expand Down Expand Up @@ -430,7 +422,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
const todoAssignments = getToDoAssignments(this.pConn$);

if (todoAssignments && todoAssignments.length > 0) {
// @ts-ignore - second parameter pageReference for getValue method should be optional
this.todo_caseInfoID$ = this.pConn$.getValue(CASE_CONSTS.CASE_INFO_ID);
this.todo_datasource$ = { source: todoAssignments };
}
Expand Down Expand Up @@ -458,7 +449,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
}

showCaseMessages() {
// @ts-ignore - second parameter pageReference for getValue method should be optional
this.caseMessages$ = this.localizedVal(this.pConn$.getValue('caseMessages'), this.localeCategory);
if (this.caseMessages$ || !this.hasAssignments()) {
this.bHasCaseMessages$ = true;
Expand All @@ -471,7 +461,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
}

// 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');

this.psService.sendMessage(false);
Expand Down Expand Up @@ -571,7 +560,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
this.psService.sendMessage(false);

const oWorkItem = configObject.getPConnect();
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
const oWorkData: any = oWorkItem.getDataObject();

this.containerName$ = this.localizedVal(this.getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0].name, undefined, this.localeReference);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
const configObject = this.getConfigObject(currentItem, this.pConn$);
const newComp = configObject?.getPConnect();
// const newCompName = newComp.getComponentName();
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
const caseInfo = newComp && newComp.getDataObject() && newComp.getDataObject().caseInfo ? newComp.getDataObject().caseInfo : null;
// The metadata for pyDetails changed such that the "template": "CaseView"
// is no longer a child of the created View but is in the created View's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
}

if (sessionStorage.getItem('hasViewContainer') == 'false') {
// @ts-ignore - Property 'getMetadata' is private and only accessible within class
if (this.pConn$.getMetadata().children) {
containerMgr.addContainerItem(this.dispatchObject);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {

savePromise
.then(() => {
// @ts-ignore - Property 'c11nEnv' is private and only accessible within class 'CaseInfo'.
const caseType = this.pConn$.getCaseInfo().c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);
// @ts-ignore - second parameter “payload” for publish method should be optional
PCore.getPubSubUtils().publish('cancelPressed');
this.onSaveActionSuccess({ caseType, caseID, assignmentID });
})
Expand All @@ -373,12 +373,9 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
case 'cancelAssignment':
this.bReInit = true;
this.erService.sendMessage('dismiss', '');
// @ts-ignore - Property 'isAssignmentInCreateStage' is private and only accessible within class 'CaseInfo'
const isAssignmentInCreateStage = this.pConn$.getCaseInfo().isAssignmentInCreateStage();
const isLocalAction =
// @ts-ignore - Property 'isLocalAction' is private and only accessible within class 'CaseInfo'.
this.pConn$.getCaseInfo().isLocalAction() ||
// @ts-ignore - second parameter pageReference for getValue method should be optional
(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION && this.pConn$.getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION));
// check if create stage (modal)
if (isAssignmentInCreateStage && this.isInModal$ && !isLocalAction) {
Expand All @@ -398,14 +395,12 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {

// publish before cancel pressed, because
// cancel assignment happens "after" cancel assignment happens
// @ts-ignore - second parameter “payload” for publish method should be optional
PCore.getPubSubUtils().publish('cancelPressed');

const cancelPromise = this.cancelAssignment(this.itemKey$);
cancelPromise
.then(() => {
this.psService.sendMessage(false);
// @ts-ignore - second parameter “payload” for publish method should be optional
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
})
.catch(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export class DashboardFilterComponent implements OnInit {

clearFilters() {
this.filtersFormGroup$.reset();
// @ts-ignore - second parameter “payload” for publish method should be optional
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CLEAR_ALL);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
onStateChange() {
// Should always check the bridge to see if the component should
// update itself (re-render)
// @ts-ignore - second parameter pageReference for getValue method should be optional
const theRequestedAssignment = this.pConn$.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENT_LABEL);
if (theRequestedAssignment !== this.currentLoadedAssignment) {
this.currentLoadedAssignment = theRequestedAssignment;
Expand All @@ -66,7 +65,6 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
}

ngOnChanges() {
// @ts-ignore - second parameter pageReference for getValue method should be optional
this.loadViewCaseID = this.pConn$.getValue(this.constants.PZINSKEY) || this.pConn$.getValue(this.constants.CASE_INFO.CASE_INFO_ID);
let containerItemData;
const targetName = this.pConn$.getTarget();
Expand All @@ -92,7 +90,6 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {

getViewOptions = () => ({
viewContext: this.resourceType,
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
pageClass: this.loadViewCaseID ? '' : this.pConn$.getDataObject().pyPortal.classID,
container: this.isContainerPreview ? 'preview' : null,
containerName: this.isContainerPreview ? 'preview' : null,
Expand Down Expand Up @@ -139,9 +136,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
this.pConn$
.getActionsApi()
.showData(this.name, dataContext, dataContextParameters, {
// @ts-ignore - skipSemanticUrl should be boolean type
skipSemanticUrl: true,
// @ts-ignore
// @ts-ignore - Object literal may only specify known properties, and 'isDeferLoaded' does not exist in type '{ containerName: string; skipSemanticUrl: boolean; }'
isDeferLoaded: true
})
.then(data => {
Expand All @@ -162,7 +158,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
this.pConn$
.getActionsApi()
.refreshCaseView(encodeURI(this.loadViewCaseID), this.name, '')
.then(data => {
.then((data: any) => {
this.onResponse(data.root);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export class NavbarComponent implements OnInit, OnDestroy {
this.navPages$.forEach(page => {
page.iconName = this.utils.getImageSrc(page.pxPageViewIcon, this.utils.getSDKStaticContentUrl());
});
// @ts-ignore - second parameter pageReference for getValue method should be optional
this.localeReference = this.pConn$.getValue('.pyLocaleReference');
this.actionsAPI = this.pConn$.getActionsApi();
this.createWork = this.actionsAPI.createWork.bind(this.actionsAPI);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ export class CaseViewComponent implements OnInit, OnDestroy {
}

hasCaseIDChanged(): boolean {
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
if (this.currentCaseID !== this.pConn$.getDataObject().caseInfo.ID) {
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
this.currentCaseID = this.pConn$.getDataObject().caseInfo.ID;
return true;
}
Expand All @@ -117,13 +115,11 @@ export class CaseViewComponent implements OnInit, OnDestroy {

updateHeaderAndSummary() {
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseViewProps;
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
const hasNewAttachments = this.pConn$.getDataObject().caseInfo?.hasNewAttachments;

if (hasNewAttachments !== this.bHasNewAttachments) {
this.bHasNewAttachments = hasNewAttachments;
if (this.bHasNewAttachments) {
// @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);
}
}
Expand All @@ -142,7 +138,6 @@ export class CaseViewComponent implements OnInit, OnDestroy {

this.heading$ = PCore.getLocaleUtils().getLocaleValue(this.configProps$.header, '', this.localeKey);
this.id$ = this.configProps$.subheader;
// @ts-ignore - second parameter pageReference for getValue method should be optional
this.status$ = this.pConn$.getValue('.pyStatusWork');
});
}
Expand All @@ -158,7 +153,6 @@ export class CaseViewComponent implements OnInit, OnDestroy {

this.arChildren$ = this.pConn$.getChildren() as any[];

// @ts-ignore - parameter “contextName” for getDataObject method should be optional
const caseInfo = this.pConn$.getDataObject().caseInfo;
this.currentCaseID = caseInfo.ID;
this.arAvailableActions$ = caseInfo?.availableActions ? caseInfo.availableActions : [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,8 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
handleSelection(event) {
const caseKey = this.pConn$.getCaseInfo().getKey();
const refreshOptions = { autoDetectRefresh: true };
// @ts-ignore - second parameter pageReference for getValue method should be optional
if (this.canBeChangedInReviewMode && this.pConn$.getValue('__currentPageTabViewName')) {
// @ts-ignore - second parameter pageReference for getValue method should be optional
this.pConn$.getActionsApi().refreshCaseView(caseKey, this.pConn$.getValue('__currentPageTabViewName'), null, refreshOptions);
this.pConn$.getActionsApi().refreshCaseView(caseKey, this.pConn$.getValue('__currentPageTabViewName'), '', refreshOptions);
PCore.getDeferLoadManager().refreshActiveComponents(this.pConn$.getContextName());
} else {
const pgRef = this.pConn$.getPageReference().replace('caseInfo.content', '');
Expand Down
Loading
Loading