Skip to content

Commit e600a6c

Browse files
authored
Merge pull request #7281 from SalesforceFoundation/feature/256__W-17898954-checkbox-value-error-on-gift-entry
W-17898954 - checkbox validation error on gift entry
2 parents 574a3af + 452e04b commit e600a6c

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

force-app/main/default/classes/BDI_DataImportService.cls

+1-1
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,7 @@ global with sharing class BDI_DataImportService {
22662266

22672267
for (String diField : diFieldToTargetFieldMap.keySet()){
22682268
// Set the is populated flag to true if the field should not be ignored, and it does have a value in the DI
2269-
Boolean shouldAddPopulatedField = !fieldsToIgnore.contains(diField.toLowerCase()) && di.get(diField) != null;
2269+
Boolean shouldAddPopulatedField = !fieldsToIgnore.contains(diField.toLowerCase()) && di.get(diField) != null && di.get(diField) != false;
22702270
if (shouldAddPopulatedField) {
22712271
isPopulated = true;
22722272
break;

force-app/main/default/lwc/geBatchWizard/geBatchWizard.js

+11-15
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
6868
@track hasInvalidBatchFields = false;
6969
@track missingBatchHeaderFieldLabels = [];
7070
@track missingRequiredFieldsMessage;
71+
@track allowFirstInstallment = false;
7172

7273
dataImportBatchFieldInfos;
7374
dataImportBatchInfo;
@@ -90,7 +91,6 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
9091
third: 2
9192
}
9293

93-
_allowFirstInstallment = false;
9494
_allowFirstInstallmentDisabled;
9595
_allowRecurringDonations = false;
9696

@@ -119,28 +119,16 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
119119
const isChecked = event.detail.value
120120
this._allowRecurringDonations = isChecked;
121121
if (!isChecked) {
122-
this._allowFirstInstallment = false;
122+
this.allowFirstInstallment = false;
123123
this._allowFirstInstallmentDisabled = true;
124124
} else {
125125
this._allowFirstInstallmentDisabled = false;
126126
}
127127

128128
}
129129

130-
get allowFirstInstallment () {
131-
if (this.isEditMode && this._allowRecurringDonations) {
132-
let batchLevelDefaults =
133-
JSON.parse(this.dataImportBatchRecord.fields[DATA_IMPORT_BATCH_DEFAULTS_INFO.fieldApiName].value);
134-
return batchLevelDefaults['AllowFirstInstallment__f'] ?
135-
batchLevelDefaults['AllowFirstInstallment__f'].value :
136-
false;
137-
}
138-
139-
return this._allowFirstInstallment;
140-
}
141-
142130
handleAllowFirstInstallmentOnChange(event) {
143-
this._allowFirstInstallment = event.detail.value;
131+
this.allowFirstInstallment = event.detail.value;
144132
}
145133

146134
get allowFirstInstallmentDisabled() {
@@ -272,9 +260,17 @@ export default class geBatchWizard extends NavigationMixin(LightningElement) {
272260
?.fields[DATA_IMPORT_BATCH_ALLOW_RECURRING_DONATIONS.fieldApiName]
273261
?.value;
274262

263+
if (!this._allowRecurringDonations) {
264+
this._allowFirstInstallmentDisabled = true;
265+
}
266+
275267
let batchLevelDefaults =
276268
JSON.parse(this.dataImportBatchRecord.fields[DATA_IMPORT_BATCH_DEFAULTS_INFO.fieldApiName].value);
277269

270+
this.allowFirstInstallment = batchLevelDefaults['AllowFirstInstallment__f'] ?
271+
batchLevelDefaults['AllowFirstInstallment__f'].value :
272+
false;
273+
278274
this.formSections.forEach(section => {
279275
if (section.elements) {
280276
section.elements.forEach(element => {

force-app/main/default/lwc/geFormRenderer/geFormRenderer.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -2651,11 +2651,14 @@ export default class GeFormRenderer extends LightningElement{
26512651
? this.CUSTOM_LABELS.geTextUpdating
26522652
: this.CUSTOM_LABELS.geTextSaving;
26532653
delete dataImportFromFormState[apiNameFor(PAYMENT_AUTHORIZE_TOKEN)];
2654+
const dataImportfieldsInfo = this.dataImportObjectInfo?.data?.fields || {};
26542655
Object.keys(dataImportFromFormState).forEach((field)=>{
2655-
if(dataImportFromFormState[field] === undefined) {
2656-
dataImportFromFormState[field] = null;
2656+
if (dataImportfieldsInfo[field]?.dataType === 'Boolean' && dataImportFromFormState[field] === undefined) {
2657+
dataImportFromFormState[field] = false;
2658+
} else {
2659+
dataImportFromFormState[field] ??= null;
26572660
}
2658-
})
2661+
});
26592662
const upsertResponse = await upsertDataImport({
26602663
dataImport: JSON.stringify(dataImportFromFormState)
26612664
});

force-app/main/default/lwc/geListView/geListView.js

-2
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,12 @@ export default class geListView extends LightningElement {
287287

288288
this.isLoading = false;
289289

290-
console.log('Test 1');
291290
let style = document.createElement('style');
292291
style.innerText = '.slds-table_header-fixed_container{border: 1px solid red;}';
293292
let dt = this.template.querySelector('lightning-datatable');
294293
if(dt) {
295294
dt.appendChild(style);
296295
}
297-
console.log('Test 2');
298296
}
299297

300298
/*******************************************************************************

0 commit comments

Comments
 (0)