Skip to content

Commit

Permalink
upgraded typedef to 3.2.1 (#231)
Browse files Browse the repository at this point in the history
* updated todo component with if condition on go action button

* upgraded typedef to 3.2.1

Co-authored-by: mohas22 <[email protected]>
  • Loading branch information
samhere06 and mohas22 authored Nov 21, 2024
1 parent a160a9a commit 20cf5fe
Show file tree
Hide file tree
Showing 77 changed files with 195 additions and 202 deletions.
11 changes: 6 additions & 5 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.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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ export class CaseCreateStageComponent implements OnInit, OnDestroy {
}

updateSelf() {
this.arChildren$ = this.pConn$.getChildren() as any[];
this.arChildren$ = this.pConn$.getChildren();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ 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());
// this.currentUser$ = this.configProps$.currentUser;
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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 != '') {
Expand All @@ -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 === ',') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 != '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface DateProps extends PConnFieldProps {
}

class MyFormat {
theDateFormat: any = getDateFormatInfo();
theDateFormat = getDateFormatInfo();

get display() {
return {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 != '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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, '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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...', '', '') });
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '') {
Expand All @@ -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 === ',') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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: '',
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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$,
Expand All @@ -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;
});
Expand Down
Loading

0 comments on commit 20cf5fe

Please sign in to comment.