Skip to content

Commit

Permalink
Feature/first last rollups (#39)
Browse files Browse the repository at this point in the history
* Fix formatting from #37

* Updated README with Entity Definition limitations of CMDT

* Bump API version to 51

* Add VS Code settings for spaces to aid with local development across machines

* Fixes #34 by adding support for first/last operations.

* Update Contributing guidelines and bump version

* Address issue with #38 by exposing first/last operations via global static Apex methods, as well as allowing for the use of default values from those code paths, which had unintentionally deviated from the behavior present on the CMDT-based route
  • Loading branch information
jamessimone authored Feb 22, 2021
1 parent ef3e12a commit 1f87bac
Show file tree
Hide file tree
Showing 27 changed files with 2,267 additions and 805 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ fflib*
dmc_config.json
yarn.lock
.sfdx/
.vscode/
.localdevserver/
debug.log
DEVHUB_SFDX_URL.txt
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.insertSpaces": true,
"editor.tabSize": 2,
"salesforcedx-vscode-core.show-cli-success-msg": false,
}
2 changes: 1 addition & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ When submitting a pull request, please follow these guidelines:
- ensure your dependencies have been installed and that any/all file(s) changed have had prettier-apex run on them (usually as simple as enabling "Format On Save" in your editor's options); alternatively you can always format the document in Vs Code using `Shift + Ctrl + F` or `cmd + Shift + F` once you're done writing. Your mileage may vary as to the hotkey if you're using Illuminated Cloud or another text editor; you always have the option of invoking prettier on the command-line
- ensure that tests have been run against a scratch org. You can use `sfdx force:org:display --verbose` to get the `Sfdx Auth Url` for the org you're developing against - just store the value of that in a text file named `DEVHUB_SFDX_URL.txt` in the root directory of this repo (it's Git ignored; you'll never commit your credentials or expose them in any way). After that, validating that everything is working correctly is as simple as running the included `scripts/test.sh` script, or `scripts/test.ps1` if you're on a Windows machine.
- ensure that any change to production code comes with the addition of tests. It's possible that I will accept PRs where _only_ production-level code is changed, if an optimization is put in place -- but otherwise, try to write a failing test first!
- there is another directory, `extra-tests`, included to provide code coverage for the accessing of custom fields linked as Field Definitions within `Rollup__mdt`. If you didn't touch the `getSObjectFieldByName` method in `Rollup`, you're probably fine without having to deploy/run that test file. Otherwise, you may need to add `extra-tests` temporarily to your `sfdx-project.json` file in order to have everything run smoothly. The reason these are optional test(s) is because they rely on custom fields, which I do not want anybody to have to install in their own orgs beyond what is necessary.
- there is another directory, `extra-tests`, included to provide code coverage for the accessing of custom fields linked as Field Definitions within `Rollup__mdt`. If you didn't touch the `getSObjectFieldByName` method in `Rollup`, you're probably fine without having to deploy/run that test file. Otherwise, you may need to add `extra-tests` temporarily to your `sfdx-project.json` file in order to have everything run smoothly. The reason these are optional test(s) is because they rely on custom fields, which I do not want anybody to have to install in their own orgs beyond what is necessary. You can browse the powershell test script located in `scripts/test.ps1` to see how the CI system swaps out the existing `sfdx-project.json` on deploy with the one located in the `scripts/` directory to ensure that tests requiring custom fields pass on a scratch org prior to a build passing
272 changes: 253 additions & 19 deletions README.md

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions extra-tests/objects/Account/Account.object-meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,22 +182,6 @@
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<comment>Action override created by Lightning App Builder during activation.</comment>
<content>Account_Record_Page2</content>
<formFactor>Large</formFactor>
<skipRecordTypeSelect>false</skipRecordTypeSelect>
<type>Flexipage</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<comment>Action override created by Lightning App Builder during activation.</comment>
<content>Account_Record_Page2</content>
<formFactor>Small</formFactor>
<skipRecordTypeSelect>false</skipRecordTypeSelect>
<type>Flexipage</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<type>Default</type>
Expand Down
16 changes: 0 additions & 16 deletions extra-tests/objects/Opportunity/Opportunity.object-meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,6 @@
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<comment>Action override created by Lightning App Builder during activation.</comment>
<content>Opportunity_Record_Page</content>
<formFactor>Large</formFactor>
<skipRecordTypeSelect>false</skipRecordTypeSelect>
<type>Flexipage</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<comment>Action override created by Lightning App Builder during activation.</comment>
<content>Opportunity_Record_Page</content>
<formFactor>Small</formFactor>
<skipRecordTypeSelect>false</skipRecordTypeSelect>
<type>Flexipage</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<type>Default</type>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>AmountFormula__c</fullName>
<externalId>false</externalId>
<formula>Amount</formula>
<formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
<label>Amount Formula</label>
<precision>18</precision>
<required>false</required>
<scale>0</scale>
<trackTrending>false</trackTrending>
<type>Currency</type>
</CustomField>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apex-rollup",
"version": "1.1.0",
"version": "1.1.1",
"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
Loading

0 comments on commit 1f87bac

Please sign in to comment.