diff --git a/package-lock.json b/package-lock.json index 596916b1..f920b9e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "@pega/configs": "^0.7.1", "@pega/constellationjs": "~24.2.0", "@pega/eslint-config": "^0.7.1", - "@pega/pcore-pconnect-typedefs": "~3.0.0", + "@pega/pcore-pconnect-typedefs": "3.2.1", "@pega/prettier-config": "^0.7.1", "@playwright/test": "^1.40.1", "@types/jasmine": "~5.1.4", @@ -6496,10 +6496,11 @@ } }, "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==", - "dev": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@pega/pcore-pconnect-typedefs/-/pcore-pconnect-typedefs-3.2.1.tgz", + "integrity": "sha512-HsYQq+0j2NyQ3Bt0bSxPTI3h0Kax0BBH9y8vkfocA56mMxaLM0AIl+r+15a/BP5PXxIMb7ecEo2wgwVSEzYWpA==", + "dev": true, + "license": "See LICENSE in LICENSE file" }, "node_modules/@pega/prettier-config": { "version": "0.7.1", diff --git a/package.json b/package.json index 0854db53..4cc8e801 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "@pega/configs": "^0.7.1", "@pega/constellationjs": "~24.2.0", "@pega/eslint-config": "^0.7.1", - "@pega/pcore-pconnect-typedefs": "~3.0.0", + "@pega/pcore-pconnect-typedefs": "3.2.1", "@pega/prettier-config": "^0.7.1", "@playwright/test": "^1.40.1", "@types/jasmine": "~5.1.4", diff --git a/packages/angular-sdk-components/src/lib/_components/designSystemExtension/alert-banner/alert-banner.component.ts b/packages/angular-sdk-components/src/lib/_components/designSystemExtension/alert-banner/alert-banner.component.ts index 797d6f8a..5268dc17 100644 --- a/packages/angular-sdk-components/src/lib/_components/designSystemExtension/alert-banner/alert-banner.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/designSystemExtension/alert-banner/alert-banner.component.ts @@ -22,6 +22,6 @@ export class AlertBannerComponent { onAlertClose(config) { const { PAGE, type, target } = config; const { clearMessages } = PCore.getMessageManager(); - clearMessages({ category: PAGE, type, context: target } as any); + clearMessages({ category: PAGE, type, context: target }); } } diff --git a/packages/angular-sdk-components/src/lib/_components/designSystemExtension/case-create-stage/case-create-stage.component.ts b/packages/angular-sdk-components/src/lib/_components/designSystemExtension/case-create-stage/case-create-stage.component.ts index 64d6196e..0e93b90c 100644 --- a/packages/angular-sdk-components/src/lib/_components/designSystemExtension/case-create-stage/case-create-stage.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/designSystemExtension/case-create-stage/case-create-stage.component.ts @@ -53,6 +53,6 @@ export class CaseCreateStageComponent implements OnInit, OnDestroy { } updateSelf() { - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); } } diff --git a/packages/angular-sdk-components/src/lib/_components/designSystemExtension/operator/operator.component.ts b/packages/angular-sdk-components/src/lib/_components/designSystemExtension/operator/operator.component.ts index 2a32d219..5adef6b2 100644 --- a/packages/angular-sdk-components/src/lib/_components/designSystemExtension/operator/operator.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/designSystemExtension/operator/operator.component.ts @@ -53,7 +53,7 @@ export class OperatorComponent implements OnInit, OnChanges, OnDestroy { } updateSelf(): void { - const configProps$ = this.pConn$.getConfigProps() as any; + const configProps$ = this.pConn$.getConfigProps(); this.displayLabel = this.displayLabel?.toLowerCase(); const label = configProps$?.label?.toLowerCase(); if (label === 'create operator' || this.displayLabel === 'create operator') { diff --git a/packages/angular-sdk-components/src/lib/_components/designSystemExtension/pulse/pulse.component.ts b/packages/angular-sdk-components/src/lib/_components/designSystemExtension/pulse/pulse.component.ts index bce35c18..b2eccc9a 100644 --- a/packages/angular-sdk-components/src/lib/_components/designSystemExtension/pulse/pulse.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/designSystemExtension/pulse/pulse.component.ts @@ -17,8 +17,8 @@ export class PulseComponent implements OnInit { @Input() pConn$: typeof PConnect; configProps$: PulseProps; - currentUser$: string; - currentUserInitials$ = '--'; + currentUser$: string | undefined; + currentUserInitials$: string | undefined = '--'; ngOnInit() { this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()); @@ -26,13 +26,13 @@ export class PulseComponent implements OnInit { this.currentUser$ = PCore.getEnvironmentInfo().getOperatorName(); if (this.currentUser$ != '') { - this.currentUserInitials$ = this.currentUser$.charAt(0); + this.currentUserInitials$ = this.currentUser$?.charAt(0); - if (this.currentUser$.lastIndexOf(' ') > 0) { - const lastName = this.currentUser$.substring(this.currentUser$.lastIndexOf(' ') + 1); + if (this.currentUser$ && this.currentUser$.lastIndexOf(' ') > 0) { + const lastName = this.currentUser$?.substring(this.currentUser$.lastIndexOf(' ') + 1); this.currentUserInitials$ += lastName.charAt(0); - } else if (this.currentUser$.lastIndexOf('.') > 0) { - const lastName = this.currentUser$.substring(this.currentUser$.lastIndexOf('.') + 1); + } else if (this.currentUser$ && this.currentUser$.lastIndexOf('.') > 0) { + const lastName = this.currentUser$?.substring(this.currentUser$.lastIndexOf('.') + 1); this.currentUserInitials$ += lastName.charAt(0); } } diff --git a/packages/angular-sdk-components/src/lib/_components/field/auto-complete/auto-complete.component.ts b/packages/angular-sdk-components/src/lib/_components/field/auto-complete/auto-complete.component.ts index 95e27ae7..6ec63968 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/auto-complete/auto-complete.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/auto-complete/auto-complete.component.ts @@ -184,7 +184,7 @@ export class AutoCompleteComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; if (this.listType === 'associated') { this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject('')); // 1st arg empty string until typedef marked correctly } @@ -220,7 +220,7 @@ export class AutoCompleteComponent implements OnInit, OnDestroy { let datasource = this.configProps$.datasource; let columns = this.configProps$.columns; // const { deferDatasource, datasourceMetadata } = this.configProps$; - const { deferDatasource, datasourceMetadata }: any = this.pConn$.getConfigProps(); + const { deferDatasource, datasourceMetadata } = this.pConn$.getConfigProps(); // convert associated to datapage listtype and transform props // Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList if (deferDatasource && datasourceMetadata?.datasource?.name) { @@ -318,7 +318,7 @@ export class AutoCompleteComponent implements OnInit, OnDestroy { const value = key; const actionsApi = this.pConn$?.getActionsApi(); - const propName = (this.pConn$?.getStateProps() as any).value; + const propName = this.pConn$?.getStateProps().value; handleEvent(actionsApi, 'changeNblur', propName, value); if (this.configProps$?.onRecordChange) { el.value = value; diff --git a/packages/angular-sdk-components/src/lib/_components/field/check-box/check-box.component.ts b/packages/angular-sdk-components/src/lib/_components/field/check-box/check-box.component.ts index dc033f65..5164f309 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/check-box/check-box.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/check-box/check-box.component.ts @@ -146,7 +146,7 @@ export class CheckBoxComponent implements OnInit, OnDestroy { } this.actionsApi = this.pConn$.getActionsApi(); - this.propName = (this.pConn$.getStateProps() as any).value; + this.propName = this.pConn$.getStateProps().value; // multi case this.selectionMode = this.configProps$.selectionMode; @@ -159,7 +159,7 @@ export class CheckBoxComponent implements OnInit, OnDestroy { this.datasource = this.configProps$.datasource; this.selectionKey = this.configProps$.selectionKey; const listSourceItems = this.datasource?.source ?? []; - const dataField: any = this.selectionKey?.split?.('.')[1]; + const dataField = this.selectionKey?.split?.('.')[1] ?? ''; const listToDisplay: any[] = []; listSourceItems.forEach(element => { element.selected = this.selectedvalues?.some?.(data => data[dataField] === element.key); @@ -203,7 +203,7 @@ export class CheckBoxComponent implements OnInit, OnDestroy { this.fieldControl.enable(); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // eslint-disable-next-line sonarjs/no-redundant-boolean if (this.value$ === 'true' || this.value$ == true) { diff --git a/packages/angular-sdk-components/src/lib/_components/field/currency/currency.component.ts b/packages/angular-sdk-components/src/lib/_components/field/currency/currency.component.ts index 1684e977..f34ba110 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/currency/currency.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/currency/currency.component.ts @@ -129,7 +129,7 @@ export class CurrencyComponent implements OnInit, OnDestroy { } this.helperText = this.configProps$.helperText; this.placeholder = this.configProps$.placeholder || ''; - const currencyISOCode: any = this.configProps$?.currencyISOCode; + const currencyISOCode = this.configProps$?.currencyISOCode ?? ''; const theSymbols = getCurrencyCharacters(currencyISOCode); this.currSym = theSymbols.theCurrencySymbol; @@ -169,7 +169,7 @@ export class CurrencyComponent implements OnInit, OnDestroy { this.decimalPrecision = this.configProps$?.allowDecimals ? 2 : 0; - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // trigger display of error message with field control if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') { @@ -184,7 +184,7 @@ export class CurrencyComponent implements OnInit, OnDestroy { fieldOnBlur(event: any) { const actionsApi = this.pConn$?.getActionsApi(); - const propName = (this.pConn$?.getStateProps() as any).value; + const propName = this.pConn$?.getStateProps().value; let value = event?.target?.value; value = value?.substring(1); if (this.currSep === ',') { diff --git a/packages/angular-sdk-components/src/lib/_components/field/date-time/date-time.component.ts b/packages/angular-sdk-components/src/lib/_components/field/date-time/date-time.component.ts index 5c94277d..95d7b840 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/date-time/date-time.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/date-time/date-time.component.ts @@ -61,7 +61,7 @@ export class DateTimeComponent implements OnInit, OnDestroy { // Start with default dateFormatInfo dateFormatInfo = dateFormatInfoDefault; // and then update, as needed, based on locale, etc. - theDateFormat: any = getDateFormatInfo(); + theDateFormat = getDateFormatInfo(); placeholder: string; constructor( @@ -155,7 +155,7 @@ export class DateTimeComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // trigger display of error message with field control if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') { diff --git a/packages/angular-sdk-components/src/lib/_components/field/date/date.component.ts b/packages/angular-sdk-components/src/lib/_components/field/date/date.component.ts index 02c9b4b5..ed371818 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/date/date.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/date/date.component.ts @@ -21,7 +21,7 @@ interface DateProps extends PConnFieldProps { } class MyFormat { - theDateFormat: any = getDateFormatInfo(); + theDateFormat = getDateFormatInfo(); get display() { return { @@ -83,7 +83,7 @@ export class DateComponent implements OnInit, OnDestroy { // Start with default dateFormatInfo dateFormatInfo = dateFormatInfoDefault; // and then update, as needed, based on locale, etc. - theDateFormat: any = getDateFormatInfo(); + theDateFormat = getDateFormatInfo(); constructor( private angularPConnect: AngularPConnectService, @@ -194,7 +194,7 @@ export class DateComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // trigger display of error message with field control if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') { diff --git a/packages/angular-sdk-components/src/lib/_components/field/decimal/decimal.component.ts b/packages/angular-sdk-components/src/lib/_components/field/decimal/decimal.component.ts index bac1f0bc..f8f88ec9 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/decimal/decimal.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/decimal/decimal.component.ts @@ -140,7 +140,7 @@ export class DecimalComponent implements OnInit, OnDestroy { this.helperText = this.configProps$.helperText; this.placeholder = this.configProps$.placeholder || ''; const showGroupSeparators = this.configProps$.showGroupSeparators; - const currencyISOCode: any = this.configProps$?.currencyISOCode; + const currencyISOCode = this.configProps$?.currencyISOCode ?? ''; const theSymbols = getCurrencyCharacters(currencyISOCode); this.currDec = theSymbols.theDecimalIndicator; @@ -152,7 +152,7 @@ export class DecimalComponent implements OnInit, OnDestroy { if (this.formatter === 'Currency') { this.formattedValue = format(this.value$, this.formatter.toLowerCase(), theCurrencyOptions); } else { - this.formattedValue = format(this.value$, this.pConn$.getComponentName().toLowerCase(), theCurrencyOptions); + this.formattedValue = format(this.value$, this.pConn$.getComponentName()?.toLowerCase(), theCurrencyOptions); } // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError @@ -189,12 +189,12 @@ export class DecimalComponent implements OnInit, OnDestroy { } this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2; - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; } fieldOnBlur(event: any) { const actionsApi = this.pConn$?.getActionsApi(); - const propName = (this.pConn$?.getStateProps() as any).value; + const propName = this.pConn$?.getStateProps().value; let value = event?.target?.value; if (this.currSep === ',') { value = value.replace(/,/g, ''); diff --git a/packages/angular-sdk-components/src/lib/_components/field/dropdown/dropdown.component.ts b/packages/angular-sdk-components/src/lib/_components/field/dropdown/dropdown.component.ts index 4117e4ef..4d24533d 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/dropdown/dropdown.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/dropdown/dropdown.component.ts @@ -157,7 +157,7 @@ export class DropdownComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())]; optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') }); @@ -166,7 +166,7 @@ export class DropdownComponent implements OnInit, OnDestroy { this.value$ = 'Select'; } - const propName = (this.pConn$.getStateProps() as any).value; + const propName = this.pConn$.getStateProps().value; const className = this.pConn$.getCaseInfo().getClassName(); const refName = propName?.slice(propName.lastIndexOf('.') + 1); @@ -205,7 +205,7 @@ export class DropdownComponent implements OnInit, OnDestroy { event.value = ''; } const actionsApi = this.pConn$?.getActionsApi(); - const propName = (this.pConn$?.getStateProps() as any).value; + const propName = this.pConn$?.getStateProps().value; handleEvent(actionsApi, 'changeNblur', propName, event.value); if (this.configProps$?.onRecordChange) { this.configProps$.onRecordChange(event); diff --git a/packages/angular-sdk-components/src/lib/_components/field/email/email.component.ts b/packages/angular-sdk-components/src/lib/_components/field/email/email.component.ts index aa7b9544..e0e096e7 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/email/email.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/email/email.component.ts @@ -139,7 +139,7 @@ export class EmailComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // trigger display of error message with field control if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') { diff --git a/packages/angular-sdk-components/src/lib/_components/field/integer/integer.component.ts b/packages/angular-sdk-components/src/lib/_components/field/integer/integer.component.ts index 1c78e0cd..bc0f0225 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/integer/integer.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/integer/integer.component.ts @@ -142,7 +142,7 @@ export class IntegerComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // trigger display of error message with field control if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') { diff --git a/packages/angular-sdk-components/src/lib/_components/field/multiselect/multiselect.component.ts b/packages/angular-sdk-components/src/lib/_components/field/multiselect/multiselect.component.ts index be27eb50..ebc7ddb3 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/multiselect/multiselect.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/multiselect/multiselect.component.ts @@ -181,7 +181,9 @@ export class MultiselectComponent implements OnInit, OnDestroy { listType: this.listType, maxResultsDisplay: this.maxResultsDisplay || '100', columns: preProcessColumns(columns), - groupColumnsConfig: preProcessColumns(this.groupColumnsConfig) + groupColumnsConfig: preProcessColumns(this.groupColumnsConfig), + associationFilter: undefined, + ignoreCase: undefined }; const groupsDisplayFieldMeta = this.listType !== 'associated' ? getDisplayFieldsMetaData(dataConfig.groupColumnsConfig) : null; @@ -326,7 +328,7 @@ export class MultiselectComponent implements OnInit, OnDestroy { setSelectedItemsForReferenceList(data: any) { // Clear error messages if any - const propName = (this.pConn$.getStateProps() as any).selectionList; + const propName = this.pConn$.getStateProps().selectionList; this.pConn$.clearErrorMessages({ property: propName, category: '', diff --git a/packages/angular-sdk-components/src/lib/_components/field/percentage/percentage.component.ts b/packages/angular-sdk-components/src/lib/_components/field/percentage/percentage.component.ts index ae241cd4..5fb63515 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/percentage/percentage.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/percentage/percentage.component.ts @@ -157,7 +157,7 @@ export class PercentageComponent implements OnInit, OnDestroy { this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2; - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // trigger display of error message with field control if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') { @@ -175,7 +175,7 @@ export class PercentageComponent implements OnInit, OnDestroy { fieldOnBlur(event: any) { const actionsApi = this.pConn$?.getActionsApi(); - const propName = (this.pConn$?.getStateProps() as any).value; + const propName = this.pConn$?.getStateProps()?.value; let value = event?.target?.value; value = value ? value.replace(/%/g, '') : ''; if (this.currSep === ',') { diff --git a/packages/angular-sdk-components/src/lib/_components/field/phone/phone.component.ts b/packages/angular-sdk-components/src/lib/_components/field/phone/phone.component.ts index 56740b8d..39febd9e 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/phone/phone.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/phone/phone.component.ts @@ -162,7 +162,7 @@ export class PhoneComponent implements OnInit, OnDestroy { fieldOnChange() { if (this.formGroup$.controls[this.controlName$].value) { const actionsApi = this.pConn$?.getActionsApi(); - const propName = (this.pConn$?.getStateProps() as any).value; + const propName = this.pConn$?.getStateProps().value; const value = this.formGroup$.controls[this.controlName$].value; const eventObj = { target: { diff --git a/packages/angular-sdk-components/src/lib/_components/field/radio-buttons/radio-buttons.component.ts b/packages/angular-sdk-components/src/lib/_components/field/radio-buttons/radio-buttons.component.ts index 2c4af84b..f03ac7a0 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/radio-buttons/radio-buttons.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/radio-buttons/radio-buttons.component.ts @@ -164,11 +164,11 @@ export class RadioButtonsComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject()); - const propName = (this.pConn$.getStateProps() as any).value; + const propName = this.pConn$.getStateProps().value; const className = this.pConn$.getCaseInfo().getClassName(); const refName = propName?.slice(propName.lastIndexOf('.') + 1); diff --git a/packages/angular-sdk-components/src/lib/_components/field/rich-text/rich-text.component.ts b/packages/angular-sdk-components/src/lib/_components/field/rich-text/rich-text.component.ts index a11d24f1..6a8fb715 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/rich-text/rich-text.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/rich-text/rich-text.component.ts @@ -80,7 +80,7 @@ export class RichTextComponent implements OnInit, OnDestroy { updateSelf(): void { // moved this from ngOnInit() and call this from there instead... this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as RichTextProps; - const stateProps: any = this.pConn$.getStateProps(); + const stateProps = this.pConn$.getStateProps(); this.status = stateProps?.status; if (this.configProps$.value != undefined) { @@ -113,7 +113,7 @@ export class RichTextComponent implements OnInit, OnDestroy { fieldOnChange() { if (this.status === 'error') { - const property = (this.pConn$.getStateProps() as any).value; + const property = this.pConn$.getStateProps().value; this.pConn$.clearErrorMessages({ property, category: '', @@ -125,7 +125,7 @@ export class RichTextComponent implements OnInit, OnDestroy { fieldOnBlur(editorValue: any) { // PConnect wants to use eventHandler for onBlur const actionsApi = this.pConn$?.getActionsApi(); - const propName = (this.pConn$?.getStateProps() as any).value; + const propName = this.pConn$?.getStateProps()?.value; handleEvent(actionsApi, 'changeNblur', propName, editorValue); } } diff --git a/packages/angular-sdk-components/src/lib/_components/field/scalar-list/scalar-list.component.ts b/packages/angular-sdk-components/src/lib/_components/field/scalar-list/scalar-list.component.ts index 6383bcf3..06b2b4af 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/scalar-list/scalar-list.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/scalar-list/scalar-list.component.ts @@ -101,7 +101,6 @@ 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$, @@ -110,7 +109,7 @@ export class ScalarListComponent implements OnInit, OnDestroy { } }, '', - '', + 0, {} ); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional; }); diff --git a/packages/angular-sdk-components/src/lib/_components/field/text-area/text-area.component.ts b/packages/angular-sdk-components/src/lib/_components/field/text-area/text-area.component.ts index 3967f9b5..c7be14ae 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/text-area/text-area.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/text-area/text-area.component.ts @@ -140,7 +140,7 @@ export class TextAreaComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // trigger display of error message with field control if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') { diff --git a/packages/angular-sdk-components/src/lib/_components/field/text-input/text-input.component.ts b/packages/angular-sdk-components/src/lib/_components/field/text-input/text-input.component.ts index 72ec46c5..234d7a75 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/text-input/text-input.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/text-input/text-input.component.ts @@ -113,7 +113,7 @@ export class TextInputComponent implements OnInit, OnDestroy { this.label$ = this.configProps$.label; this.displayMode$ = this.configProps$.displayMode; - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; if (this.configProps$.visibility != null) { this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility); diff --git a/packages/angular-sdk-components/src/lib/_components/field/time/time.component.ts b/packages/angular-sdk-components/src/lib/_components/field/time/time.component.ts index 85ade831..888e6137 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/time/time.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/time/time.component.ts @@ -138,7 +138,7 @@ export class TimeComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // trigger display of error message with field control if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') { diff --git a/packages/angular-sdk-components/src/lib/_components/field/url/url.component.ts b/packages/angular-sdk-components/src/lib/_components/field/url/url.component.ts index dcbecdab..caacb932 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/url/url.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/url/url.component.ts @@ -140,7 +140,7 @@ export class UrlComponent implements OnInit, OnDestroy { this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly); } - this.componentReference = (this.pConn$.getStateProps() as any).value; + this.componentReference = this.pConn$.getStateProps().value; // trigger display of error message with field control if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') { diff --git a/packages/angular-sdk-components/src/lib/_components/field/user-reference/user-reference.component.ts b/packages/angular-sdk-components/src/lib/_components/field/user-reference/user-reference.component.ts index 888c5167..de4c4024 100644 --- a/packages/angular-sdk-components/src/lib/_components/field/user-reference/user-reference.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/field/user-reference/user-reference.component.ts @@ -174,7 +174,7 @@ export class UserReferenceComponent implements OnInit, OnDestroy { dataViewName: OPERATORS_DP }; try { - const resp: any = await PCore.getRestClient().invokeRestApi('getListData', { queryPayload } as any, ''); // 3rd arg empty string until typedef marked correctly + const resp = await PCore.getRestClient().invokeRestApi('getListData', { queryPayload }, ''); // 3rd arg empty string until typedef marked correctly if (resp?.data) { const ddDataSource = resp.data.data.map(listItem => ({ key: listItem.pyUserIdentifier, diff --git a/packages/angular-sdk-components/src/lib/_components/infra/Containers/flow-container/flow-container.component.ts b/packages/angular-sdk-components/src/lib/_components/infra/Containers/flow-container/flow-container.component.ts index 58c35b69..3513a2e3 100644 --- a/packages/angular-sdk-components/src/lib/_components/infra/Containers/flow-container/flow-container.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/infra/Containers/flow-container/flow-container.component.ts @@ -198,7 +198,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement } initContainer() { - const containerMgr: any = this.pConn$.getContainerManager(); + const containerMgr = this.pConn$.getContainerManager(); const baseContext = this.pConn$.getContextName(); const containerName = this.pConn$.getContainerName(); const containerType = 'single'; @@ -237,7 +237,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement // when true, update arChildren from pConn, otherwise, arChilren will be updated in updateSelf() if (bLoadChildren) { - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); } // const oData = this.pConn$.getDataObject(); @@ -277,7 +277,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement hasAssignments() { let hasAssignments = false; - const assignmentsList: any[] = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS); + const assignmentsList = 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 // a different operator. So, see if there are any assignments for @@ -312,7 +312,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement isCaseWideLocalAction() { const actionID = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID); - const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS) as any[]; + const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS); let bCaseWideAction = false; if (caseActions && actionID) { const actionObj = caseActions.find(caseAction => caseAction.ID === actionID); diff --git a/packages/angular-sdk-components/src/lib/_components/infra/Containers/modal-view-container/modal-view-container.component.ts b/packages/angular-sdk-components/src/lib/_components/infra/Containers/modal-view-container/modal-view-container.component.ts index 0261d283..46480e12 100644 --- a/packages/angular-sdk-components/src/lib/_components/infra/Containers/modal-view-container/modal-view-container.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/infra/Containers/modal-view-container/modal-view-container.component.ts @@ -89,7 +89,7 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy { this.itemKey$ = baseContext.concat('/').concat(acName); } - const containerMgr: any = this.pConn$.getContainerManager(); + const containerMgr = this.pConn$.getContainerManager(); containerMgr.initializeContainers({ type: 'multiple' diff --git a/packages/angular-sdk-components/src/lib/_components/infra/Containers/preview-view-container/preview-view-container.component.ts b/packages/angular-sdk-components/src/lib/_components/infra/Containers/preview-view-container/preview-view-container.component.ts index ce61a9c5..f839c703 100644 --- a/packages/angular-sdk-components/src/lib/_components/infra/Containers/preview-view-container/preview-view-container.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/infra/Containers/preview-view-container/preview-view-container.component.ts @@ -18,7 +18,7 @@ export class PreviewViewContainerComponent implements OnInit { @Input() pConn$: typeof PConnect; ngOnInit(): void { - const containerMgr: any = this.pConn$.getContainerManager(); + const containerMgr = this.pConn$.getContainerManager(); containerMgr.initializeContainers({ type: 'multiple' diff --git a/packages/angular-sdk-components/src/lib/_components/infra/Containers/view-container/view-container.component.ts b/packages/angular-sdk-components/src/lib/_components/infra/Containers/view-container/view-container.component.ts index c1f2d30d..f8b97731 100644 --- a/packages/angular-sdk-components/src/lib/_components/infra/Containers/view-container/view-container.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/infra/Containers/view-container/view-container.component.ts @@ -86,7 +86,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy { this.pConn$.isBoundToState(); - const containerMgr: any = this.pConn$.getContainerManager(); + const containerMgr = this.pConn$.getContainerManager(); this.prepareDispatchObject = this.prepareDispatchObject.bind(this); @@ -121,7 +121,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy { } if (sessionStorage.getItem('hasViewContainer') == 'false') { - if (this.pConn$.getMetadata().children) { + if (this.pConn$.getMetadata()?.children) { containerMgr.addContainerItem(this.dispatchObject); } @@ -254,7 +254,7 @@ export class ViewContainerComponent implements OnInit, OnDestroy { console.error(`ViewContainer has a newComp that is NOT a reference!`); this.createdViewPConn$ = newComp; - const newConfigProps: any = newComp.getConfigProps(); + const newConfigProps = newComp.getConfigProps(); this.templateName$ = newConfigProps.template || ''; this.title$ = newConfigProps.title || ''; // update children with new view's children diff --git a/packages/angular-sdk-components/src/lib/_components/infra/assignment/assignment.component.ts b/packages/angular-sdk-components/src/lib/_components/infra/assignment/assignment.component.ts index 45293b32..03f0e3b9 100644 --- a/packages/angular-sdk-components/src/lib/_components/infra/assignment/assignment.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/infra/assignment/assignment.component.ts @@ -332,7 +332,6 @@ 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); PCore.getPubSubUtils().publish('cancelPressed'); this.onSaveActionSuccess({ caseType, caseID, assignmentID }); diff --git a/packages/angular-sdk-components/src/lib/_components/infra/defer-load/defer-load.component.ts b/packages/angular-sdk-components/src/lib/_components/infra/defer-load/defer-load.component.ts index 1ca4b766..d90ac815 100644 --- a/packages/angular-sdk-components/src/lib/_components/infra/defer-load/defer-load.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/infra/defer-load/defer-load.component.ts @@ -81,7 +81,7 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges { this.resourceType = resourceType; this.isContainerPreview = /preview_[0-9]*/g.test(this.pConn$.getContextName()); - const theConfigProps: any = this.pConn$.getConfigProps(); + const theConfigProps = this.pConn$.getConfigProps(); this.deferLoadId = theConfigProps.deferLoadId; this.name = this.name || theConfigProps.name; @@ -91,8 +91,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges { getViewOptions = () => ({ viewContext: this.resourceType, pageClass: this.loadViewCaseID ? '' : this.pConn$.getDataObject().pyPortal.classID, - container: this.isContainerPreview ? 'preview' : null, - containerName: this.isContainerPreview ? 'preview' : null, + container: this.isContainerPreview ? 'preview' : undefined, + containerName: this.isContainerPreview ? 'preview' : undefined, updateData: this.isContainerPreview }); diff --git a/packages/angular-sdk-components/src/lib/_components/infra/navbar/navbar.component.ts b/packages/angular-sdk-components/src/lib/_components/infra/navbar/navbar.component.ts index f8db86e9..61780c14 100644 --- a/packages/angular-sdk-components/src/lib/_components/infra/navbar/navbar.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/infra/navbar/navbar.component.ts @@ -36,11 +36,11 @@ export class NavbarComponent implements OnInit, OnDestroy { navExpandCollapse$: string; bShowCaseTypes$ = false; - portalApp$ = ''; + portalApp$: string | undefined = ''; portalLogoImage$: string; showAppName$?: boolean = false; - portalOperator$: string; + portalOperator$: string | undefined; portalOperatorInitials$: string; actionsAPI: any; @@ -131,7 +131,7 @@ export class NavbarComponent implements OnInit, OnDestroy { this.portalLogoImage$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg'); this.portalOperator$ = PCore.getEnvironmentInfo().getOperatorName(); - this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$); + this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$ ?? ''); this.showAppName$ = this.configProps$.showAppName; this.portalApp$ = PCore.getEnvironmentInfo().getApplicationLabel(); diff --git a/packages/angular-sdk-components/src/lib/_components/infra/root-container/root-container.component.ts b/packages/angular-sdk-components/src/lib/_components/infra/root-container/root-container.component.ts index 95aaa9c9..33683906 100644 --- a/packages/angular-sdk-components/src/lib/_components/infra/root-container/root-container.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/infra/root-container/root-container.component.ts @@ -67,7 +67,7 @@ export class RootContainerComponent implements OnInit, OnDestroy { const { containers } = PCore.getStore().getState(); const items = Object.keys(containers).filter(item => item.includes('root')); - (PCore.getContainerUtils().getContainerAPI() as any).addContainerItems(items); + PCore.getContainerUtils().getContainerAPI().addContainerItems(items); // add preview and modalview containers to redux // keep local copies of the the pConnect that is related @@ -156,7 +156,7 @@ export class RootContainerComponent implements OnInit, OnDestroy { if (items[key] && items[key].view && Object.keys(items[key].view).length > 0) { const itemView = items[key].view; - const rootObject: any = PCore.createPConnect({ + const rootObject = PCore.createPConnect({ meta: itemView, options: { context: items[key].context @@ -202,7 +202,7 @@ export class RootContainerComponent implements OnInit, OnDestroy { this.componentName$ = localPConn.getComponentName(); if (this.componentName$ === 'ViewContainer') { - const configProps: any = this.pConn$.getConfigProps(); + const configProps = this.pConn$.getConfigProps(); const viewContConfig = { meta: { type: 'ViewContainer', diff --git a/packages/angular-sdk-components/src/lib/_components/template/app-shell/app-shell.component.ts b/packages/angular-sdk-components/src/lib/_components/template/app-shell/app-shell.component.ts index 8477ccb8..3b726489 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/app-shell/app-shell.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/app-shell/app-shell.component.ts @@ -80,7 +80,7 @@ export class AppShellComponent implements OnInit, OnDestroy { } this.caseTypes$ = this.configProps$.caseTypes; - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); this.portalTemplate = this.configProps$.portalTemplate; @@ -129,7 +129,7 @@ export class AppShellComponent implements OnInit, OnDestroy { } this.caseTypes$ = this.configProps$.caseTypes; - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); }); } diff --git a/packages/angular-sdk-components/src/lib/_components/template/case-summary/case-summary.component.ts b/packages/angular-sdk-components/src/lib/_components/template/case-summary/case-summary.component.ts index cc51fbbe..49c7fd59 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/case-summary/case-summary.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/case-summary/case-summary.component.ts @@ -55,7 +55,7 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges { // Then, continue on with other initialization this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as CaseSummaryProps; - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); this.generatePrimaryAndSecondaryFields(); diff --git a/packages/angular-sdk-components/src/lib/_components/template/case-view/case-view.component.ts b/packages/angular-sdk-components/src/lib/_components/template/case-view/case-view.component.ts index 21f0d749..58f8bc7f 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/case-view/case-view.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/case-view/case-view.component.ts @@ -120,7 +120,7 @@ export class CaseViewComponent implements OnInit, OnDestroy { if (hasNewAttachments !== this.bHasNewAttachments) { this.bHasNewAttachments = hasNewAttachments; if (this.bHasNewAttachments) { - PCore.getPubSubUtils().publish((PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true); + PCore.getPubSubUtils().publish(PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, true); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/confirmation/confirmation.component.ts b/packages/angular-sdk-components/src/lib/_components/template/confirmation/confirmation.component.ts index 4714ffb3..07f02062 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/confirmation/confirmation.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/confirmation/confirmation.component.ts @@ -43,7 +43,7 @@ export class ConfirmationComponent implements OnInit, OnDestroy { // First thing in initialization is registering and subscribing to the AngularPConnect service this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange); this.CONSTS = PCore.getConstants(); - const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(this.pConn$.getTarget()); + const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(this.pConn$.getTarget() ?? null); this.rootInfo = PCore.getContainerUtils().getContainerItemData(this.pConn$.getTarget(), activeContainerItemID); this.checkAndUpdate(); } diff --git a/packages/angular-sdk-components/src/lib/_components/template/data-reference/data-reference.component.ts b/packages/angular-sdk-components/src/lib/_components/template/data-reference/data-reference.component.ts index 48b25699..7783f193 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/data-reference/data-reference.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/data-reference/data-reference.component.ts @@ -45,19 +45,18 @@ export class DataReferenceComponent implements OnInit, OnDestroy { ngOnInit(): void { // First thing in initialization is registering and subscribing to the AngularPConnect service this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange); - this.children = this.pConn$.getChildren() as any[]; + this.children = this.pConn$.getChildren(); this.updateSelf(); if (this.firstChildMeta?.type === 'Dropdown' && this.rawViewMetadata.config?.parameters) { const { value, key, text } = this.firstChildMeta.config.datasource.fields; - ( - PCore.getDataApiUtils().getData( + PCore.getDataApiUtils() + .getData( this.refList, { dataViewParameters: this.parameters - } as any, + }, '' - ) as Promise - ) + ) .then(res => { if (res.data.data !== null) { const ddDataSource = res.data.data @@ -103,7 +102,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy { updateSelf() { // Update properties based on configProps - const theConfigProps: any = this.pConn$.getConfigProps(); + const theConfigProps = this.pConn$.getConfigProps(); this.updatePropertiesFromProps(theConfigProps); const displayAs = theConfigProps.displayAs; @@ -187,41 +186,38 @@ export class DataReferenceComponent implements OnInit, OnDestroy { // AutoComplete sets value on event.id whereas Dropdown sets it on event.target.value const propValue = event?.id || event?.target?.value; if (propValue && this.canBeChangedInReviewMode && this.isDisplayModeEnabled) { - (PCore.getDataApiUtils().getCaseEditLock(caseKey, '') as Promise).then(caseResponse => { - const pageTokens = this.pConn$.getPageReference().replace('caseInfo.content', '').split('.'); - let curr = {}; - const commitData = curr; + PCore.getDataApiUtils() + .getCaseEditLock(caseKey, '') + .then(caseResponse => { + const pageTokens = this.pConn$.getPageReference().replace('caseInfo.content', '').split('.'); + let curr = {}; + const commitData = curr; - pageTokens.forEach(el => { - if (el !== '') { - curr[el] = {}; - curr = curr[el]; - } - }); + pageTokens.forEach(el => { + if (el !== '') { + curr[el] = {}; + curr = curr[el]; + } + }); - // expecting format like {Customer: {pyID:"C-100"}} - const propArr = this.propName.split('.'); - propArr.forEach((element, idx) => { - if (idx + 1 === propArr.length) { - curr[element] = propValue; - } else { - curr[element] = {}; - curr = curr[element]; - } - }); + // expecting format like {Customer: {pyID:"C-100"}} + const propArr = this.propName.split('.'); + propArr.forEach((element, idx) => { + if (idx + 1 === propArr.length) { + curr[element] = propValue; + } else { + curr[element] = {}; + curr = curr[element]; + } + }); - ( - PCore.getCaseUtils().updateCaseEditFieldsData( - caseKey, - { [caseKey]: commitData }, - caseResponse.headers.etag, - this.pConn$.getContextName() - ) as Promise - ).then(response => { - PCore.getContainerUtils().updateParentLastUpdateTime(this.pConn$.getContextName(), response.data.data.caseInfo.lastUpdateTime); - PCore.getContainerUtils().updateRelatedContextEtag(this.pConn$.getContextName(), response.headers.etag); + PCore.getCaseUtils() + .updateCaseEditFieldsData(caseKey, { [caseKey]: commitData }, caseResponse.headers.etag, this.pConn$.getContextName()) + .then(response => { + PCore.getContainerUtils().updateParentLastUpdateTime(this.pConn$.getContextName(), response.data.data.caseInfo.lastUpdateTime); + PCore.getContainerUtils().updateRelatedContextEtag(this.pConn$.getContextName(), response.headers.etag); + }); }); - }); } } @@ -235,7 +231,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy { property: this.propName, category: '', context: '' - } as any); + }); if (!this.canBeChangedInReviewMode && this.isDisplayModeEnabled && this.selectionMode === SELECTION_MODE.SINGLE) { this.displaySingleRef = true; } diff --git a/packages/angular-sdk-components/src/lib/_components/template/default-form/default-form.component.ts b/packages/angular-sdk-components/src/lib/_components/template/default-form/default-form.component.ts index 811cc760..53808c39 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/default-form/default-form.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/default-form/default-form.component.ts @@ -49,7 +49,7 @@ export class DefaultFormComponent implements OnInit { const propToUse: any = { ...this.pConn$.getInheritedProps() }; this.showLabel = propToUse?.showLabel; this.label = propToUse?.label; - const kids = this.pConn$.getChildren() as any[]; + const kids = this.pConn$.getChildren(); this.instructions = this.templateUtils.getInstructions(this.pConn$, configProps?.instructions); const numCols = configProps.NumCols ? configProps.NumCols : '1'; diff --git a/packages/angular-sdk-components/src/lib/_components/template/details-narrow-wide/details-narrow-wide.component.ts b/packages/angular-sdk-components/src/lib/_components/template/details-narrow-wide/details-narrow-wide.component.ts index 24695bf1..a44f32e8 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/details-narrow-wide/details-narrow-wide.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/details-narrow-wide/details-narrow-wide.component.ts @@ -51,7 +51,7 @@ export class DetailsNarrowWideComponent implements OnInit, OnDestroy { } updateSelf() { - const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config); + const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config); this.showHighlightedData = rawMetaData?.showHighlightedData; if (this.showHighlightedData) { diff --git a/packages/angular-sdk-components/src/lib/_components/template/details-one-column/details-one-column.component.ts b/packages/angular-sdk-components/src/lib/_components/template/details-one-column/details-one-column.component.ts index 5695178e..5529b167 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/details-one-column/details-one-column.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/details-one-column/details-one-column.component.ts @@ -53,7 +53,7 @@ export class DetailsOneColumnComponent implements OnInit, OnDestroy { } updateSelf() { - const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config); + const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config); this.showHighlightedData = rawMetaData?.showHighlightedData; if (this.showHighlightedData) { diff --git a/packages/angular-sdk-components/src/lib/_components/template/details-three-column/details-three-column.component.ts b/packages/angular-sdk-components/src/lib/_components/template/details-three-column/details-three-column.component.ts index e77f0f9e..6cd58540 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/details-three-column/details-three-column.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/details-three-column/details-three-column.component.ts @@ -58,7 +58,7 @@ export class DetailsThreeColumnComponent implements OnInit, OnDestroy { } updateSelf() { - const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config); + const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config); this.showHighlightedData = rawMetaData?.showHighlightedData; if (this.showHighlightedData) { diff --git a/packages/angular-sdk-components/src/lib/_components/template/details-two-column/details-two-column.component.ts b/packages/angular-sdk-components/src/lib/_components/template/details-two-column/details-two-column.component.ts index bdc41e57..9001f42c 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/details-two-column/details-two-column.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/details-two-column/details-two-column.component.ts @@ -58,7 +58,7 @@ export class DetailsTwoColumnComponent implements OnInit, OnDestroy { } updateSelf() { - const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config); + const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config); this.showHighlightedData = rawMetaData?.showHighlightedData; if (this.showHighlightedData) { diff --git a/packages/angular-sdk-components/src/lib/_components/template/details-wide-narrow/details-wide-narrow.component.ts b/packages/angular-sdk-components/src/lib/_components/template/details-wide-narrow/details-wide-narrow.component.ts index ffa76b9b..e086ac80 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/details-wide-narrow/details-wide-narrow.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/details-wide-narrow/details-wide-narrow.component.ts @@ -54,7 +54,7 @@ export class DetailsWideNarrowComponent implements OnInit, OnDestroy { } updateSelf() { - const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config); + const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config); this.showHighlightedData = rawMetaData?.showHighlightedData; if (this.showHighlightedData) { diff --git a/packages/angular-sdk-components/src/lib/_components/template/details/details.component.ts b/packages/angular-sdk-components/src/lib/_components/template/details/details.component.ts index 5a4eb7fc..9abcea98 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/details/details.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/details/details.component.ts @@ -51,7 +51,7 @@ export class DetailsComponent implements OnInit, OnDestroy { } updateSelf() { - const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config); + const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config); this.showHighlightedData = rawMetaData?.showHighlightedData; if (this.showHighlightedData) { diff --git a/packages/angular-sdk-components/src/lib/_components/template/dynamic-tabs/dynamic-tabs.component.ts b/packages/angular-sdk-components/src/lib/_components/template/dynamic-tabs/dynamic-tabs.component.ts index a7e07b12..49c064ef 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/dynamic-tabs/dynamic-tabs.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/dynamic-tabs/dynamic-tabs.component.ts @@ -62,7 +62,7 @@ export class DynamicTabsComponent implements OnInit, OnDestroy { this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT'); this.pConn$.setInheritedProp('readOnly', true); - const referenceListData: any = this.pConn$.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional + const referenceListData = this.pConn$.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional this.tabsItems = referenceListData?.map((item, i) => { diff --git a/packages/angular-sdk-components/src/lib/_components/template/field-group-template/field-group-template.component.ts b/packages/angular-sdk-components/src/lib/_components/template/field-group-template/field-group-template.component.ts index 45368d76..9ad24c57 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/field-group-template/field-group-template.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/field-group-template/field-group-template.component.ts @@ -149,12 +149,10 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges }; addFieldGroupItem() { - // @ts-ignore - second parameter "pageRef" is optional for insert method this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length); } deleteFieldGroupItem(index) { - // @ts-ignore - second parameter "pageRef" is optional for deleteEntry method this.pConn$.getListActions().deleteEntry(index); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/inline-dashboard-page/inline-dashboard-page.component.ts b/packages/angular-sdk-components/src/lib/_components/template/inline-dashboard-page/inline-dashboard-page.component.ts index b66a4f42..cbf4df8e 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/inline-dashboard-page/inline-dashboard-page.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/inline-dashboard-page/inline-dashboard-page.component.ts @@ -45,8 +45,8 @@ export class InlineDashboardPageComponent implements OnInit, OnChanges { updateSelf() { this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as InlineDashboardPageProps; - const arChildren$ = this.pConn$.getChildren() as any[]; - const allFilters = (this.pConn$.getRawMetadata() as any).children[1]; + const arChildren$ = this.pConn$.getChildren(); + const allFilters = this.pConn$.getRawMetadata()?.children[1]; const filterComponents = buildFilterComponents(this.pConn$, allFilters); this.inlineProps = this.configProps$; this.children[0] = arChildren$[0]; diff --git a/packages/angular-sdk-components/src/lib/_components/template/narrow-wide-form/narrow-wide-form.component.ts b/packages/angular-sdk-components/src/lib/_components/template/narrow-wide-form/narrow-wide-form.component.ts index ebac69a1..cbf66833 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/narrow-wide-form/narrow-wide-form.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/narrow-wide-form/narrow-wide-form.component.ts @@ -29,6 +29,6 @@ export class NarrowWideFormComponent implements OnInit, OnChanges { } updateSelf() { - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/one-column-tab/one-column-tab.component.ts b/packages/angular-sdk-components/src/lib/_components/template/one-column-tab/one-column-tab.component.ts index 780838c6..6d8fd4f8 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/one-column-tab/one-column-tab.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/one-column-tab/one-column-tab.component.ts @@ -29,6 +29,6 @@ export class OneColumnTabComponent implements OnInit, OnChanges { } updateSelf() { - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/one-column/one-column.component.ts b/packages/angular-sdk-components/src/lib/_components/template/one-column/one-column.component.ts index 52bdd9be..6ef338d9 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/one-column/one-column.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/one-column/one-column.component.ts @@ -29,6 +29,6 @@ export class OneColumnComponent implements OnInit, OnChanges { } updateSelf() { - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/page/page.component.ts b/packages/angular-sdk-components/src/lib/_components/template/page/page.component.ts index c076a191..eef282bd 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/page/page.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/page/page.component.ts @@ -34,7 +34,7 @@ export class PageComponent implements OnInit, OnDestroy { this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange); this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as PageProps; - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); this.title$ = this.configProps$.title; const operator = this.configProps$.operator; diff --git a/packages/angular-sdk-components/src/lib/_components/template/promoted-filters/promoted-filters.component.ts b/packages/angular-sdk-components/src/lib/_components/template/promoted-filters/promoted-filters.component.ts index 306a8826..8c4c9c06 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/promoted-filters/promoted-filters.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/promoted-filters/promoted-filters.component.ts @@ -81,7 +81,7 @@ export class PromotedFiltersComponent implements OnInit, OnDestroy { }); const filtersWithClassID = { ...this.filtersProperties, classID: this.pageClass }; - this.transientItemID = (this.pConn$.getContainerManager() as any).addTransientItem({ id: this.viewName, data: filtersWithClassID }); + this.transientItemID = this.pConn$.getContainerManager().addTransientItem({ id: this.viewName, data: filtersWithClassID }); this.processedFilters = []; this.filters.forEach(filter => { const filterClone = { ...filter }; diff --git a/packages/angular-sdk-components/src/lib/_components/template/repeating-structures/repeating-structures.component.ts b/packages/angular-sdk-components/src/lib/_components/template/repeating-structures/repeating-structures.component.ts index ad79be50..9610121d 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/repeating-structures/repeating-structures.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/repeating-structures/repeating-structures.component.ts @@ -107,7 +107,7 @@ export class RepeatingStructuresComponent implements OnInit, AfterViewInit { openAssignment(row) { const { pxRefObjectClass, pzInsKey } = row; const sTarget = this.pConn$.getContainerName(); - const options: any = { containerName: sTarget }; + const options = { containerName: sTarget }; this.pConn$ .getActionsApi() .openAssignment(pzInsKey, pxRefObjectClass, options) diff --git a/packages/angular-sdk-components/src/lib/_components/template/simple-table-manual/simple-table-manual.component.ts b/packages/angular-sdk-components/src/lib/_components/template/simple-table-manual/simple-table-manual.component.ts index 2f81a17e..eabff259 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/simple-table-manual/simple-table-manual.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/simple-table-manual/simple-table-manual.component.ts @@ -45,6 +45,7 @@ interface SimpleTableManualProps { displayMode?: string; useSeparateViewForEdit: any; viewForEditModal: any; + targetClassLabel: string; } class Group { @@ -158,6 +159,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy { settingsSvgIcon$: string; isInitialized = false; + targetClassLabel: string; constructor( private angularPConnect: AngularPConnectService, @@ -219,7 +221,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy { // but getRawMetadata() has each child.config with datasource and value showing their unresolved values (ex: "@P thePropName") // We need to use the prop name as the "glue" to tie the Angular Material table dataSource, displayColumns and data together. // So, in the code below, we'll use the unresolved config.value (but replacing the space with an underscore to keep things happy) - const rawMetadata: any = this.pConn$.getRawMetadata(); + const rawMetadata = this.pConn$.getRawMetadata(); // Adapted from Nebula const { @@ -237,13 +239,14 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy { editModeConfig, displayMode, useSeparateViewForEdit, - viewForEditModal + viewForEditModal, + targetClassLabel } = this.configProps$; this.referenceListStr = getContext(this.pConn$).referenceListStr; this.label = labelProp || propertyLabel; this.parameters = fieldMetadata?.datasource?.parameters; - + this.targetClassLabel = targetClassLabel; const hideAddRow = allowTableEdit === false; const hideDeleteRow = allowTableEdit === false; let { contextClass } = this.configProps$; @@ -262,7 +265,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy { // config.value (ex: "@P .DeclarantChoice") or // config.datasource (ex: "@ASSOCIATED .DeclarantChoice") // Neither of these appear in the resolved (this.configProps$) - const rawConfig = rawMetadata?.config; + const rawConfig: any = rawMetadata?.config; const rawFields = rawConfig?.children?.[0]?.children || rawConfig?.presets?.[0].children?.[0]?.children; this.rawFields = rawFields; // At this point, fields has resolvedFields and rawFields we can use @@ -355,7 +358,6 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy { if (this.isInitialized) { this.isInitialized = false; if (this.allowEditingInModal) { - // @ts-ignore - An argument for 'uniqueField' was not provided. this.pConn$.getListActions().initDefaultPageInstructions( this.pConn$.getReferenceList(), this.fieldDefs.filter(item => item.name).map(item => item.name) @@ -918,19 +920,19 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy { .getActionsApi() .openEmbeddedDataModal( this.defaultView, - this.pConn$, + this.pConn$ as any, this.referenceListStr, this.referenceList.length, - PCore.getConstants().RESOURCE_STATUS.CREATE + PCore.getConstants().RESOURCE_STATUS.CREATE, + this.targetClassLabel ); } else { - // @ts-ignore - second parameter "pageRef" is optional for insert method this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length); } this.pConn$.clearErrorMessages({ - property: (this.pConn$.getStateProps() as any)?.referenceList?.substring(1) - } as any); + property: this.pConn$.getStateProps()?.referenceList?.substring(1) + }); } editRecord(data, index) { @@ -939,16 +941,16 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy { .getActionsApi() .openEmbeddedDataModal( this.bUseSeparateViewForEdit ? this.editView : this.defaultView, - this.pConn$, + this.pConn$ as any, this.referenceListStr, index, - PCore.getConstants().RESOURCE_STATUS.UPDATE + PCore.getConstants().RESOURCE_STATUS.UPDATE, + this.targetClassLabel ); } } deleteRecord(index) { - // @ts-ignore - second parameter "pageRef" is optional for deleteEntry method this.pConn$.getListActions().deleteEntry(index); } diff --git a/packages/angular-sdk-components/src/lib/_components/template/simple-table-select/simple-table-select.component.ts b/packages/angular-sdk-components/src/lib/_components/template/simple-table-select/simple-table-select.component.ts index 39885c69..3934b070 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/simple-table-select/simple-table-select.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/simple-table-select/simple-table-select.component.ts @@ -57,7 +57,7 @@ export class SimpleTableSelectComponent implements OnInit, OnDestroy { } updateSelf() { - const theConfigProps: any = this.pConn$.getConfigProps(); + const theConfigProps = this.pConn$.getConfigProps(); this.label = theConfigProps.label; this.renderMode = theConfigProps.renderMode; this.showLabel = theConfigProps.showLabel; @@ -71,7 +71,7 @@ export class SimpleTableSelectComponent implements OnInit, OnDestroy { this.propsToUse.label = ''; } const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE; - const { selectionMode, selectionList }: any = this.pConn$.getConfigProps(); + const { selectionMode, selectionList } = this.pConn$.getConfigProps(); const isMultiSelectMode = selectionMode === MULTI; if (isMultiSelectMode && this.renderMode === 'ReadOnly') { this.showSimpleTableManual = true; @@ -137,7 +137,7 @@ export class SimpleTableSelectComponent implements OnInit, OnDestroy { parameters: this.parameters }; - this.filters = (this.pConn$.getRawMetadata() as any).config.promotedFilters ?? []; + this.filters = (this.pConn$.getRawMetadata()?.config as any).promotedFilters ?? []; this.isSearchable = this.filters.length > 0; } diff --git a/packages/angular-sdk-components/src/lib/_components/template/three-column/three-column.component.ts b/packages/angular-sdk-components/src/lib/_components/template/three-column/three-column.component.ts index e1da4221..25fa2acd 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/three-column/three-column.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/three-column/three-column.component.ts @@ -29,6 +29,6 @@ export class ThreeColumnComponent implements OnInit, OnChanges { } updateSelf() { - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/two-column-tab/two-column-tab.component.ts b/packages/angular-sdk-components/src/lib/_components/template/two-column-tab/two-column-tab.component.ts index ddd2ee6a..f26297f3 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/two-column-tab/two-column-tab.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/two-column-tab/two-column-tab.component.ts @@ -29,6 +29,6 @@ export class TwoColumnTabComponent implements OnInit, OnChanges { } updateSelf() { - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/two-column/two-column.component.ts b/packages/angular-sdk-components/src/lib/_components/template/two-column/two-column.component.ts index 287862dd..133dc34b 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/two-column/two-column.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/two-column/two-column.component.ts @@ -29,6 +29,6 @@ export class TwoColumnComponent implements OnInit, OnChanges { } updateSelf() { - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/wide-narrow-form/wide-narrow-form.component.ts b/packages/angular-sdk-components/src/lib/_components/template/wide-narrow-form/wide-narrow-form.component.ts index c05525dc..532cf4ec 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/wide-narrow-form/wide-narrow-form.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/wide-narrow-form/wide-narrow-form.component.ts @@ -29,6 +29,6 @@ export class WideNarrowFormComponent implements OnInit, OnChanges { } updateSelf() { - this.arChildren$ = this.pConn$.getChildren() as any[]; + this.arChildren$ = this.pConn$.getChildren(); } } diff --git a/packages/angular-sdk-components/src/lib/_components/template/wide-narrow-page/wide-narrow-page.component.ts b/packages/angular-sdk-components/src/lib/_components/template/wide-narrow-page/wide-narrow-page.component.ts index 8ab3c9db..66b35217 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/wide-narrow-page/wide-narrow-page.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/wide-narrow-page/wide-narrow-page.component.ts @@ -15,7 +15,7 @@ export class WideNarrowPageComponent implements OnInit, OnDestroy { @Input() pConn$: typeof PConnect; @Input() formGroup$: FormGroup; - thePConnType = ''; + thePConnType: string | undefined = ''; // Used with AngularPConnect angularPConnectData: AngularPConnectData = {}; diff --git a/packages/angular-sdk-components/src/lib/_components/template/wss-nav-bar/wss-nav-bar.component.ts b/packages/angular-sdk-components/src/lib/_components/template/wss-nav-bar/wss-nav-bar.component.ts index 137a3764..48e152cf 100644 --- a/packages/angular-sdk-components/src/lib/_components/template/wss-nav-bar/wss-nav-bar.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/template/wss-nav-bar/wss-nav-bar.component.ts @@ -37,11 +37,11 @@ export class WssNavBarComponent implements OnInit, OnDestroy { navExpandCollapse$: string; bShowCaseTypes$ = false; - portalApp$ = ''; + portalApp$: string | undefined = ''; portalLogoImage$: string; showAppName$ = false; - portalOperator$: string; + portalOperator$: string | undefined; portalOperatorInitials$: string; actionsAPI: any; @@ -129,7 +129,7 @@ export class WssNavBarComponent implements OnInit, OnDestroy { this.portalLogoImage$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg'); this.portalOperator$ = PCore.getEnvironmentInfo().getOperatorName(); - this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$); + this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$ ?? ''); this.showAppName$ = this.configProps$.showAppName; this.portalApp$ = PCore.getEnvironmentInfo().getApplicationLabel(); diff --git a/packages/angular-sdk-components/src/lib/_components/widget/attachment/attachment.component.ts b/packages/angular-sdk-components/src/lib/_components/widget/attachment/attachment.component.ts index 0fefe34d..94eaf6bd 100644 --- a/packages/angular-sdk-components/src/lib/_components/widget/attachment/attachment.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/widget/attachment/attachment.component.ts @@ -120,7 +120,7 @@ export class AttachmentComponent implements OnInit, OnDestroy { updateSelf() { const configProps: AttachmentProps = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as AttachmentProps; - const stateProps: any = this.pConn$.getStateProps(); + const stateProps = this.pConn$.getStateProps(); const { value, label, extensions, displayMode } = configProps; if (configProps.required != null) { @@ -149,7 +149,7 @@ export class AttachmentComponent implements OnInit, OnDestroy { this.validateMessage = this.angularPConnectData.validateMessage; this.extensions$ = extensions; - this.valueRef = (this.pConn$.getStateProps() as any).value; + this.valueRef = this.pConn$.getStateProps().value; this.valueRef = this.valueRef.startsWith('.') ? this.valueRef.substring(1) : this.valueRef; this.displayMode = displayMode; /* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */ @@ -277,7 +277,7 @@ export class AttachmentComponent implements OnInit, OnDestroy { this.updateAttachmentState(this.pConn$, this.getAttachmentKey(this.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, this.pConn$.getContextName()); } } @@ -317,14 +317,13 @@ export class AttachmentComponent implements OnInit, OnDestroy { )} ${this.extensions$.replaceAll('.', '')}`; } if (f.props.error) { - const fieldName = (this.pConn$.getStateProps() as any).value; + const fieldName = this.pConn$.getStateProps().value; const context = this.pConn$.getContextName(); PCore.getMessageManager().addMessages({ 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', '', '') + message: this.pConn$.getLocalizedValue('Error with one or more files', '', '') } ], property: fieldName, @@ -348,7 +347,7 @@ export class AttachmentComponent implements OnInit, OnDestroy { } clearFieldErrorMessages() { - const fieldName = (this.pConn$.getStateProps() as any).value; + const fieldName = this.pConn$.getStateProps().value; const context = this.pConn$.getContextName(); PCore.getMessageManager().clearMessages({ type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR, @@ -376,14 +375,13 @@ export class AttachmentComponent implements OnInit, OnDestroy { f.props.icon = this.utils.getIconFromFileType(f.type); f.props.name = this.pConn$.getLocalizedValue('Unable to upload file', '', ''); f.inProgress = false; - const fieldName = (this.pConn$.getStateProps() as any).value; + const fieldName = this.pConn$.getStateProps().value; const context = this.pConn$.getContextName(); // set errors to property to block submit even on errors in file upload PCore.getMessageManager().addMessages({ messages: [ { type: 'error', - // @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'. message: this.pConn$.getLocalizedValue('Error with one or more files', '', '') } ], diff --git a/packages/angular-sdk-components/src/lib/_components/widget/feed-container/feed-container.component.ts b/packages/angular-sdk-components/src/lib/_components/widget/feed-container/feed-container.component.ts index 7c093ab4..58d3650a 100644 --- a/packages/angular-sdk-components/src/lib/_components/widget/feed-container/feed-container.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/widget/feed-container/feed-container.component.ts @@ -25,8 +25,8 @@ export class FeedContainerComponent implements OnInit, OnDestroy { // Used with AngularPConnect angularPConnectData: AngularPConnectData = {}; - userName$: string; - imageKey$: string; + userName$: string | undefined; + imageKey$: string | undefined; currentUserInitials$: string; currentUserName$: string; @@ -65,7 +65,7 @@ export class FeedContainerComponent implements OnInit, OnDestroy { ngOnInit(): void { this.userName$ = PCore.getEnvironmentInfo().getOperatorName(); this.imageKey$ = PCore.getEnvironmentInfo().getOperatorImageInsKey(); - this.updateCurrentUserName(this.userName$); + this.updateCurrentUserName(this.userName$ ?? ''); // First thing in initialization is registering and subscribing to the AngularPConnect service this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange); @@ -402,11 +402,11 @@ export class FeedContainerComponent implements OnInit, OnDestroy { } getMessageData() { - const messageIDs = (this.pConn$.getConfigProps() as any).messageIDs; - const userName = (this.pConn$.getConfigProps() as any).currentUser; + const messageIDs = this.pConn$.getConfigProps().messageIDs; + const userName = this.pConn$.getConfigProps().currentUser; const imageKey = this.pConn$.getValue('OperatorID.pyImageInsKey'); - const oData: any = this.pConn$.getDataObject(); + const oData = this.pConn$.getDataObject(); if (messageIDs && messageIDs.length > 0) { this.pulseMessages$ = JSON.parse(JSON.stringify(oData.pulse.messages)); @@ -532,7 +532,7 @@ export class FeedContainerComponent implements OnInit, OnDestroy { // If feedAPI is defined then only post message if (this.feedAPI) { - this./* feedAPI. */ postMessage((this.pConn$.getConfigProps() as any).value, this.pulseConversation); + this./* feedAPI. */ postMessage(this.pConn$.getConfigProps().value, this.pulseConversation); } else { console.log("We don't support Pulse yet"); } diff --git a/packages/angular-sdk-components/src/lib/_components/widget/file-utility/file-utility.component.ts b/packages/angular-sdk-components/src/lib/_components/widget/file-utility/file-utility.component.ts index 40bb6c7b..980e92f1 100644 --- a/packages/angular-sdk-components/src/lib/_components/widget/file-utility/file-utility.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/widget/file-utility/file-utility.component.ts @@ -106,7 +106,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy { this.createModalButtons(); PCore.getPubSubUtils().subscribe( - (PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, + PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, this.updateSelf.bind(this), 'caseAttachmentsUpdateFromCaseview' ); @@ -117,10 +117,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy { this.angularPConnectData.unsubscribeFn(); } - PCore.getPubSubUtils().unsubscribe( - (PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, - 'caseAttachmentsUpdateFromCaseview' - ); + PCore.getPubSubUtils().unsubscribe(PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, 'caseAttachmentsUpdateFromCaseview'); } // Callback passed when subscribing to store change diff --git a/packages/angular-sdk-components/src/lib/_components/widget/todo/todo.component.ts b/packages/angular-sdk-components/src/lib/_components/widget/todo/todo.component.ts index a61306f6..ffb88498 100644 --- a/packages/angular-sdk-components/src/lib/_components/widget/todo/todo.component.ts +++ b/packages/angular-sdk-components/src/lib/_components/widget/todo/todo.component.ts @@ -36,7 +36,7 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges { @Input() isConfirm; configProps$: ToDoProps; - currentUser$: string; + currentUser$: string | undefined; currentUserInitials$ = '--'; assignmentCount$: number; bShowMore$ = true; @@ -59,7 +59,7 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges { ngOnInit() { this.CONSTS = PCore.getConstants(); - const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED }: any = PCore.getEvents().getCaseEvent(); + const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED } = PCore.getEvents().getCaseEvent(); PCore.getPubSubUtils().subscribe( PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, @@ -89,7 +89,7 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges { } ngOnDestroy() { - const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED }: any = PCore.getEvents().getCaseEvent(); + const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED } = PCore.getEvents().getCaseEvent(); PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, 'updateToDo'); @@ -107,7 +107,6 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges { updateWorkList(key) { PCore.getDataApiUtils() - // @ts-ignore - 2nd parameter "payload" and 3rd parameter "context" should be optional in getData method .getData(key) .then(responseData => { const dataObject = {}; @@ -153,7 +152,7 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges { this.canPerform = this.arAssignments$?.[0]?.canPerform === 'true' || this.arAssignments$?.[0]?.canPerform === true; this.currentUser$ = PCore.getEnvironmentInfo().getOperatorName(); - this.currentUserInitials$ = this.utils.getInitials(this.currentUser$); + this.currentUserInitials$ = this.utils.getInitials(this.currentUser$ ?? ''); } getID(assignment: any) { diff --git a/packages/angular-sdk-components/src/lib/_directives/thousand-seperator.directive.ts b/packages/angular-sdk-components/src/lib/_directives/thousand-seperator.directive.ts index 9a6c9908..4b1e492e 100644 --- a/packages/angular-sdk-components/src/lib/_directives/thousand-seperator.directive.ts +++ b/packages/angular-sdk-components/src/lib/_directives/thousand-seperator.directive.ts @@ -10,7 +10,7 @@ export class ThousandSeparatorDirective { @HostListener('input', ['$event']) onInput(event) { const input = this.el.nativeElement as HTMLInputElement; - let value: any = input.value.replace(/,/g, ''); // Remove existing commas + let value = input.value.replace(/,/g, ''); // Remove existing commas if (event?.data !== '.') { value = Number(value).toLocaleString(); // Add thousands separator input.value = value; diff --git a/packages/angular-sdk-components/src/lib/_helpers/filter-utils.ts b/packages/angular-sdk-components/src/lib/_helpers/filter-utils.ts index 33134a8d..051520e0 100644 --- a/packages/angular-sdk-components/src/lib/_helpers/filter-utils.ts +++ b/packages/angular-sdk-components/src/lib/_helpers/filter-utils.ts @@ -45,7 +45,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' }; diff --git a/packages/angular-sdk-components/src/lib/_messages/error-messages.service.ts b/packages/angular-sdk-components/src/lib/_messages/error-messages.service.ts index aad83276..b38471f3 100644 --- a/packages/angular-sdk-components/src/lib/_messages/error-messages.service.ts +++ b/packages/angular-sdk-components/src/lib/_messages/error-messages.service.ts @@ -20,7 +20,7 @@ export class ErrorMessagesService { this.subject.next(); } - getMessage(): Observable { + getMessage(): Observable { return this.subject.asObservable(); } } diff --git a/packages/angular-sdk-components/src/lib/_messages/get-login-status.service.ts b/packages/angular-sdk-components/src/lib/_messages/get-login-status.service.ts index 2f3dd1eb..5e4b98a9 100644 --- a/packages/angular-sdk-components/src/lib/_messages/get-login-status.service.ts +++ b/packages/angular-sdk-components/src/lib/_messages/get-login-status.service.ts @@ -15,7 +15,7 @@ export class GetLoginStatusService { this.subject.next(); } - getMessage(): Observable { + getMessage(): Observable { return this.subject.asObservable(); } } diff --git a/packages/angular-sdk-components/src/lib/_messages/oauth-response.service.ts b/packages/angular-sdk-components/src/lib/_messages/oauth-response.service.ts index d24b4b67..41ec607c 100644 --- a/packages/angular-sdk-components/src/lib/_messages/oauth-response.service.ts +++ b/packages/angular-sdk-components/src/lib/_messages/oauth-response.service.ts @@ -19,7 +19,7 @@ export class OAuthResponseService { this.subject.next(); } - getMessage(): Observable { + getMessage(): Observable { return this.subject.asObservable(); } } diff --git a/playwright.config.js b/playwright.config.js index d5c3d98b..97a48476 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -14,7 +14,7 @@ const { devices } = require('@playwright/test'); const config = { testDir: 'projects/angular-test-app/tests', /* Maximum time one test can run for. */ - timeout: 120 * 1000, + timeout: 120 * 1000 * 2, expect: { /** * Maximum time expect() should wait for the condition to be met. diff --git a/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.ts b/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.ts index 2286a761..d89010d7 100644 --- a/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.ts +++ b/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.ts @@ -107,7 +107,8 @@ export class MainScreenComponent implements OnInit, OnDestroy { this.scservice.getSdkConfig().then(sdkConfig => { let mashupCaseType = sdkConfig.serverConfig.appMashupCaseType; if (!mashupCaseType) { - const caseTypes = (PCore.getEnvironmentInfo().environmentInfoObject as any).pyCaseTypeList; + // @ts-ignore - Object is possibly 'null' + const caseTypes: any = PCore.getEnvironmentInfo().environmentInfoObject.pyCaseTypeList; mashupCaseType = caseTypes[0].pyWorkTypeImplementationClassName; } @@ -120,9 +121,11 @@ export class MainScreenComponent implements OnInit, OnDestroy { } : {} }; - (PCore.getMashupApi().createCase(mashupCaseType, PCore.getConstants().APP.APP, options) as Promise).then(() => { - console.log('createCase rendering is complete'); - }); + PCore.getMashupApi() + .createCase(mashupCaseType, PCore.getConstants().APP.APP, options) + .then(() => { + console.log('createCase rendering is complete'); + }); }); } diff --git a/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.ts b/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.ts index 03a4031e..de947e0f 100644 --- a/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.ts +++ b/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.ts @@ -38,7 +38,7 @@ export class MCNavComponent implements OnInit, OnDestroy { starterPackVersion$: string = endpoints.SP_VERSION; pConn$: typeof PConnect; - applicationLabel = ''; + applicationLabel: string | undefined = ''; bLoggedIn$ = false; bPConnectLoaded$ = false; bHasPConnect$ = false; @@ -141,7 +141,7 @@ export class MCNavComponent implements OnInit, OnDestroy { compareSdkPCoreVersions(); this.applicationLabel = PCore.getEnvironmentInfo().getApplicationLabel(); - this.titleService.setTitle(this.applicationLabel); + this.titleService.setTitle(this.applicationLabel ?? ''); // Initialize the SdkComponentMap (local and pega-provided) getSdkComponentMap(localSdkComponentMap).then((theComponentMap: any) => { diff --git a/projects/angular-test-app/src/app/_samples/full-portal/top-app-mashup/top-app-mashup.component.ts b/projects/angular-test-app/src/app/_samples/full-portal/top-app-mashup/top-app-mashup.component.ts index 4b9c8cf2..9a75c67b 100644 --- a/projects/angular-test-app/src/app/_samples/full-portal/top-app-mashup/top-app-mashup.component.ts +++ b/projects/angular-test-app/src/app/_samples/full-portal/top-app-mashup/top-app-mashup.component.ts @@ -28,7 +28,7 @@ declare global { export class TopAppMashupComponent implements OnInit, OnDestroy { pConn$: typeof PConnect; - sComponentName$: string; + sComponentName$: string | undefined; bPCoreReady$ = false; bLoggedIn$ = false; @@ -40,7 +40,7 @@ export class TopAppMashupComponent implements OnInit, OnDestroy { portalSelectionScreen = false; availablePortals: string[]; - defaultPortalName: string; + defaultPortalName: string | undefined; constructor( private psservice: ProgressSpinnerService, diff --git a/projects/angular-test-app/src/app/_samples/simple-portal/main-content/main-content.component.ts b/projects/angular-test-app/src/app/_samples/simple-portal/main-content/main-content.component.ts index 8796ea3e..9f42b12a 100644 --- a/projects/angular-test-app/src/app/_samples/simple-portal/main-content/main-content.component.ts +++ b/projects/angular-test-app/src/app/_samples/simple-portal/main-content/main-content.component.ts @@ -12,7 +12,7 @@ import { ComponentMapperComponent } from '../../../../../../../packages/angular- export class MainContentComponent implements OnInit { @Input() pConn$: typeof PConnect; - sComponentName$: string; + sComponentName$: string | undefined; ngOnInit(): void { if (this.pConn$) {