Skip to content
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 - Adding new Task and Contact Phases #940

Closed
wants to merge 145 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
59d08fc
Adding Tags to complete task and log task modals. Needs some editing …
dr-bizz Mar 19, 2024
d62069f
Removing hard-coded results on task completed and log modals
dr-bizz Mar 19, 2024
c977da2
Adding partner status checkbox to the log and complete task.
dr-bizz Mar 20, 2024
da60cac
Replace hard-coded statuses
caleballdrin Mar 22, 2024
3e85c54
Use translated name from contactPartnershpStatus object
caleballdrin Mar 22, 2024
6cca7a9
Rename map pins
caleballdrin Mar 22, 2024
bb8cd0d
Add default status when creating contact
caleballdrin Mar 22, 2024
cea703b
Getting my local set up - REMOVE LATER
dr-bizz Apr 16, 2024
7d11954
Fixing issues with real data from API
dr-bizz Apr 17, 2024
c62d0fb
Starting to work with Live GraphQl data
dr-bizz Apr 17, 2024
56b9714
Adjusting code to work with GraphQl data
dr-bizz Apr 17, 2024
80d7971
Merge branch 'task-phase-1-2' into MPDX-task-phases
dr-bizz Apr 17, 2024
44a4c26
Merge branch 'main' into MPDX-task-phases
dr-bizz Apr 17, 2024
aba62f0
task types
dr-bizz Apr 18, 2024
865dc04
Merge branch 'main' into MPDX-task-phases
dr-bizz Apr 19, 2024
0f093b0
New PhaseEnum & ActivityTypeEnum types and Removing Mock data
dr-bizz Apr 19, 2024
66bfcac
Log Modal edits and ActivityTypeAutocomplete changes
dr-bizz Apr 19, 2024
2e4dc62
REVERT BEFORE PROD - Commenting out husky
dr-bizz Apr 19, 2024
0b4cd37
fixup! Log Modal edits and ActivityTypeAutocomplete changes
dr-bizz Apr 19, 2024
99d5cc2
Fix ActivityTypeEnum on taskActivity and TasksDueThisWeek
caleballdrin Apr 22, 2024
677918e
Fix ActivityTypeEnum on Coaching Activity page
caleballdrin Apr 22, 2024
02db632
Fix ActivityTypeEnum on ContactTaskRow test
caleballdrin Apr 22, 2024
8d05924
Fix ActivityTypeEnum in ContactFlow
caleballdrin Apr 22, 2024
571fee6
Fix ActivityTypeEnum in LogNewsletter
caleballdrin Apr 22, 2024
49f816a
Fix ActivityTypeEnum in PartnerCare tests
caleballdrin Apr 22, 2024
52250f5
Fix ActivityTypeEnum in This Week tests
caleballdrin Apr 22, 2024
55ddc91
Lint Fixes and Task Modal Log form Possible Next Actions and Partner …
dr-bizz Apr 22, 2024
0ecc727
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz Apr 22, 2024
952fa92
Lint fixes and implementing phases on TaskModalForm
dr-bizz Apr 24, 2024
6b26fde
Fix ActivityTypeEnum on Filter Panel and Autocomplete test
caleballdrin Apr 25, 2024
bb5ede8
Dynamically create large taskActionsObject
caleballdrin Apr 25, 2024
4f63a4c
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
caleballdrin Apr 25, 2024
485ad20
Fixing frontend changes since API constant values all changes
dr-bizz Apr 29, 2024
ae4b836
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz Apr 29, 2024
80b59d0
Adding modal changes and removing old code
dr-bizz Apr 29, 2024
5ddc6a3
Add new changes to allow tests and modals to work with error
dr-bizz Apr 29, 2024
0914f49
Fixing modal issues with Results and moving functions into helper file.
dr-bizz May 2, 2024
1b5eb85
Merging Caleb's and Bizz's changes
dr-bizz May 3, 2024
05d16a7
Implementing `taskPhases` in useContactPhaseData
dr-bizz May 6, 2024
d689d44
renaming useContactPhaseData to usePhaseData
dr-bizz May 6, 2024
42bb855
Function to get Phase by activity
dr-bizz May 6, 2024
59ffe1e
If no phase or activity return No phase/activity.
dr-bizz May 6, 2024
d08bf35
Updating code for task complete modal.
dr-bizz May 6, 2024
42f648b
Fixing error when saving on Task modal
dr-bizz May 6, 2024
9d11620
Moving common fields into Components
dr-bizz May 6, 2024
1296f53
Fix tests
caleballdrin May 7, 2024
582b9f9
Add Phase to Task List and Complete Task modal
caleballdrin May 7, 2024
1aed3eb
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
caleballdrin May 7, 2024
fa85665
Turning activityTypes into a Map to make it more readable and faster
dr-bizz May 7, 2024
3ec8941
Next action functionality
dr-bizz May 7, 2024
3b62b96
Set add/log Task's type/phase as the contact's phase
dr-bizz May 7, 2024
da31e3a
Reverting commit cea703bce640de2587ecf26cb06a3cb43c2428bc
dr-bizz May 7, 2024
3e30fc0
Fix contact status tests
caleballdrin May 8, 2024
737d9be
Add activitiesByPhase map
caleballdrin May 9, 2024
fcec674
ActivityTypeAutocomplete add None option and disable when there is no…
caleballdrin May 9, 2024
8dade04
Add phasesMock and fix tests
caleballdrin May 9, 2024
c9b89fd
Set default phase value based on activity
caleballdrin May 9, 2024
7530933
Fix Edit PartnershipInfoModal test
caleballdrin May 9, 2024
3a5be75
Add Phase dropdown to MassActionsEditTasksModal
caleballdrin May 9, 2024
223db19
Small improvements
dr-bizz May 9, 2024
b1a67e8
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 9, 2024
94de2fb
remove disabled from src/components/Task/Modal/Form/Inputs/ActivityTy…
dr-bizz May 9, 2024
983cba6
Split saved tags into suggested and additional
caleballdrin May 9, 2024
ccf9a54
Reorder Assignee on TaskModalForm
caleballdrin May 10, 2024
b38f88d
Fixing Next Actions and Task Complete
dr-bizz May 10, 2024
567b9f9
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 10, 2024
9dea656
ActivityType only use options
caleballdrin May 10, 2024
5487dcc
stop suggested tags from being default values for the next action
caleballdrin May 10, 2024
d2e9e53
Add bold format to SuggestedContactStatus
caleballdrin May 11, 2024
9d5c949
ActivityType auto select when only 1 option. Show phase when 15+ options
caleballdrin May 11, 2024
8c9b83f
Improve phase/action layout
caleballdrin May 11, 2024
64a145f
Use activities.name for Task subject
caleballdrin May 12, 2024
28c0aca
Change style of Log and Complete task modals
caleballdrin May 13, 2024
48973b9
Fixing Next Actions and Task Complete
dr-bizz May 13, 2024
b5fb2f8
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 13, 2024
5f70e68
Switching test to use constant mock data
dr-bizz May 13, 2024
1a02078
Resetting nextActions on phase select
dr-bizz May 13, 2024
4550b93
force commit to deploy PR to Amplify
dr-bizz May 13, 2024
8fdfd46
Merge branch 'main' into MPDX-task-phases
dr-bizz May 13, 2024
7640e8b
Add animation to the task modal
caleballdrin May 13, 2024
8236ca8
Remove Next Actions when there are no suggested options
caleballdrin May 13, 2024
9ead957
Format contacts label on complete modal
caleballdrin May 14, 2024
94d5fd1
Hide suggested status change checkbox when contact is a partner
caleballdrin May 14, 2024
d333555
Rearrange task modal fields
caleballdrin May 14, 2024
c65d181
Fix autofocus with animation
caleballdrin May 14, 2024
f1859f8
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
caleballdrin May 14, 2024
0da7978
Tests for Task Modal
dr-bizz May 14, 2024
8a28b03
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 14, 2024
701f8ee
Adding display results
dr-bizz May 14, 2024
62c6a63
DisplayResult and test fixes
dr-bizz May 14, 2024
8ef621d
Suggested Contact checkbox and tests
dr-bizz May 14, 2024
85ae067
Fix test on Task modal completed
dr-bizz May 14, 2024
6c17e14
Refactor with useContactPartnershipStatuses() hook and fix tests
caleballdrin May 14, 2024
d8f0eff
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
caleballdrin May 14, 2024
d40a39e
Fix tests
caleballdrin May 15, 2024
c99fefa
Hide suggested status based on partner status
caleballdrin May 15, 2024
16de5f5
Fixing TaskModal Tests
dr-bizz May 15, 2024
c444a3d
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 15, 2024
0e251d9
Fixed SuggestedContactStatus
dr-bizz May 15, 2024
fd7e08f
Fixing taskModalCompleteTest
dr-bizz May 15, 2024
30aef76
Hide suggestedContactStatus when it is the same as the current contac…
caleballdrin May 15, 2024
a3a20b2
Improve styling of TagChips and dark header modal
caleballdrin May 15, 2024
585e91f
Focus on Action input after selecting phase
caleballdrin May 15, 2024
d2fd645
Fixed TaskModalLogForm tests
dr-bizz May 16, 2024
72e085f
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 16, 2024
94a57fb
Add status prop to SuggestedContactStatus and tests
caleballdrin May 18, 2024
0a0e17f
Adding Flows functionality
dr-bizz May 20, 2024
18c07a4
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 20, 2024
df95d0f
Merge branch 'main' into MPDX-task-phases
dr-bizz May 20, 2024
8601c77
some changes were overwritten with merge.
dr-bizz May 20, 2024
dd2b10b
Test SuggestedContactStatus graphql calls
caleballdrin May 20, 2024
b5fddc4
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
caleballdrin May 20, 2024
e3a7299
Fix FilterPanel tests
caleballdrin May 21, 2024
d48d071
Merge branch 'main' into MPDX-task-phases
caleballdrin May 21, 2024
a70d577
Add default case for switch and prettier formatting
caleballdrin May 21, 2024
9ce6545
Refactor ContactFlow to use API mapped phases
caleballdrin May 21, 2024
afe503a
Rename contactPartnershipStatus and clean up code
caleballdrin May 21, 2024
08c16e8
Add PartnerCareCompleted result
caleballdrin May 21, 2024
224dc4f
** REVERT THIS BEFORE GOING LIVE **
dr-bizz May 21, 2024
4b30a49
Adding timeout to tests to ensure they have enough time to pass
dr-bizz May 21, 2024
2c46c34
Fix activity name error when blank
caleballdrin May 21, 2024
dbef10d
Rename label to Task Type
caleballdrin May 21, 2024
6eb4c6f
Add tests for PhaseTags
caleballdrin May 22, 2024
9a2d4d2
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
caleballdrin May 22, 2024
57ec6f9
Hide results input when there are no suggested results. Update tests
caleballdrin May 22, 2024
35eb4a1
Test activity type and possiblePartnerStatus
caleballdrin May 22, 2024
2863826
PossiblePartnerStatus tests
caleballdrin May 23, 2024
e7d476d
Flows new Functionality with moving contacts
dr-bizz May 23, 2024
5bbaaea
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 23, 2024
1b6cd11
Make Location field only show for In Person task actions
caleballdrin May 24, 2024
bcb8b9c
Make Task List responsive
caleballdrin May 24, 2024
983ead6
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
caleballdrin May 24, 2024
ef6f57d
Require task action to save a task
caleballdrin May 24, 2024
02b9082
Fix typescript and prettier
caleballdrin May 24, 2024
9935060
Fix task modal test
caleballdrin May 24, 2024
fad3fc0
Add new coaching data
caleballdrin May 24, 2024
2fe4c03
Flows updates
dr-bizz May 28, 2024
9b67514
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 28, 2024
fd7a04a
Add remaining coaching data and fix tests
caleballdrin May 29, 2024
8040f70
Add tooltip to delete filter tag
caleballdrin May 29, 2024
b89e819
Update WeeklyActivity with Phases
caleballdrin May 29, 2024
3ddad87
Add tests
caleballdrin May 29, 2024
9b517aa
Add missing NewConnectionsTotal data
caleballdrin May 29, 2024
c5be361
Fixing tests on multiple contacts
dr-bizz May 30, 2024
fc1c265
Merge branch 'MPDX-task-phases' of https://github.com/CruGlobal/mpdx-…
dr-bizz May 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add missing NewConnectionsTotal data
caleballdrin committed May 29, 2024
commit 9b517aa29538be5c875a157e6f42908512108de6
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ query ActivitySummary($accountListId: ID!, $range: String!) {
appointmentVideoCall
contactsAdded
contactsReferred
contactsTotal
followUpPhoneCall
followUpEmail
followUpTextMessage
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@
'appointmentVideoCall',
'contactsAdded',
'contactsReferred',
'contactsTotal',
'followUpEmail',
'followUpInPerson',
'followUpPhoneCall',
@@ -132,7 +133,7 @@
DateTime.fromISO(startDate),
locale,
)
: null)}

Check warning on line 136 in src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx

Codecov / codecov/patch

src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx#L136

Added line #L136 was not covered by tests
</AlignedTableCell>
))}
<AlignedTableCell>{t('Average')}</AlignedTableCell>
@@ -141,6 +142,14 @@
<AlignedTableCell>
{t('New Connections Added')}
</AlignedTableCell>
{periods.map((period) => (
<AlignedTableCell key={period?.startDate}>
{period?.contactsTotal}
</AlignedTableCell>
))}
<AlignedTableCell>
{Math.round(averages?.contactsTotal)}
</AlignedTableCell>
</HeaderRow>
<TableRow>
<AlignedTableCell>{t('Namestormed')}</AlignedTableCell>
@@ -203,7 +212,7 @@
{Math.round(averages[activityVariableName])}
</AlignedTableCell>
</TableRow>
) : null;

Check warning on line 215 in src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx

Codecov / codecov/patch

src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx#L215

Added line #L215 was not covered by tests
})}
<DividerRow>
<TableCell colSpan={periods.length + 2}>
@@ -277,7 +286,7 @@
{Math.round(averages[activityVariableName])}
</AlignedTableCell>
</TableRow>
) : null;

Check warning on line 289 in src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx

Codecov / codecov/patch

src/components/Coaching/CoachingDetail/ActivitySummary/ActivitySummary.tsx#L289

Added line #L289 was not covered by tests
})}
<DividerRow>
<TableCell colSpan={periods.length + 2}>

Unchanged files with check annotations Beta

expect(initialPage.$).toHaveBeenCalledTimes(2);
});
it('should not break if the sign in button is not found', async () => {

Check warning on line 103 in lighthouse/lighthouse-auth.test.ts

GitHub Actions / eslint

Test has no assertions
await testMissingSignInButton(Promise.reject('could not find element'));
});
it('should not break if the sign in button returns null', async () => {

Check warning on line 107 in lighthouse/lighthouse-auth.test.ts

GitHub Actions / eslint

Test has no assertions
await testMissingSignInButton(Promise.resolve(null));
});
describe('Account Lists page', () => {
const context = {
req: {} as any,

Check warning on line 25 in pages/accountLists.page.test.tsx

GitHub Actions / eslint

Unexpected any. Specify a different type
};
describe('NextAuth unauthorized', () => {
type AccountListIncludedTypes = {
id: string;
type: string;
attributes: any;

Check warning on line 46 in pages/api/Schema/Settings/Organizations/SearchOrganizationsAccountLists/datahandler.ts

GitHub Actions / eslint

Unexpected any. Specify a different type
relationships: any;

Check warning on line 47 in pages/api/Schema/Settings/Organizations/SearchOrganizationsAccountLists/datahandler.ts

GitHub Actions / eslint

Unexpected any. Specify a different type
};
interface SearchOrganizationsAccountListsReturned {
type ContactIncludedTypes = {
id: string;
type: string;
attributes: any;

Check warning on line 45 in pages/api/Schema/Settings/Organizations/SearchOrganizationsContacts/datahandler.ts

GitHub Actions / eslint

Unexpected any. Specify a different type
relationships: any;

Check warning on line 46 in pages/api/Schema/Settings/Organizations/SearchOrganizationsContacts/datahandler.ts

GitHub Actions / eslint

Unexpected any. Specify a different type
};
interface SearchOrganizationsContactsReturned {
query: {
path: queryPath,
},
} as any;

Check warning on line 21 in pages/api/handoff.page.test.ts

GitHub Actions / eslint

Unexpected any. Specify a different type
describe('Errors', () => {
it('returns an error if getToken throws an error', () => {
interface DefineRedirectUrlProps {
accountListId: string;
path: string;
rest: any;

Check warning on line 12 in pages/api/mpdx-web-handoff.page.ts

GitHub Actions / eslint

Unexpected any. Specify a different type
}
const defineRedirectUrl = ({
});
it('should set enviroment to development', () => {
(process.env as any).NODE_ENV = 'development';

Check warning on line 20 in pages/api/utils/rollBar.test.ts

GitHub Actions / eslint

Unexpected any. Specify a different type
// eslint-disable-next-line @typescript-eslint/no-var-requires
const rollbar = require('./rollBar').default;
expect(rollbar.options.environment).toEqual('react_development_server');
GetUserOptionsQuery,
useGetUserOptionsQuery,
} from 'src/components/Contacts/ContactFlow/GetUserOptions.generated';
import { getDefaultFlowOptions } from 'src/components/Contacts/ContactFlow/contactFlowDefaultOptions';

Check warning on line 26 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L26

Added line #L26 was not covered by tests
import Loading from 'src/components/Loading';
import { ContactFilterStatusEnum } from 'src/graphql/types.generated';
import { useAccountListId } from 'src/hooks/useAccountListId';
import { useContactPartnershipStatuses } from 'src/hooks/useContactPartnershipStatuses';

Check warning on line 30 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L30

Added line #L30 was not covered by tests
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import theme from 'src/theme';
const ContactFlowSetupPage: React.FC = () => {
const { t } = useTranslation();
const accountListId = useAccountListId();
const { statusMap, contactStatuses } = useContactPartnershipStatuses();

Check warning on line 45 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L45

Added line #L45 was not covered by tests
const { enqueueSnackbar } = useSnackbar();
const [flowOptions, setFlowOptions] = useState<
{
id: string;
}[]
>([]);
const resetColumnsMessage = t(

Check warning on line 55 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L55

Added line #L55 was not covered by tests
'Since all columns have been removed, resetting columns to their default values',
);
const { data: userOptions, loading } = useGetUserOptionsQuery();
?.value || '[]',
);
if (!newOptions.length) {
setFlowOptions(getDefaultFlowOptions(t, contactStatuses));
} else {
setFlowOptions(newOptions);

Check warning on line 68 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L66-L68

Added lines #L66 - L68 were not covered by tests
}
}, [userOptions]);
(status) => !allUsedStatuses.includes(status),
);
const updateOptions = useCallback(
async (options: ContactFlowOption[]): Promise<void> => {
const stringified = JSON.stringify(options);
await updateUserOptions({

Check warning on line 85 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L82-L85

Added lines #L82 - L85 were not covered by tests
variables: {
key: 'flows',
value: stringified,
},
update: (cache, { data: updatedUserOption }) => {
const query = {

Check warning on line 91 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L90-L91

Added lines #L90 - L91 were not covered by tests
query: GetUserOptionsDocument,
};
const dataFromCache = cache.readQuery<GetUserOptionsQuery>(query);

Check warning on line 94 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L94

Added line #L94 was not covered by tests
if (dataFromCache) {
const filteredOld = dataFromCache.userOptions.filter(
(option) => option.key !== 'flows',

Check warning on line 98 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L97-L98

Added lines #L97 - L98 were not covered by tests
);
const data = {

Check warning on line 101 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L101

Added line #L101 was not covered by tests
userOptions: [
...filteredOld,
{
},
],
};
cache.writeQuery({ ...query, data });

Check warning on line 112 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L112

Added line #L112 was not covered by tests
}
enqueueSnackbar(t('User options updated!'), {

Check warning on line 114 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L114

Added line #L114 was not covered by tests
variant: 'success',
});
},
temp.splice(index, 1);
if (!temp.length) {
enqueueSnackbar(resetColumnsMessage, {

Check warning on line 140 in pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx

Codecov / codecov/patch

pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx#L140

Added line #L140 was not covered by tests
variant: 'warning',
});
}
DateTime.fromISO(startDate),
locale,
)
: null}

Check warning on line 111 in src/components/Coaching/CoachingDetail/AppointmentResults/AppointmentResults.tsx

Codecov / codecov/patch

src/components/Coaching/CoachingDetail/AppointmentResults/AppointmentResults.tsx#L111

Added line #L111 was not covered by tests
</AlignedTableCell>
))}
<AlignedTableCell>{t('Average')}</AlignedTableCell>
accountListId,
attributes,
},
update: (_, { data }) => {
newContactPhase = data?.updateContact?.contact.contactPhase;

Check warning on line 106 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L105-L106

Added lines #L105 - L106 were not covered by tests
},
refetchQueries: () =>
flowOptions.map((flowOption) => ({
});
switch (contactPhase) {
case PhaseEnum.Initiation:
case PhaseEnum.Appointment:
case PhaseEnum.FollowUp:
case PhaseEnum.PartnerCare:
await hasActiveTask({

Check warning on line 131 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L127-L131

Added lines #L127 - L131 were not covered by tests
variables: {
accountListId,
sortBy: TaskSortEnum.StartAtAsc,
completed: false,
contactIds: [id],
activityType: contactPhase
? getActivitiesByPhaseType(contactPhase)
: [],

Check warning on line 141 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L140-L141

Added lines #L140 - L141 were not covered by tests
},
},
onCompleted(data) {

Check warning on line 144 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L144

Added line #L144 was not covered by tests
const taskId = data.tasks.nodes[0]?.id || undefined;
if (taskId) {
openTaskModal({

Check warning on line 147 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L147

Added line #L147 was not covered by tests
view: TaskModalEnum.Complete,
taskId,
});
} else {

Check warning on line 151 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L151

Added line #L151 was not covered by tests
if (
newContactPhase &&
newContactPhase !== PhaseEnum.Connection &&
newContactPhase !== PhaseEnum.Archive

Check warning on line 155 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L154-L155

Added lines #L154 - L155 were not covered by tests
) {
openTaskModal({

Check warning on line 157 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L157

Added line #L157 was not covered by tests
view: TaskModalEnum.Log,
defaultValues: {
taskPhase: newContactPhase,
}
},
});
break;

Check warning on line 168 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L168

Added line #L168 was not covered by tests
case PhaseEnum.Connection:

Check warning on line 170 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L170

Added line #L170 was not covered by tests
if (
newContactPhase &&
newContactPhase !== PhaseEnum.Connection &&
newContactPhase !== PhaseEnum.Archive

Check warning on line 174 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L173-L174

Added lines #L173 - L174 were not covered by tests
) {
openTaskModal({

Check warning on line 176 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L176

Added line #L176 was not covered by tests
view: TaskModalEnum.Add,
defaultValues: {
taskPhase: newContactPhase,
},
});
}
break;

Check warning on line 184 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L184

Added line #L184 was not covered by tests
default:
break;

Check warning on line 187 in src/components/Contacts/ContactFlow/ContactFlow.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlow.tsx#L186-L187

Added lines #L186 - L187 were not covered by tests
}
};
canDrop: (contact) => String(contact.status.id) !== String(status.id),
drop: (contact: DraggedContact) => {
String(contact.status.id) !== String(status.id)
? changeContactStatus(contact.id, status, contact.contactPhase)

Check warning on line 31 in src/components/Contacts/ContactFlow/ContactFlowDropZone/ContactFlowDropZone.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlowDropZone/ContactFlowDropZone.tsx#L31

Added line #L31 was not covered by tests
: null;
},
collect: (monitor) => ({
import { useTranslation } from 'react-i18next';
import { useAccountListId } from '../../../../../hooks/useAccountListId';
import { ContactFlowOption } from '../../ContactFlow';
import { ResetToDefaultModal } from './ResetToDefault/ResetToDefaultModal';

Check warning on line 11 in src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx#L11

Added line #L11 was not covered by tests
const HeaderWrap = styled(Box)(({ theme }) => ({
display: 'flex',
borderBottom: `1px solid ${theme.palette.cruGrayMedium.main}`,
}));
const ButtonWrap = styled(Box)(() => ({

Check warning on line 21 in src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx#L21

Added line #L21 was not covered by tests
['@media (max-width: 380px)']: {
display: 'flex',
flexWrap: 'wrap',
textTransform: 'none',
}));
const ResetButton = styled(Button)(({ theme }) => ({

Check warning on line 36 in src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx#L36

Added line #L36 was not covered by tests
color: theme.palette.cruGrayDark.main,
textTransform: 'none',
['@media (min-width: 381px)']: {
const { t } = useTranslation();
const accountListId = useAccountListId();
const [addingColumn, setAddingColumn] = useState(false);
const [showResetToDefaultModal, setShowResetToDefaultModal] = useState(false);

Check warning on line 71 in src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx#L71

Added line #L71 was not covered by tests
const handleAddColumnButtonClick = async () => {
setAddingColumn(true);
setAddingColumn(false);
};
const handleResetToDefault = () => {
setShowResetToDefaultModal(true);

Check warning on line 80 in src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx#L79-L80

Added lines #L79 - L80 were not covered by tests
};
return (
</AddColumnLoadingButton>
</ButtonWrap>
{showResetToDefaultModal && (
<ResetToDefaultModal
handleClose={() => setShowResetToDefaultModal(false)}

Check warning on line 106 in src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx

Codecov / codecov/patch

src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx#L105-L106

Added lines #L105 - L106 were not covered by tests
updateOptions={updateOptions}
resetColumnsMessage={resetColumnsMessage}
/>
type: DefaultTypeEnum = DefaultTypeEnum.Us,
): ContactFlowOption[] => {
switch (type) {
case DefaultTypeEnum.Global:
return [

Check warning on line 24 in src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts

Codecov / codecov/patch

src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts#L23-L24

Added lines #L23 - L24 were not covered by tests
{
id: uuidv4(),
name: t('Contacts'),
statuses: getContactStatusesByPhase(
PhaseEnum.Appointment,
contactStatuses,
).map((status) => status.translated),

Check warning on line 98 in src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts

Codecov / codecov/patch

src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts#L98

Added line #L98 was not covered by tests
color: 'color-success',
},
{
statuses: getContactStatusesByPhase(
PhaseEnum.FollowUp,
contactStatuses,
).map((status) => status.translated),

Check warning on line 107 in src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts

Codecov / codecov/patch

src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts#L107

Added line #L107 was not covered by tests
color: 'color-warning',
},
{
statuses: getContactStatusesByPhase(
PhaseEnum.PartnerCare,
contactStatuses,
).map((status) => status.translated),

Check warning on line 116 in src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts

Codecov / codecov/patch

src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts#L116

Added line #L116 was not covered by tests
color: 'color-success',
},
{
statuses: getContactStatusesByPhase(
PhaseEnum.Archive,
contactStatuses,
).map((status) => status.translated),

Check warning on line 125 in src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts

Codecov / codecov/patch

src/components/Contacts/ContactFlow/contactFlowDefaultOptions.ts#L125

Added line #L125 was not covered by tests
color: 'color-text',
},
];
role="listbox"
value={contact.status}
onChange={(e) =>
setFieldValue(

Check warning on line 449 in src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/CreateMultipleContacts/CreateMultipleContacts.tsx

Codecov / codecov/patch

src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/CreateMultipleContacts/CreateMultipleContacts.tsx#L449

Added line #L449 was not covered by tests
`contacts.${index}.status`,
e.target.value,
)
);
return (
(s && (s[1] as ContactFilterStatusEnum)) ||
ContactFilterStatusEnum.Null

Check warning on line 428 in src/components/Shared/Filters/FilterPanel.tsx

Codecov / codecov/patch

src/components/Shared/Filters/FilterPanel.tsx#L428

Added line #L428 was not covered by tests
);
}),
};
activity.id === enumValue ||
activity.value === enumValue
);
})?.id as ActivityTypeEnum) || ActivityTypeEnum.None

Check warning on line 449 in src/components/Shared/Filters/FilterPanel.tsx

Codecov / codecov/patch

src/components/Shared/Filters/FilterPanel.tsx#L449

Added line #L449 was not covered by tests
);
})
.flat(),
...acc,
[key]: value
.split(',')
.map((enumValue) => {

Check warning on line 467 in src/components/Shared/Filters/FilterPanel.tsx

Codecov / codecov/patch

src/components/Shared/Filters/FilterPanel.tsx#L467

Added line #L467 was not covered by tests
// --any--,none
return (

Check warning on line 469 in src/components/Shared/Filters/FilterPanel.tsx

Codecov / codecov/patch

src/components/Shared/Filters/FilterPanel.tsx#L469

Added line #L469 was not covered by tests
(activities?.find((activity) => {
return (

Check warning on line 471 in src/components/Shared/Filters/FilterPanel.tsx

Codecov / codecov/patch

src/components/Shared/Filters/FilterPanel.tsx#L471

Added line #L471 was not covered by tests
activity.id === enumValue ||
activity.value === enumValue

Check warning on line 473 in src/components/Shared/Filters/FilterPanel.tsx

Codecov / codecov/patch

src/components/Shared/Filters/FilterPanel.tsx#L473

Added line #L473 was not covered by tests
);
})?.id as ActivityTypeEnum) || ActivityTypeEnum.None

Check warning on line 475 in src/components/Shared/Filters/FilterPanel.tsx

Codecov / codecov/patch

src/components/Shared/Filters/FilterPanel.tsx#L475

Added line #L475 was not covered by tests
);
})
.flat(),
selectType === 'include'
? theme.palette.mpdxBlue.main
: selectType === 'exclude'
? theme.palette.error.main

Check warning on line 32 in src/components/Shared/TagChip/TagChip.tsx

Codecov / codecov/patch

src/components/Shared/TagChip/TagChip.tsx#L32

Added line #L32 was not covered by tests
: '#777',
},
}));
if (activityType && activityTypes) {
const activityData = activityType
? activityTypes.get(activityType)
: undefined;

Check warning on line 139 in src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx#L139

Added line #L139 was not covered by tests
if (activityData) {
setPhaseId(activityData.phaseId);
}
}
if (selectedSuggestedTags.length) {
attributes.tagList = attributes.tagList.concat(selectedSuggestedTags);

Check warning on line 164 in src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx#L164

Added line #L164 was not covered by tests
}
const mutations = [
status: suggestedPartnerStatus,
},
},
onError: () => {
enqueueSnackbar(

Check warning on line 201 in src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx#L200-L201

Added lines #L200 - L201 were not covered by tests
t(`Error while updating ${contact.name}'s status`),
{
variant: 'error',
? t('Contacts:')
: numberOfContacts > 0
? t('Contact:')
: null}

Check warning on line 310 in src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/Complete/TaskModalCompleteForm.tsx#L310

Added line #L310 was not covered by tests
</Typography>{' '}
{task?.contacts.nodes.map((contact, index) => (
<Typography
// Sort none to the top
return options
? options.slice().sort((a) => (a === ActivityTypeEnum.None ? -1 : 0))
: [];

Check warning on line 43 in src/components/Task/Modal/Form/Inputs/ActivityTypeAutocomplete/ActivityTypeAutocomplete.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/Inputs/ActivityTypeAutocomplete/ActivityTypeAutocomplete.tsx#L43

Added line #L43 was not covered by tests
}, [options]);
return (
const getChipSelectType = useCallback(
(tagId: string): 'none' | 'include' => {
if (selectedTags.includes(tagId)) {
return 'include';

Check warning on line 30 in src/components/Task/Modal/Form/Inputs/PhaseTags/PhaseTags.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/Inputs/PhaseTags/PhaseTags.tsx#L30

Added line #L30 was not covered by tests
}
return 'none';
},
const toggleSelect = useCallback(
(tagId: string) => {
if (!selectedTags) {
setSelectedTags([tagId]);
return;

Check warning on line 41 in src/components/Task/Modal/Form/Inputs/PhaseTags/PhaseTags.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/Inputs/PhaseTags/PhaseTags.tsx#L40-L41

Added lines #L40 - L41 were not covered by tests
}
if (selectedTags.includes(tagId)) {
const tempTags = selectedTags.filter((tag: string) => tag !== tagId);
setSelectedTags(tempTags);
return;

Check warning on line 46 in src/components/Task/Modal/Form/Inputs/PhaseTags/PhaseTags.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/Inputs/PhaseTags/PhaseTags.tsx#L44-L46

Added lines #L44 - L46 were not covered by tests
}
setSelectedTags([...selectedTags, tagId]);
return;
if (defaultValues?.activityType && activityTypes) {
const activityData = defaultValues.activityType
? activityTypes.get(defaultValues.activityType)
: undefined;

Check warning on line 153 in src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx#L152-L153

Added lines #L152 - L153 were not covered by tests
if (activityData) {
setPhaseId(activityData.phaseId);
taskPhase = activityData.phaseId;
taskSubject = activityData.title;

Check warning on line 157 in src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx#L155-L157

Added lines #L155 - L157 were not covered by tests
}
}
if (defaultValues?.taskPhase) {
setPhaseId(defaultValues?.taskPhase);

Check warning on line 161 in src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx#L161

Added line #L161 was not covered by tests
}
return {
suggestedPartnerStatus?: StatusEnum | null,
): Promise<void> => {
if (selectedSuggestedTags.length) {
attributes.tagList = attributes.tagList.concat(selectedSuggestedTags);

Check warning on line 186 in src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx#L186

Added line #L186 was not covered by tests
}
if (attributes.displayResult) {
});
if (updatingContactStatus) {
try {
await Promise.all(

Check warning on line 221 in src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx#L220-L221

Added lines #L220 - L221 were not covered by tests
attributes.contactIds.map((contactID) =>
updateContactStatus({

Check warning on line 223 in src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx#L223

Added line #L223 was not covered by tests
variables: {
accountListId,
attributes: {
}),
),
);
enqueueSnackbar(t('Updated contact(s) status successfully'), {

Check warning on line 234 in src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx#L234

Added line #L234 was not covered by tests
variant: 'success',
});
} catch {
enqueueSnackbar(t('Error while updating contact(s) status'), {

Check warning on line 238 in src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/LogForm/TaskModalLogForm.tsx#L238

Added line #L238 was not covered by tests
variant: 'error',
});
}
? phaseData.results.resultOptions.find(
(result) => result.name?.toLowerCase() === resultName.toLowerCase(),
)
: null;

Check warning on line 24 in src/components/Task/Modal/Form/PossibleNextActions.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/PossibleNextActions.tsx#L24

Added line #L24 was not covered by tests
return result?.suggestedNextActions
? [ActivityTypeEnum.None, ...result.suggestedNextActions]
changeContactStatus: false,
nextAction: task.nextAction ?? null,
tagList: additionalTags ?? [],
contactIds: task.contacts.nodes.map(({ id }) => id),

Check warning on line 199 in src/components/Task/Modal/Form/TaskModalForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalForm.tsx#L199

Added line #L199 was not covered by tests
userId: task.user?.id ?? session.data?.user.userID ?? null,
notificationTimeBefore: task.notificationTimeBefore,
notificationType: task.notificationType,
if (defaultValues?.activityType && activityTypes) {
const activityData = defaultValues.activityType
? activityTypes.get(defaultValues.activityType)
: undefined;

Check warning on line 213 in src/components/Task/Modal/Form/TaskModalForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalForm.tsx#L212-L213

Added lines #L212 - L213 were not covered by tests
if (activityData) {
taskPhase = activityData.phaseId;
taskSubject = activityData.title;

Check warning on line 216 in src/components/Task/Modal/Form/TaskModalForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalForm.tsx#L215-L216

Added lines #L215 - L216 were not covered by tests
}
}
if (taskPhase) {
setPhaseId(taskPhase);

Check warning on line 221 in src/components/Task/Modal/Form/TaskModalForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalForm.tsx#L221

Added line #L221 was not covered by tests
}
return {
delete attributes.changeContactStatus;
if (selectedSuggestedTags.length) {
attributes.tagList = attributes.tagList.concat(selectedSuggestedTags);

Check warning on line 273 in src/components/Task/Modal/Form/TaskModalForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalForm.tsx#L273

Added line #L273 was not covered by tests
}
if (attributes.displayResult) {
});
}
if (updatingContactStatus) {
try {
await Promise.all(

Check warning on line 309 in src/components/Task/Modal/Form/TaskModalForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalForm.tsx#L308-L309

Added lines #L308 - L309 were not covered by tests
attributes.contactIds.map((contactID) =>
updateContactStatus({

Check warning on line 311 in src/components/Task/Modal/Form/TaskModalForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalForm.tsx#L311

Added line #L311 was not covered by tests
variables: {
accountListId,
attributes: {
}),
),
);
enqueueSnackbar(t('Updated contact(s) status successfully'), {

Check warning on line 322 in src/components/Task/Modal/Form/TaskModalForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalForm.tsx#L322

Added line #L322 was not covered by tests
variant: 'success',
});
} catch {
enqueueSnackbar(t('Error while updating contact(s) status'), {

Check warning on line 326 in src/components/Task/Modal/Form/TaskModalForm.tsx

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalForm.tsx#L326

Added line #L326 was not covered by tests
variant: 'error',
});
}
return word[0].toUpperCase() + word.substring(1);
})
.join(' ')
: '',

Check warning on line 97 in src/components/Task/Modal/Form/TaskModalHelper.ts

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalHelper.ts#L97

Added line #L97 was not covered by tests
);
}
setTimeout(() => setFieldTouched('activityType', true));
): ResultEnum => {
if (!displayResult || !phaseData || !activityType) {
switch (displayResult) {
case ResultEnum.Attempted:
return ResultEnum.Attempted;
case ResultEnum.AttemptedLeftMessage:
return ResultEnum.AttemptedLeftMessage;
case ResultEnum.Completed:
return ResultEnum.Completed;
case ResultEnum.Done:
return ResultEnum.Done;
case ResultEnum.Received:
return ResultEnum.Received;
default:
return ResultEnum.None;

Check warning on line 145 in src/components/Task/Modal/Form/TaskModalHelper.ts

Codecov / codecov/patch

src/components/Task/Modal/Form/TaskModalHelper.ts#L134-L145

Added lines #L134 - L145 were not covered by tests
}
}
const resultOption = phaseData?.results?.resultOptions?.find(
>
<TaskPhase>
{activityData?.phase && condensed
? activityData.phase

Check warning on line 227 in src/components/Task/TaskRow/TaskRow.tsx

Codecov / codecov/patch

src/components/Task/TaskRow/TaskRow.tsx#L227

Added line #L227 was not covered by tests
: activityData?.phase
? activityData.phase + (' - ' + '\u00A0')
: ''}
PledgeFrequencyEnum,
StatusEnum,
} from 'src/graphql/types.generated';
import { useContactPartnershipStatuses } from 'src/hooks/useContactPartnershipStatuses';

Check warning on line 20 in src/components/Tool/FixCommitmentInfo/FixCommitmentInfo.tsx

Codecov / codecov/patch

src/components/Tool/FixCommitmentInfo/FixCommitmentInfo.tsx#L20

Added line #L20 was not covered by tests
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import theme from '../../../theme';
import NoData from '../NoData';
});
const [updateInvalidStatus, { loading: updating }] =
useUpdateInvalidStatusMutation();
const { contactStatuses } = useContactPartnershipStatuses();

Check warning on line 91 in src/components/Tool/FixCommitmentInfo/FixCommitmentInfo.tsx

Codecov / codecov/patch

src/components/Tool/FixCommitmentInfo/FixCommitmentInfo.tsx#L91

Added line #L91 was not covered by tests
const contactFilterStatuses = contactFilterGroups?.accountList
?.contactFilterGroups
key={contact.name}
statusTitle={
contact.status
? contactStatuses[contact.status]?.translated

Check warning on line 206 in src/components/Tool/FixCommitmentInfo/FixCommitmentInfo.tsx

Codecov / codecov/patch

src/components/Tool/FixCommitmentInfo/FixCommitmentInfo.tsx#L206

Added line #L206 was not covered by tests
: ''
}
statusValue={contact.status || ''}
import { DateTime } from 'luxon';
import { useTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
import { useContactPartnershipStatuses } from 'src/hooks/useContactPartnershipStatuses';

Check warning on line 21 in src/components/Tool/MergeContacts/Contact.tsx

Codecov / codecov/patch

src/components/Tool/MergeContacts/Contact.tsx#L21

Added line #L21 was not covered by tests
import { useLocale } from 'src/hooks/useLocale';
import { dateFormatShort } from 'src/lib/intlFormat';
import theme from '../../../theme';
const { t } = useTranslation();
const locale = useLocale();
const { classes } = useStyles();
const { contactStatuses } = useContactPartnershipStatuses();

Check warning on line 86 in src/components/Tool/MergeContacts/Contact.tsx

Codecov / codecov/patch

src/components/Tool/MergeContacts/Contact.tsx#L86

Added line #L86 was not covered by tests
//TODO: Add button functionality
//TODO: Make contact title a link to contact page
}
return (
phases.find((phase) => phase.id.toLowerCase() === activity.toLowerCase()) ??
null

Check warning on line 42 in src/hooks/usePhaseData.ts

Codecov / codecov/patch

src/hooks/usePhaseData.ts#L42

Added line #L42 was not covered by tests
);
};
phase?: PhaseEnum | null,
): string => {
if (phase === undefined) {
return '';

Check warning on line 10 in src/utils/functions/getLocalizedPhase.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedPhase.ts#L10

Added line #L10 was not covered by tests
}
switch (phase) {
case PhaseEnum.PartnerCare:
return t('Partner Care');
default:
return '';

Check warning on line 33 in src/utils/functions/getLocalizedPhase.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedPhase.ts#L32-L33

Added lines #L32 - L33 were not covered by tests
}
};
case ResultEnum.Received:
return t('Received');
// TODO remove when new ResultEnum is added
case DisplayResultEnum.FollowUpResultNoResponse:

Check warning on line 35 in src/utils/functions/getLocalizedResultStrings.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedResultStrings.ts#L35

Added line #L35 was not covered by tests
case DisplayResultEnum.InitiationResultNoResponse:
return t('No Response Yet');
case DisplayResultEnum.AppointmentResultNotInterested:
return t('Does not want to meet');

Check warning on line 40 in src/utils/functions/getLocalizedResultStrings.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedResultStrings.ts#L39-L40

Added lines #L39 - L40 were not covered by tests
case DisplayResultEnum.InitiationResultCircleBack:
return t("Can't meet right now - circle back");
case DisplayResultEnum.InitiationResultNotInterested:
return t('Not Interested');
default:
return '';

Check warning on line 71 in src/utils/functions/getLocalizedResultStrings.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedResultStrings.ts#L70-L71

Added lines #L70 - L71 were not covered by tests
}
};
switch (taskType) {
case ActivityTypeEnum.None:
return t('None');

Check warning on line 14 in src/utils/functions/getLocalizedTaskType.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedTaskType.ts#L14

Added line #L14 was not covered by tests
case ActivityTypeEnum.AppointmentInPerson:
return t('In Person Appointment');
case ActivityTypeEnum.AppointmentPhoneCall:
return t('Phone Appointment');
case ActivityTypeEnum.AppointmentVideoCall:
return t('Video Appointment');

Check warning on line 21 in src/utils/functions/getLocalizedTaskType.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedTaskType.ts#L16-L21

Added lines #L16 - L21 were not covered by tests
case ActivityTypeEnum.FollowUpEmail:
return t('Email To Follow Up');
case ActivityTypeEnum.FollowUpPhoneCall:
return t('Call To Follow Up');
case ActivityTypeEnum.FollowUpTextMessage:
return t('Text To Follow Up');
case ActivityTypeEnum.FollowUpSocialMedia:
return t('Social Media Message To Follow Up');
case ActivityTypeEnum.FollowUpInPerson:
return t('In Person Follow Up');

Check warning on line 32 in src/utils/functions/getLocalizedTaskType.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedTaskType.ts#L23-L32

Added lines #L23 - L32 were not covered by tests
case ActivityTypeEnum.InitiationPhoneCall:
return t('Phone Call To Initiate Appointment');
case ActivityTypeEnum.InitiationEmail:
return t('Email To Initiate Appointment');
case ActivityTypeEnum.InitiationTextMessage:
return t('Text To Initiate Appointment');
case ActivityTypeEnum.InitiationSocialMedia:
return t('Social Media Message To Initiate Appointment');
case ActivityTypeEnum.InitiationLetter:
return t('Letter To Initiate Appointment');
case ActivityTypeEnum.InitiationSpecialGiftAppeal:
return t('Special Gift Appeal');
case ActivityTypeEnum.InitiationInPerson:
return t('Initiate in Person for an Appointment');

Check warning on line 47 in src/utils/functions/getLocalizedTaskType.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedTaskType.ts#L34-L47

Added lines #L34 - L47 were not covered by tests
case ActivityTypeEnum.PartnerCarePhysicalNewsletter:
return t('Send Physical Newsletter');
case ActivityTypeEnum.PartnerCareDigitalNewsletter:
return t('Send Digital Newsletter');
case ActivityTypeEnum.PartnerCareThank:
return t('Send Thank You Note');
case ActivityTypeEnum.PartnerCarePrayerRequest:
return t('Ask For Or Receive Prayer Request');
case ActivityTypeEnum.PartnerCareUpdateInformation:
return t('Update Partner Information');
case ActivityTypeEnum.PartnerCarePhoneCall:
return t('Call Partner For Cultivation');
case ActivityTypeEnum.PartnerCareEmail:
return t('Email Partner For Cultivation');
case ActivityTypeEnum.PartnerCareTextMessage:
return t('Text Message Partner For Cultivation');
case ActivityTypeEnum.PartnerCareSocialMedia:
return t('Social Media Message For Cultivation');
case ActivityTypeEnum.PartnerCareInPerson:
return t('Connect In Person For Cultivation');
case ActivityTypeEnum.PartnerCareToDo:
return t('To Do');

Check warning on line 70 in src/utils/functions/getLocalizedTaskType.ts

Codecov / codecov/patch

src/utils/functions/getLocalizedTaskType.ts#L49-L70

Added lines #L49 - L70 were not covered by tests
}
};
import { ActivityTypeEnum } from 'src/graphql/types.generated';

Check warning on line 1 in src/utils/phases/isCallActivityType.ts

Codecov / codecov/patch

src/utils/phases/isCallActivityType.ts#L1

Added line #L1 was not covered by tests
export const isCallActivityType = (activity?: ActivityTypeEnum) => {

Check warning on line 3 in src/utils/phases/isCallActivityType.ts

Codecov / codecov/patch

src/utils/phases/isCallActivityType.ts#L3

Added line #L3 was not covered by tests
if (!activity) {
return null;

Check warning on line 5 in src/utils/phases/isCallActivityType.ts

Codecov / codecov/patch

src/utils/phases/isCallActivityType.ts#L5

Added line #L5 was not covered by tests
}
return (

Check warning on line 7 in src/utils/phases/isCallActivityType.ts

Codecov / codecov/patch

src/utils/phases/isCallActivityType.ts#L7

Added line #L7 was not covered by tests
[
ActivityTypeEnum.AppointmentPhoneCall,
ActivityTypeEnum.AppointmentVideoCall,
export const getActivitiesByPhaseType = (
phase: PhaseEnum | string,
): ActivityTypeEnum[] => {

Check warning on line 64 in src/utils/phases/taskActivityTypes.ts

Codecov / codecov/patch

src/utils/phases/taskActivityTypes.ts#L64

Added line #L64 was not covered by tests
switch (phase) {
case PhaseEnum.Appointment:
return [

Check warning on line 67 in src/utils/phases/taskActivityTypes.ts

Codecov / codecov/patch

src/utils/phases/taskActivityTypes.ts#L66-L67

Added lines #L66 - L67 were not covered by tests
ActivityTypeEnum.AppointmentInPerson,
ActivityTypeEnum.AppointmentPhoneCall,
ActivityTypeEnum.AppointmentVideoCall,
];
case PhaseEnum.FollowUp:
return [

Check warning on line 73 in src/utils/phases/taskActivityTypes.ts

Codecov / codecov/patch

src/utils/phases/taskActivityTypes.ts#L72-L73

Added lines #L72 - L73 were not covered by tests
ActivityTypeEnum.FollowUpEmail,
ActivityTypeEnum.FollowUpInPerson,
ActivityTypeEnum.FollowUpPhoneCall,
ActivityTypeEnum.FollowUpSocialMedia,
ActivityTypeEnum.FollowUpTextMessage,
];
case PhaseEnum.Initiation:
return [

Check warning on line 81 in src/utils/phases/taskActivityTypes.ts

Codecov / codecov/patch

src/utils/phases/taskActivityTypes.ts#L80-L81

Added lines #L80 - L81 were not covered by tests
ActivityTypeEnum.InitiationEmail,
ActivityTypeEnum.InitiationInPerson,
ActivityTypeEnum.InitiationLetter,
ActivityTypeEnum.InitiationSpecialGiftAppeal,
ActivityTypeEnum.InitiationTextMessage,
];
case PhaseEnum.PartnerCare:
return [

Check warning on line 91 in src/utils/phases/taskActivityTypes.ts

Codecov / codecov/patch

src/utils/phases/taskActivityTypes.ts#L90-L91

Added lines #L90 - L91 were not covered by tests
ActivityTypeEnum.PartnerCareDigitalNewsletter,
ActivityTypeEnum.PartnerCareEmail,
ActivityTypeEnum.PartnerCareInPerson,
ActivityTypeEnum.PartnerCareToDo,
ActivityTypeEnum.PartnerCareUpdateInformation,
];
default:
return [

Check warning on line 105 in src/utils/phases/taskActivityTypes.ts

Codecov / codecov/patch

src/utils/phases/taskActivityTypes.ts#L104-L105

Added lines #L104 - L105 were not covered by tests
ActivityTypeEnum.AppointmentInPerson,
ActivityTypeEnum.AppointmentPhoneCall,
ActivityTypeEnum.AppointmentVideoCall,
case ActivityTypeEnum.AppointmentVideoCall:
return PhaseEnum.Appointment;
case ActivityTypeEnum.FollowUpEmail:
case ActivityTypeEnum.FollowUpInPerson:

Check warning on line 146 in src/utils/phases/taskActivityTypes.ts

Codecov / codecov/patch

src/utils/phases/taskActivityTypes.ts#L145-L146

Added lines #L145 - L146 were not covered by tests
case ActivityTypeEnum.FollowUpPhoneCall:
case ActivityTypeEnum.FollowUpSocialMedia:
case ActivityTypeEnum.FollowUpTextMessage:
case ActivityTypeEnum.InitiationTextMessage:
return PhaseEnum.Initiation;
case ActivityTypeEnum.PartnerCareDigitalNewsletter:

Check warning on line 161 in src/utils/phases/taskActivityTypes.ts

Codecov / codecov/patch

src/utils/phases/taskActivityTypes.ts#L161

Added line #L161 was not covered by tests
case ActivityTypeEnum.PartnerCareEmail:
case ActivityTypeEnum.PartnerCareInPerson:
case ActivityTypeEnum.PartnerCarePhoneCall: