Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

RD2: Fixing a bug where the Installment Number does not appear #6691

Merged
merged 4 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion force-app/main/default/classes/RD2_EntryFormController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ public with sharing class RD2_EntryFormController {
? null
: parentId.getSobjectType().getDescribe().getName();

String defaultRecurringType = UTIL_Describe.getDefaultSelectOption(
'npe03__Recurring_Donation__c', String.valueOf(npe03__Recurring_Donation__c.RecurringType__c)
);

return new Map<String, Object> {
'isAutoNamingEnabled' => RD2_NamingService.isAutomaticNamingEnabled,
'isMultiCurrencyEnabled' => UserInfo.isMultiCurrencyOrganization(),
Expand All @@ -89,7 +93,8 @@ public with sharing class RD2_EntryFormController {
'isElevateCustomer' => RD2_ElevateIntegrationService.isIntegrationEnabled(),
'isChangeLogEnabled' => RD2_ChangeLogService.isChangeLogEnabled,
'periodToYearlyFrequencyMap' => RD2_Constants.PERIOD_TO_YEARLY_FREQUENCY,
'closedStatusValues' => RD2_StatusMapper.getInstance().getClosedStatusValues()
'closedStatusValues' => RD2_StatusMapper.getInstance().getClosedStatusValues(),
'defaultRecurringType' => defaultRecurringType
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ private with sharing class RD2_EntryFormController_TEST {
'Installment_Period__c.IsCreatable should return true');
System.assert(orgSettingsByKey.get('customFieldSets') instanceof List<RD2_EntryFormController.CustomField>,
'A list of Custom Fields should be returned');
System.assert(orgSettingsByKey.get('periodToYearlyFrequencyMap') instanceof Map<String, Integer>,
'A map of String to Integer should be returned');
System.assert(orgSettingsByKey.get('defaultRecurringType') instanceof String,
'A String value should be returned');
}

/***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ export default class rd2EntryFormScheduleSection extends LightningElement {

this.disableInstallmentFrequencyField = this.shouldDisableField(response.InstallmentFrequencyPermissions);
this.hideInstallmentFrequencyField = this.shouldHideField(response.InstallmentFrequencyPermissions);

let recurringType = this.getRecurringType();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to add a Jest test for this, if possible, hoping to look into it next week.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we don't have Jest tests for this component yet, I'm going to skip testing this via Jest (for now)

recurringType = recurringType != null ? recurringType : response.defaultRecurringType;
this.updatePlannedInstallmentsVisibility(recurringType);
})
.catch((error) => {
// handleError(error);
Expand Down