-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from maaaaarco/develop
Develop
- Loading branch information
Showing
23 changed files
with
705 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Contributing | ||
|
||
1. Familiarize yourself with the codebase | ||
1. Create a new issue before starting your project so that we can keep track of | ||
what you are trying to add/fix. | ||
1. Fork this repository. | ||
1. Edit the code in your fork. | ||
1. Send us a pull request when you are done. We'll review your code, suggest any | ||
needed changes, and merge it in. | ||
|
||
## Branches | ||
|
||
- We work in `develop`. | ||
- Every push on `develop` will create a new package version | ||
- We release from `master`. | ||
- Our work happens in _topic_ branches (feature and/or bug-fix). | ||
- feature as well as bug-fix branches are based on `develop` | ||
|
||
|
||
### Merging `develop` into `master` | ||
|
||
- When a development cycle finishes, the content of the `develop` is merged into `master` branch. | ||
- The latest package version is then promoted to `released` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2020 Marco Zeuli | ||
* Licensed under MIT license. | ||
* For full license text, see LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
* If you would like to contribute https://github.com/maaaaarco/spaghetti-cmd-loader | ||
*/ | ||
|
||
/** | ||
* ConnectApi methods are not supported in data siloed tests. | ||
* This Delegate allows for testing without using the SeeAllData=true | ||
*/ | ||
public inherited sharing class CMDConnectApiDelegate { | ||
/** | ||
* Creates new FeedItem | ||
* @return Created FeedItem | ||
*/ | ||
public ConnectApi.FeedElement postFeedElement( | ||
Id networkId, | ||
ConnectApi.FeedItemInput feed | ||
) { | ||
return ConnectApi.ChatterFeeds.postFeedElement(networkId, feed); | ||
} | ||
|
||
/** | ||
* Retrieves FeedItem records created in the current day | ||
* @param parentId Parent Id of FeedItem records | ||
* @return A list of FeedItem or an empty list | ||
*/ | ||
public List<FeedItem> getTodayFeedItems(Id parentId){ | ||
return [ | ||
SELECT Body | ||
FROM FeedItem | ||
WHERE ParentId = :UserInfo.getUserId() AND CreatedDate = TODAY | ||
LIMIT 1000 | ||
]; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
cmd-loader/main/default/classes/CMDConnectApiDelegate.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
8 changes: 8 additions & 0 deletions
8
cmd-loader/main/default/classes/CMDConnectApiDelegateTest.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@IsTest | ||
private class CMDConnectApiDelegateTest { | ||
@IsTest | ||
static void getTodayFeedItemsReturnsCorrectly() { | ||
List<FeedItem> res = new CMDConnectApiDelegate().getTodayFeedItems(UserInfo.getUserId()); | ||
System.assertNotEquals(null, res); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
cmd-loader/main/default/classes/CMDConnectApiDelegateTest.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>48.0</apiVersion> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>48.0</apiVersion> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
Oops, something went wrong.