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 - Task phases functionailty #949

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open

Conversation

dr-bizz
Copy link
Contributor

@dr-bizz dr-bizz commented Jun 4, 2024

Description

This pull request integrates the Task phases functionality into the MPDX application. The update encompasses several areas, including task initialization, contact management, and coaching updates.

Authors: @caleballdrin & @dr-bizz

Detailed Changes

Initialization

  1. Task Phases Functions: Set up foundational functions and hooks for task phases.
  2. Common Functions & Components: Updated common functions, components, and tests. Pulled phase data into GraphQL constants and improved error handling.
  3. Dashboard, Search, Reports & Tools: Updated to include new phase data and fixed related tests.

Contacts

  1. Dynamic Statuses: Replaced hard-coded statuses with dynamic data.
  2. Contact Details & Modals: Updated components to use new hooks, created new modals, and enhanced contact flows.
  3. Task Logging: Added functionality to log or create tasks upon contact view changes.

Tasks

  1. Task Modals & Helper Functions: Created and edited inputs for task modals, added helper functions, and integrated phase data into the task page.

Coaching

  1. API Updates: Implemented API changes, fixed spelling errors, and updated mocks.
  2. Coaching Details: Enhanced coaching details with task phase and contact statuses.

Testing

  • Comprehensive updates to related tests, ensuring all changes are seamlessly integrated and properly validated.

Note on Branch Change

Due to the high number of commits (140) on the previous branch "MPDX-task-phases" and the resulting merge conflicts from multiple code changes, I had to move to a new branch "MPDX-task-phases-new." This new branch was created to make it easier to create and review new commits without the complexities of resolving numerous conflicts.

This approach should provide a clearer and more manageable review process.

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

Copy link

github-actions bot commented Jun 4, 2024

Bundle sizes [mpdx-react]

Compared against bc5798e

Route Size (gzipped) Diff
/_app 373.17 KB +1.82 KB
/accountLists 119.31 KB -1.21 KB
/accountLists/[accountListId] 271.02 KB -1022 B
/accountLists/[accountListId]/coaching/[coachingId] 247.8 KB +1.56 KB
/accountLists/[accountListId]/contacts/flows/setup 180.41 KB +32.63 KB
/accountLists/[accountListId]/reports/coaching 247.81 KB +1.56 KB
/accountLists/[accountListId]/reports/donations/[[...contactId]] 344.53 KB -1.99 KB
/accountLists/[accountListId]/reports/expectedMonthlyTotal 110.36 KB +1.68 KB
/accountLists/[accountListId]/settings/admin 134.94 KB -1000 B
/accountLists/[accountListId]/settings/integrations 161.77 KB -2 KB
/accountLists/[accountListId]/settings/manageAccounts 142.42 KB -1.98 KB
/accountLists/[accountListId]/settings/manageCoaches 138.97 KB -1.21 KB
/accountLists/[accountListId]/settings/organizations 136.67 KB -1.07 KB
/accountLists/[accountListId]/settings/preferences 212.4 KB -1.18 KB
/accountLists/[accountListId]/tasks/[[...contactId]] 140.72 KB +2.96 KB
/accountLists/[accountListId]/tools 142.29 KB -1.13 KB
/accountLists/[accountListId]/tools/fix/mailingAddresses/[[...contactId]] 192.19 KB -1.52 KB
/accountLists/[accountListId]/tools/fix/sendNewsletter/[[...contactId]] 117.36 KB -1.21 KB
/accountLists/[accountListId]/tools/import/csv 106.89 KB -1.22 KB
/accountLists/[accountListId]/tools/import/google 156.31 KB -2.42 KB
/accountLists/[accountListId]/tools/import/tnt 149.95 KB -2.89 KB
/login 119.37 KB -1.03 KB
Dynamic import Size (gzipped) Diff
../src/components/Contacts/ContactFlow/DynamicContactFlow.tsx -> ./ContactFlow 67.21 KB +6.16 KB
../src/components/Contacts/ContactsList/DynamicContactsList.tsx -> ./ContactsList 44.71 KB +1.86 KB
../src/components/Contacts/ContactsMap/DynamicContactsMap.tsx -> ./ContactsMap 32.38 KB +1.63 KB
../src/components/Contacts/ContactsMap/DynamicContactsMapPanel.tsx -> ./ContactsMapPanel 8.04 KB +1.8 KB
../src/components/Contacts/MassActions/Exports/Emails/DynamicMassActionsExportEmailsModal.tsx -> ./MassActionsExportEmailsModal 2.08 KB -1.02 KB
../src/components/Dashboard/ThisWeek/WeeklyActivity/WeeklyReportModal/DynamicWeeklyReportModal.tsx -> ./WeeklyReportModal 33.15 KB -1.43 KB
../src/components/EditDonationModal/DynamicEditDonationModal.tsx -> ./EditDonationModal 76.23 KB +2.1 KB
../src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/CreateMultipleContacts/DynamicCreateMultipleContacts.tsx -> ./CreateMultipleContacts 76.61 KB +1.48 KB
../src/components/Task/Modal/Form/Complete/DynamicTaskModalCompleteForm.tsx -> ./TaskModalCompleteForm 111.13 KB +12.47 KB
../src/components/Task/Modal/Form/DynamicTaskModalForm.tsx -> ./TaskModalForm 120.96 KB +14.43 KB
../src/components/Task/Modal/Form/LogForm/DynamicTaskModalLogForm.tsx -> ./TaskModalLogForm 149.69 KB +9.57 KB
../src/components/Tool/Appeal/Flow/DynamicContactFlow.tsx -> ./ContactFlow 67.21 KB +6.16 KB
../src/components/Tool/Appeal/List/ContactsList/DynamicContactsList.tsx -> ./ContactsList 44.71 KB +1.86 KB
../src/components/Tool/Appeal/Modals/PledgeModal/DynamicPledgeModal.tsx -> ./PledgeModal 74.04 KB -1.02 KB
../src/components/Tool/Appeal/Modals/UpdateDonationsModal/DynamicUpdateDonationsModal.tsx -> ./UpdateDonationsModal 103.47 KB -1.58 KB

dr-bizz added 17 commits June 4, 2024 16:22
- Pull phase data into Constants graphql
- Update test wrapper to handle and report errors
- Allow for more customization on common modal
…s well as fixing their tests

- Updating search with new Phase data
- Fixing tests in reports
- Updating settings test with new Phase data
- Update tools to use new phase hooks
- Show default views if no flows saved
- Reset to default views modal
@dr-bizz dr-bizz changed the title Task phases functionailty MPDX-7864 - Task phases functionailty Jun 4, 2024
@dr-bizz dr-bizz added the On Staging Will be merged to the staging branch by Github Actions label Jun 4, 2024
@caleballdrin caleballdrin self-assigned this Jun 7, 2024
@dr-bizz dr-bizz added the Preview Environment Add this label to create an Amplify Preview label Jun 11, 2024
Copy link

Preview branch generated at https://MPDX-task-phases-new.d3dytjb8adxkk5.amplifyapp.com

Copy link
Contributor

@canac canac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, great work with all of this! It's a huge undertaking.

Do you think that we should make the Task Type fields required? Otherwise, if you choose a type, touch the action field, then clear the type, you can get into a confusing state where the action is required but disabled.

Screenshot 2024-08-15 at 4 20 10 PM

const { t } = useTranslation();
const { openTaskModal } = useTaskModal();
const { enqueueSnackbar } = useSnackbar();
// TODO replace with ResultEnum when available
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this TODO need to be address?

? activityType
: null,
changeContactStatus: false,
nextAction: null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really liked how the next action would pre-populate, since normally after sending a text, I want to make the next task another text. Is it possible to add this feature back?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might take some work with the new way we have it set up. Maybe we could add this back later on.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a user, that's disappointing, but I understand it's a post go-live improvement.

src/components/Task/TaskRow/TaskRow.tsx Outdated Show resolved Hide resolved
src/components/Task/TaskRow/TaskRow.tsx Outdated Show resolved Hide resolved
src/components/common/Modal/Modal.tsx Outdated Show resolved Hide resolved
src/hooks/useContactPartnershipStatuses.ts Show resolved Hide resolved
src/hooks/usePhaseData.ts Show resolved Hide resolved
@caleballdrin caleballdrin self-requested a review September 4, 2024 16:25
});
break;

case PhaseEnum.Connection:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that the Google Doc says to open the add task modal when moving from Connections to Initiation. This will open the add task modal when moving from Connections to any other phase besides Archived. Are we sure this logic is correct?

Screenshot 2024-09-09 at 3 26 40 PM

Comment on lines +9 to +13
accountListId: $accountListId
tasksFilter: $tasksFilter
after: $after
first: $first
sortBy: $sortBy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these variables only have one possible value in the code. Personally, I'd hardcode them instead of making them variables in this operation. Also, $after doesn't appear to be used when calling the lazy query and can be removed.

Suggested change
accountListId: $accountListId
tasksFilter: $tasksFilter
after: $after
first: $first
sortBy: $sortBy
accountListId: $accountListId
tasksFilter: $tasksFilter
first: 1
sortBy: "START_AT_ASC"

canac and others added 18 commits September 9, 2024 16:27
The message is shown in task modal that open as a result of a contact's
status changing in flows view
[MPDX-8176] Add message to task modals in flows view
[MPDX-8175] Tweak reset flows warning message
* Rename Referral to Connection

* Rename function for filters panel
* Use correctly formatted partner status name on reports

* Use correctly formatted/translated Phase in modals
* Make the Result field an autocomplete

* Make the Reminders fields Autocomplete

* Add autoSelect
* Rename email newsletter to Digital
@@ -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'
Copy link
Contributor Author

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.

@@ -62,6 +75,7 @@ const getAccountListAnalytics = (data: {
text_message,
start_date: startDate,
end_date: endDate,
contacts_by_status,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
contacts_by_status,
contacts_by_status: contactsByStatus,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Staging Will be merged to the staging branch by Github Actions Preview Environment Add this label to create an Amplify Preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants