-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MPDX-7864 - Task phases functionailty #949
base: main
Are you sure you want to change the base?
Changes from 17 commits
125eef9
b7c5d4b
4018f22
29ec996
743d66d
06ed4db
be74fb7
d16ad01
ec3bc27
965ae75
9a796ce
bc1132d
91c8a6c
ddb57b1
46f6de4
15dc957
8016eeb
a8db800
78cf6a3
ca9a078
1f0cd73
7373c71
e21570e
85d6439
ad85a3d
5299506
692c5cd
0f2c06b
07e4841
e7338e9
4928314
95dbe27
9f78c4f
fd573ee
183787f
117e3ff
4e0c893
283fc3e
46b6b92
15fd7d8
7e18f81
95e0bb9
867eee1
b2fdaa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
|
||
env: | ||
# Use production API for codegen to make sure production is compatible with the code to be merged | ||
API_URL: 'https://api.mpdx.org/graphql' | ||
API_URL: 'https://api.stage.mpdx.org/graphql' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be reverted before merging, right? |
||
SITE_URL: 'http://next-stage.mpdx.org' | ||
|
||
jobs: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,53 @@ | ||
import React, { ReactElement, ReactNode } from 'react'; | ||
import { InMemoryCache } from '@apollo/client'; | ||
import { MockedProvider, MockedResponse } from '@apollo/client/testing'; | ||
import { ApolloLink, InMemoryCache } from '@apollo/client'; | ||
import { onError } from '@apollo/client/link/error'; | ||
import { | ||
MockLink, | ||
MockedProvider, | ||
MockedResponse, | ||
} from '@apollo/client/testing'; | ||
import { AdapterLuxon } from '@mui/x-date-pickers/AdapterLuxon'; | ||
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; | ||
import { SnackbarProvider } from 'notistack'; | ||
import TestRouter from './TestRouter'; | ||
|
||
export type OnErrorFunction = (error: string) => void; | ||
|
||
interface Props { | ||
mocks?: MockedResponse[]; | ||
children: ReactNode; | ||
cache?: InMemoryCache; | ||
onErrorFunction?: OnErrorFunction; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't look like the |
||
} | ||
|
||
const TestWrapper = ({ | ||
mocks = [], | ||
children, | ||
cache = new InMemoryCache({ addTypename: false }), | ||
onErrorFunction, | ||
}: Props): ReactElement => { | ||
const mockLink = new MockLink(mocks); | ||
const errorLoggingLink = onError(({ networkError }) => { | ||
if (networkError) { | ||
// eslint-disable-next-line no-console | ||
console.warn(`[Network error]: ${networkError}`); | ||
if (onErrorFunction) { | ||
onErrorFunction(JSON.stringify(networkError.message)); | ||
} | ||
} | ||
}); | ||
const link = ApolloLink.from([errorLoggingLink, mockLink]); | ||
|
||
return ( | ||
<TestRouter> | ||
<LocalizationProvider dateAdapter={AdapterLuxon}> | ||
<SnackbarProvider> | ||
<MockedProvider mocks={mocks} cache={cache} addTypename={false}> | ||
<MockedProvider | ||
mocks={mocks} | ||
cache={cache} | ||
addTypename={false} | ||
link={link} | ||
> | ||
{children} | ||
</MockedProvider> | ||
</SnackbarProvider> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ query Contacts( | |
nodes { | ||
id | ||
avatar | ||
contactPhase | ||
...ContactRow | ||
} | ||
totalCount | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -48,6 +48,19 @@ const getAccountListAnalytics = (data: { | |||||
}; | ||||||
updated_at: string; | ||||||
updated_in_db_at: string; | ||||||
contacts_by_status: { | ||||||
never_contacted: number; | ||||||
future: number; | ||||||
cultivate: number; | ||||||
contact_for_appointment: number; | ||||||
appointment_scheduled: number; | ||||||
call_for_decision: number; | ||||||
financial: number; | ||||||
special: number; | ||||||
prayer: number; | ||||||
connections_remaining: number; | ||||||
initiations: number; | ||||||
}; | ||||||
}; | ||||||
}): AccountListAnalytics => { | ||||||
const { | ||||||
|
@@ -62,6 +75,7 @@ const getAccountListAnalytics = (data: { | |||||
text_message, | ||||||
start_date: startDate, | ||||||
end_date: endDate, | ||||||
contacts_by_status, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
}, | ||||||
} = data; | ||||||
|
||||||
|
@@ -89,6 +103,19 @@ const getAccountListAnalytics = (data: { | |||||
received: phone.received, | ||||||
talkToInPerson: phone.talktoinperson, | ||||||
}, | ||||||
contactsByStatus: { | ||||||
neverContacted: contacts_by_status.never_contacted, | ||||||
future: contacts_by_status.future, | ||||||
cultivate: contacts_by_status.cultivate, | ||||||
contactForAppointment: contacts_by_status.contact_for_appointment, | ||||||
appointmentScheduled: contacts_by_status.appointment_scheduled, | ||||||
callForDecision: contacts_by_status.call_for_decision, | ||||||
financial: contacts_by_status.financial, | ||||||
special: contacts_by_status.special, | ||||||
prayer: contacts_by_status.prayer, | ||||||
connectionsRemaining: contacts_by_status.connections_remaining, | ||||||
initiations: contacts_by_status.initiations, | ||||||
}, | ||||||
textMessage: text_message, | ||||||
startDate, | ||||||
endDate, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure we revert this before going live. I know I have a commit on this. But putting it in multiple places.