Skip to content

Commit

Permalink
v1.6.27 - Concat Delimiter Supports New Line (#597)
Browse files Browse the repository at this point in the history
* Optimizes an if statement to the outside of a for loop when it isn't necessary to filter children prior to rolling up
* Tech debt cleanup - removes blanket Deeply Nested If Statement PMD suppression
* Further cleaned up one of the conditionals in RollupCalcItemReplacer by taking advantage of null coalesce
* Fixes #595 - thanks to @jongpie for reminding me to update the DLRS migration scripts
  • Loading branch information
jamessimone committed Jun 12, 2024
1 parent 8fa1867 commit da030d4
Show file tree
Hide file tree
Showing 24 changed files with 403 additions and 389 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engines-strict=true
registry=https://registry.npmjs.org/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ As well, don't miss [the Wiki](../../wiki), which includes even more info for co

## Deployment & Setup

<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObCnAAK">
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObL7AAK">
<img alt="Deploy to Salesforce"
src="./media/deploy-package-to-prod.png">
</a>

<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObCnAAK">
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObL7AAK">
<img alt="Deploy to Salesforce Sandbox"
src="./media/deploy-package-to-sandbox.png">
</a>
Expand Down
1 change: 0 additions & 1 deletion config/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<exclude name="PropertyNamingConventions"/>
</rule>
<rule ref="category/apex/design.xml">
<exclude name="AvoidDeeplyNestedIfStmts"/>
<exclude name="CognitiveComplexity"/>
<exclude name="CyclomaticComplexity"/>
<exclude name="ExcessiveClassLength"/>
Expand Down
19 changes: 19 additions & 0 deletions extra-tests/classes/RollupCalculatorTests.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,25 @@ private class RollupCalculatorTests {
System.assertEquals(distinct + ' -- ' + nonDistinctOpp.Name, calc.getReturnValue(), 'distinct values should be concatenated with custom delimiter!');
}

@IsTest
static void shouldProperlyAccountForPreExistingValueWitNewLineDelimiter() {
String distinct = 'distinct';
RollupCalculator calc = getCalculator(
distinct,
Rollup.Op.CONCAT_DISTINCT,
Opportunity.Name,
Account.Name,
new Rollup__mdt(ConcatDelimiter__c = '\\n'),
'0011g00003VDGbF002',
Opportunity.AccountId
);
Opportunity opp = new Opportunity(Id = '0066g00003VDGbF001', Name = distinct, AccountId = '0016g00003VDGbF001');
Opportunity nonDistinctOpp = new Opportunity(Id = '0066g00003VDGbF001', Name = 'non' + distinct, AccountId = '0016g00003VDGbF001');
calc.performRollup(new List<Opportunity>{ opp, nonDistinctOpp }, new Map<Id, SObject>());

System.assertEquals(distinct + '\n' + nonDistinctOpp.Name, String.valueOf(calc.getReturnValue()).trim());
}

@IsTest
static void shouldSplitCalcItemsOnConcatDelimiterWhenSupplied() {
RollupCalculator calc = getCalculator(
Expand Down
2 changes: 1 addition & 1 deletion extra-tests/classes/RollupFlowTests.cls
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ private class RollupFlowTests {
ex = e;
}

System.assertEquals('Concat delimiter should only be supplied for CONCAT-based rollups.', ex?.getMessage());
System.assertEquals('Concat delimiter should only be supplied for CONCAT-based rollups.', ex?.getMessage().trim());
}

@IsTest
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apex-rollup",
"version": "1.6.26",
"version": "1.6.27",
"description": "Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -58,4 +58,4 @@
"test:apex": "sh ./scripts/runLocalTests.sh",
"test:lwc": "sfdx-lwc-jest --coverage --skipApiVersionCheck"
}
}
}
4 changes: 2 additions & 2 deletions rollup-namespaced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ For more info, see the base `README`.

## Deployment & Setup

<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObCxAAK">
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObLCAA0">
<img alt="Deploy to Salesforce"
src="./media/deploy-package-to-prod.png">
</a>

<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObCxAAK">
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t6g000008ObLCAA0">
<img alt="Deploy to Salesforce Sandbox"
src="./media/deploy-package-to-sandbox.png">
</a>
3 changes: 2 additions & 1 deletion rollup-namespaced/sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"apex-rollup-namespaced": "0Ho6g000000PBMjCAO",
"apex-rollup-namespaced@1.1.18": "04t6g000008Ob1iAAC",
"apex-rollup-namespaced@1.1.19": "04t6g000008ObCsAAK",
"apex-rollup-namespaced@1.1.20": "04t6g000008ObCxAAK"
"apex-rollup-namespaced@1.1.20": "04t6g000008ObCxAAK",
"apex-rollup-namespaced@1.1.21": "04t6g000008ObLCAA0"
}
}
Loading

0 comments on commit da030d4

Please sign in to comment.