diff --git a/.gitignore b/.gitignore index 00c704e472..56d032e167 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,8 @@ robot/Cumulus/results/ datasets/dev_org/test_data.db *.db .cci - +.sfdx +.sf # LWC force-app/main/default/lwc/.eslintrc.json /node_modules diff --git a/force-app/main/default/labels/CustomLabels.labels-meta.xml b/force-app/main/default/labels/CustomLabels.labels-meta.xml index c7b82c65a9..3f57f0b6b4 100644 --- a/force-app/main/default/labels/CustomLabels.labels-meta.xml +++ b/force-app/main/default/labels/CustomLabels.labels-meta.xml @@ -5844,6 +5844,13 @@ To check your GAU Allocation settings, go to Donations | GAU Allocations.Button to process a batch and payments through {0} Process Batch & Payments + + bgeEditPaymentInformation + en_US + true + Warns users to re-enter payment information when editing Elevate-connected gifts + You can't edit this Elevate-connected gift until you re-enter the payment information. Select Edit Payment Information. + bgeRetirementWarningBody Batch Data Entry @@ -9810,14 +9817,6 @@ If preferred, you can disable Gift Entry and instead use older Batch Gift Entry Warning about processing batch when authorizations have expired One or more card authorizations expired. To ensure these payments are charged when processing the batch, reenter the payment information for donations with an Elevate Payment Status of Expired Authorization. - - gePaymentProcessedWarning - Gift Entry - en_US - true - Warning about editing fields when transaction already processed - {0} successfully processed the payment. Changing the donor, date, amount, or payment method will result in inconsistent records for the same transaction in {0} and NPSP. - gePaymentProcessError Gift Entry diff --git a/force-app/main/default/lwc/geElevateBatch/geElevateBatch.js b/force-app/main/default/lwc/geElevateBatch/geElevateBatch.js index 22b3fd2965..171aec18ea 100644 --- a/force-app/main/default/lwc/geElevateBatch/geElevateBatch.js +++ b/force-app/main/default/lwc/geElevateBatch/geElevateBatch.js @@ -1,10 +1,7 @@ import apexAddToElevateBatch from '@salesforce/apex/GE_GiftEntryController.addToElevateBatch'; import apexCreateElevateBatch from '@salesforce/apex/GE_GiftEntryController.createElevateBatch'; import apexRemoveFromElevateBatch from '@salesforce/apex/GE_GiftEntryController.removeFromElevateBatch'; -import PAYMENT_ELEVATE_ID from '@salesforce/schema/DataImport__c.Payment_Elevate_ID__c'; -import RECURRING_DONATION_ID from '@salesforce/schema/DataImport__c.Recurring_Donation_Elevate_Recurring_ID__c'; import PAYMENT_ELEVATE_ELEVATE_BATCH_ID from '@salesforce/schema/DataImport__c.Payment_Elevate_Batch_Id__c'; -import GeGatewaySettings from 'c/geGatewaySettings'; class ElevateBatch { @@ -43,9 +40,8 @@ class ElevateBatch { async remove(batchItem) { return await apexRemoveFromElevateBatch({ batchItem: { - elevateBatchId: batchItem[PAYMENT_ELEVATE_ELEVATE_BATCH_ID.fieldApiName], - id: batchItem[PAYMENT_ELEVATE_ID.fieldApiName] ? batchItem[PAYMENT_ELEVATE_ID.fieldApiName] : - batchItem[RECURRING_DONATION_ID.fieldApiName] + elevateBatchId: batchItem.getFieldValue(PAYMENT_ELEVATE_ELEVATE_BATCH_ID.fieldApiName), + id: batchItem.idToRemove() } }); } diff --git a/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js b/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js index c529d46a82..fe5ad32bb7 100644 --- a/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js +++ b/force-app/main/default/lwc/geFormRenderer/__tests__/geFormRenderer.test.js @@ -16,6 +16,7 @@ import { mockCheckComboboxValidity } from 'lightning/combobox'; import { mockGetIframeReply } from 'c/psElevateTokenHandler'; import donationImported from '@salesforce/schema/DataImport__c.DonationImported__c'; +import { DEFAULT_FORM_FIELDS } from '../../utilTemplateBuilder/utilTemplateBuilder'; const mockWrapperWithNoNames = require('../../../../../../tests/__mocks__/apex/data/retrieveDefaultSGERenderWrapper.json'); const getRecordContact1Imported = require('./data/getRecordContact1Imported.json'); @@ -47,10 +48,38 @@ describe('c-ge-form-renderer', () => { return config.recordId === DUMMY_BATCH_ID; }); + await flushPromises(); + + const button = element.shadowRoot.querySelectorAll('[data-id="recurringButton"]'); + expect(button).toHaveLength(1); + }); + + it('make recurring button is disabled when imported gift is loaded into the form', async() => { + retrieveDefaultSGERenderWrapper.mockResolvedValue(mockWrapperWithNoNames); + getAllocationsSettings.mockResolvedValue(allocationsSettingsNoDefaultGAU); + const element = createElement('c-ge-form-renderer', {is: GeFormRenderer }); + + const DUMMY_BATCH_ID = 'a0T11000007F8WQEA0'; + + element.batchId = DUMMY_BATCH_ID; + document.body.appendChild(element); + await flushPromises(); + + // simulate getting back data for DUMMY_CONTACT_ID + getRecord.emit(dataImportBatchRecord, config => { + return config.recordId === DUMMY_BATCH_ID; + }); + await flushPromises(); const button = element.shadowRoot.querySelectorAll('[data-id="recurringButton"]'); expect(button).toHaveLength(1); + + element.isMakeRecurringButtonDisabled = true; + await flushPromises(); + + const disabledButton = element.shadowRoot.querySelectorAll('[data-id="recurringButton"]'); + expect(disabledButton[0].disabled).toBe(true); }); it('when a form is saved with a possible validation rule error then processing of the donation should be halted', @@ -187,39 +216,6 @@ describe('c-ge-form-renderer', () => { expect(componentName).toBe('geModalRecurringDonation'); }); - it('dispatches an event to display a warning modal when adding schedule for gift matched to existing opportunity', async () => { - retrieveDefaultSGERenderWrapper.mockResolvedValue(mockWrapperWithNoNames); - getAllocationsSettings.mockResolvedValue(allocationsSettingsNoDefaultGAU); - const element = createElement('c-ge-form-renderer', {is: GeFormRenderer }); - const DUMMY_BATCH_ID = 'a0T11000007F8WQEA0'; - - element.batchId = DUMMY_BATCH_ID; - - document.body.appendChild(element); - - await flushPromises(); - - // simulate getting back data for DUMMY_CONTACT_ID - getRecord.emit(dataImportBatchRecord, config => { - return config.recordId === DUMMY_BATCH_ID; - }); - element.giftInView = { - fields: { [donationImported.fieldApiName]: 'dummy_opportunity_id' } - }; - - await flushPromises(); - - const dispatchEventSpy = jest.spyOn(element, 'dispatchEvent'); - const button = element.shadowRoot.querySelector('[data-id="recurringButton"]'); - button.click(); - - await flushPromises(); - - expect(dispatchEventSpy).toHaveBeenCalledTimes(1); - const componentName = dispatchEventSpy.mock.calls[0][0].detail.modalProperties.componentName; - expect(componentName).toBe('geModalPrompt'); - }); - it('dispatches an event to display a warning modal when adding schedule for gift with net new soft credits', async () => { retrieveDefaultSGERenderWrapper.mockResolvedValue(mockWrapperWithNoNames); getAllocationsSettings.mockResolvedValue(allocationsSettingsNoDefaultGAU); @@ -256,43 +252,6 @@ describe('c-ge-form-renderer', () => { const componentName = dispatchEventSpy.mock.calls[0][0].detail.modalProperties.componentName; expect(componentName).toBe('geModalPrompt'); }); - - it('dispatches an event to display a warning modal when adding schedule for gift with elevate authorization', async () => { - retrieveDefaultSGERenderWrapper.mockResolvedValue(mockWrapperWithNoNames); - getAllocationsSettings.mockResolvedValue(allocationsSettingsNoDefaultGAU); - const element = createElement('c-ge-form-renderer', {is: GeFormRenderer }); - const DUMMY_BATCH_ID = 'a0T11000007F8WQEA0'; - - element.batchId = DUMMY_BATCH_ID; - - document.body.appendChild(element); - - await flushPromises(); - - // simulate getting back data for DUMMY_CONTACT_ID - getRecord.emit(dataImportBatchRecord, config => { - return config.recordId === DUMMY_BATCH_ID; - }); - element.giftInView = { - fields: { - 'Payment_Method__c': 'Credit Card', - 'Donation_Amount__c': '0.01', - 'Payment_Status__c': 'AUTHORIZED' - } - }; - - await flushPromises(); - - const dispatchEventSpy = jest.spyOn(element, 'dispatchEvent'); - const button = element.shadowRoot.querySelector('[data-id="recurringButton"]'); - button.click(); - - await flushPromises(); - - expect(dispatchEventSpy).toHaveBeenCalledTimes(1); - const componentName = dispatchEventSpy.mock.calls[0][0].detail.modalProperties.componentName; - expect(componentName).toBe('geModalPrompt'); - }); }); it('loads a template with four sections', async () => { diff --git a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.html b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.html index 18991aabe3..ae5d16e12b 100644 --- a/force-app/main/default/lwc/geFormRenderer/geFormRenderer.html +++ b/force-app/main/default/lwc/geFormRenderer/geFormRenderer.html @@ -114,19 +114,6 @@ -