Skip to content

Commit d760d54

Browse files
authored
Merge branch 'develop' into master
2 parents 26febac + 67dc861 commit d760d54

File tree

8 files changed

+32
-8
lines changed

8 files changed

+32
-8
lines changed

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ android {
118118
applicationId "com.missionhub"
119119
minSdkVersion 16
120120
targetSdkVersion 26
121-
versionName "4.2.6"
121+
versionName "4.2.7"
122122
versionCode grgit.log(includes:['HEAD']).size() + 363
123123
ndk {
124124
abiFilters "armeabi-v7a", "x86"

src/actions/__tests__/impact.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ describe('refreshImpact', () => {
3434
});
3535
expect(store.getActions()).toEqual([apiResponse, apiResponse]);
3636
});
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+
expect(callApi).toHaveBeenCalledWith(REQUESTS.GET_IMPACT_SUMMARY, {
47+
person_id: undefined,
48+
organization_id: orgId,
49+
});
50+
expect(callApi).toHaveBeenCalledWith(REQUESTS.GET_IMPACT_SUMMARY, {
51+
person_id: undefined,
52+
organization_id: undefined,
53+
});
54+
expect(store.getActions()).toEqual([apiResponse, apiResponse, apiResponse]);
55+
});
3756
});
3857

3958
describe('getImpactSummary', () => {

src/actions/__tests__/interactions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ describe('add comment', () => {
6565
ACTIONS.INTERACTION.name,
6666
{ [interaction.tracking]: null },
6767
);
68-
mockFnWithParams(impact, 'refreshImpact', refreshImpactResult);
6968
reloadGroupCelebrateFeed.mockReturnValue(celebrationFeedResult);
7069
});
7170

@@ -98,6 +97,8 @@ describe('add comment', () => {
9897
};
9998

10099
it('should add a new comment', async () => {
100+
mockFnWithParams(impact, 'refreshImpact', refreshImpactResult, undefined);
101+
101102
mockApi(action, REQUESTS.ADD_NEW_INTERACTION, {}, expectedBody);
102103

103104
await store.dispatch(addNewInteraction(personId, interaction, comment));
@@ -147,6 +148,7 @@ describe('add comment', () => {
147148
};
148149

149150
it('should add a new comment', async () => {
151+
mockFnWithParams(impact, 'refreshImpact', refreshImpactResult, orgId);
150152
mockApi(action, REQUESTS.ADD_NEW_INTERACTION, {}, expectedBody);
151153

152154
await store.dispatch(

src/actions/__tests__/steps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ describe('complete challenge', () => {
313313
});
314314

315315
it('completes step for personal ministry', async () => {
316-
const noOrgStep = { ...step, organization: null };
316+
const noOrgStep = { ...step, organization: undefined };
317317
await store.dispatch(completeStep(noOrgStep, screen));
318318
expect(callApi).toHaveBeenCalledWith(
319319
REQUESTS.GET_MY_CHALLENGES,

src/actions/impact.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import {
55

66
import callApi, { REQUESTS } from './api';
77

8-
export function refreshImpact() {
8+
export function refreshImpact(orgId) {
99
return dispatch => {
1010
dispatch(getImpactSummary('me'));
11+
if (orgId) {
12+
dispatch(getImpactSummary(undefined, orgId));
13+
}
1114
return dispatch(getImpactSummary());
1215
};
1316
}

src/actions/interactions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function addNewInteraction(
6868
}),
6969
);
7070
dispatch(reloadJourney(personId, organizationId));
71-
dispatch(refreshImpact());
71+
dispatch(refreshImpact(organizationId));
7272
dispatch(reloadGroupCelebrateFeed(organizationId));
7373

7474
return response;

src/actions/selectStage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function updateUserStage(contactAssignmentId, stageId) {
3838
const personId = person && person.id;
3939
const orgId = organization && organization.id;
4040

41-
dispatch(refreshImpact());
41+
dispatch(refreshImpact(orgId));
4242
dispatch(getPersonDetails(personId, orgId));
4343
return response;
4444
};
@@ -87,7 +87,7 @@ export function selectPersonStage(
8787
callApi(REQUESTS.CREATE_CONTACT_ASSIGNMENT, {}, data),
8888
);
8989

90-
dispatch(refreshImpact());
90+
dispatch(refreshImpact(orgId));
9191
dispatch(getPersonDetails(personId, orgId));
9292
return response;
9393
};

src/actions/steps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function challengeCompleteAction(step, screen) {
203203
const subsection = getAnalyticsSubsection(step.receiver.id, myId);
204204

205205
dispatch({ type: COMPLETED_STEP_COUNT, userId: step.receiver.id });
206-
dispatch(refreshImpact());
206+
dispatch(refreshImpact(step.organization && step.organization.id));
207207
dispatch(
208208
navigatePush(ADD_STEP_SCREEN, {
209209
trackingObj: buildTrackingObj(

0 commit comments

Comments
 (0)