We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 26febac + 67dc861 commit d760d54Copy full SHA for d760d54
android/app/build.gradle
@@ -118,7 +118,7 @@ android {
118
applicationId "com.missionhub"
119
minSdkVersion 16
120
targetSdkVersion 26
121
- versionName "4.2.6"
+ versionName "4.2.7"
122
versionCode grgit.log(includes:['HEAD']).size() + 363
123
ndk {
124
abiFilters "armeabi-v7a", "x86"
src/actions/__tests__/impact.js
@@ -34,6 +34,25 @@ describe('refreshImpact', () => {
34
});
35
expect(store.getActions()).toEqual([apiResponse, apiResponse]);
36
37
+
38
+ it('should get my impact and global impact with org', async () => {
39
+ const orgId = '123';
40
+ await store.dispatch(refreshImpact(orgId));
41
42
+ expect(callApi).toHaveBeenCalledWith(REQUESTS.GET_IMPACT_SUMMARY, {
43
+ person_id: 'me',
44
+ organization_id: undefined,
45
+ });
46
47
+ person_id: undefined,
48
+ organization_id: orgId,
49
50
51
52
53
54
+ expect(store.getActions()).toEqual([apiResponse, apiResponse, apiResponse]);
55
56
57
58
describe('getImpactSummary', () => {
src/actions/__tests__/interactions.js
@@ -65,7 +65,6 @@ describe('add comment', () => {
65
ACTIONS.INTERACTION.name,
66
{ [interaction.tracking]: null },
67
);
68
- mockFnWithParams(impact, 'refreshImpact', refreshImpactResult);
69
reloadGroupCelebrateFeed.mockReturnValue(celebrationFeedResult);
70
71
@@ -98,6 +97,8 @@ describe('add comment', () => {
98
97
};
99
100
it('should add a new comment', async () => {
+ mockFnWithParams(impact, 'refreshImpact', refreshImpactResult, undefined);
101
102
mockApi(action, REQUESTS.ADD_NEW_INTERACTION, {}, expectedBody);
103
104
await store.dispatch(addNewInteraction(personId, interaction, comment));
@@ -147,6 +148,7 @@ describe('add comment', () => {
147
148
149
150
151
+ mockFnWithParams(impact, 'refreshImpact', refreshImpactResult, orgId);
152
153
154
await store.dispatch(
src/actions/__tests__/steps.js
@@ -313,7 +313,7 @@ describe('complete challenge', () => {
313
314
315
it('completes step for personal ministry', async () => {
316
- const noOrgStep = { ...step, organization: null };
+ const noOrgStep = { ...step, organization: undefined };
317
await store.dispatch(completeStep(noOrgStep, screen));
318
expect(callApi).toHaveBeenCalledWith(
319
REQUESTS.GET_MY_CHALLENGES,
src/actions/impact.js
@@ -5,9 +5,12 @@ import {
5
6
import callApi, { REQUESTS } from './api';
7
8
-export function refreshImpact() {
+export function refreshImpact(orgId) {
9
return dispatch => {
10
dispatch(getImpactSummary('me'));
11
+ if (orgId) {
12
+ dispatch(getImpactSummary(undefined, orgId));
13
+ }
14
return dispatch(getImpactSummary());
15
16
}
src/actions/interactions.js
@@ -68,7 +68,7 @@ export function addNewInteraction(
}),
dispatch(reloadJourney(personId, organizationId));
- dispatch(refreshImpact());
+ dispatch(refreshImpact(organizationId));
72
dispatch(reloadGroupCelebrateFeed(organizationId));
73
74
return response;
src/actions/selectStage.js
@@ -38,7 +38,7 @@ export function updateUserStage(contactAssignmentId, stageId) {
const personId = person && person.id;
const orgId = organization && organization.id;
+ dispatch(refreshImpact(orgId));
dispatch(getPersonDetails(personId, orgId));
@@ -87,7 +87,7 @@ export function selectPersonStage(
87
callApi(REQUESTS.CREATE_CONTACT_ASSIGNMENT, {}, data),
88
89
90
91
92
93
src/actions/steps.js
@@ -203,7 +203,7 @@ function challengeCompleteAction(step, screen) {
203
const subsection = getAnalyticsSubsection(step.receiver.id, myId);
204
205
dispatch({ type: COMPLETED_STEP_COUNT, userId: step.receiver.id });
206
+ dispatch(refreshImpact(step.organization && step.organization.id));
207
dispatch(
208
navigatePush(ADD_STEP_SCREEN, {
209
trackingObj: buildTrackingObj(
0 commit comments