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-7955 - Add list filter functionality #989

Closed
wants to merge 48 commits into from

Conversation

dr-bizz
Copy link
Contributor

@dr-bizz dr-bizz commented Aug 1, 2024

Description

In this PR, I added functionality to the list view filter buttons. This includes exporting contacts & emails, adding contacts to appeals and deleting appeals. All models are dynamically loaded and preloaded when the mouse is hovered over the button that opens the modal in question.

Fixes

  • Updated the panel contact number if the user searched to show how many contacts are under each appeal status.
  • Added the ability to load dynamic components on the filter panel buttons on the mouse hover

Export contacts & emails

These models already existed, so there was less work to get them working.

Add Contacts Modal

Created a new modal that allows the user to add contacts to the appeal.

  • Edited the<ContactsAutocomplete/> to exclude contact IDs so the user doesn't see contacts that are already a part of the appeal.
  • Refreshes the contacts list to show new contacts in the contact list.

Delete Appeal Modal

Created this modal to allow the user to delete the appeal.

  • after deletion, it redirects to the user back to the appeals page

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

dr-bizz added 29 commits July 30, 2024 15:44
Copy link
Contributor

github-actions bot commented Aug 1, 2024

Bundle sizes [mpdx-react]

Compared against 63b1170

Route Size (gzipped) Diff
/accountLists/[accountListId]/contacts/[[...contactId]] 105.44 KB +1.06 KB
/accountLists/[accountListId]/tools/appeals/[[...appealId]] 105.41 KB added
/accountLists/[accountListId]/tools/appeals no change removed
/accountLists/[accountListId]/tools/appeals/[appealId] no change removed
Dynamic import Size (gzipped) Diff
../src/components/Contacts/ContactFlow/DynamicContactFlow.tsx -> ./ContactFlow 55.31 KB +14.65 KB
../src/components/Contacts/ContactsList/DynamicContactsList.tsx -> ./ContactsList 38.68 KB +9.84 KB
../src/components/Contacts/ContactsRightPanel/DynamicContactsRightPanel.tsx -> ./ContactsRightPanel 140.23 KB +4.31 KB
../src/components/Shared/Filters/DynamicFilterPanel.tsx -> ./FilterPanel 104.95 KB +4.29 KB
../src/components/Tool/Appeal/AppealDetails/EditAppealHeaderInfoModal/DynamicEditAppealHeaderInfoModal.tsx -> ./EditAppealHeaderInfoModal 28.43 KB added
../src/components/Tool/Appeal/DynamicAppealsDetailsPage.tsx -> ./AppealsDetailsPage 105.86 KB added
../src/components/Tool/Appeal/Flow/DynamicContactFlow.tsx -> ./ContactFlow 55.31 KB added
../src/components/Tool/Appeal/InitialPage/DynamicAppealsInitialPage.tsx -> ./AppealsInitialPage 79.71 KB added
../src/components/Tool/Appeal/List/AppealsListFilterPanel/AddContactToAppealModal/DynamicAddContactToAppealModal.tsx -> ./AddContactToAppealModal 3.43 KB added
../src/components/Tool/Appeal/List/AppealsListFilterPanel/DeleteAppealModal/DynamicAddContactToAppealModal.tsx -> ./DeleteAppealModal 2.25 KB added
../src/components/Tool/Appeal/List/AppealsListFilterPanel/DynamicAppealsListFilterPanel.tsx -> ./AppealsListFilterPanel 3.06 KB added
../src/components/Tool/Appeal/List/ContactsList/DynamicContactsList.tsx -> ./ContactsList 38.68 KB added

@dr-bizz dr-bizz requested a review from caleballdrin August 1, 2024 20:43
@caleballdrin caleballdrin added the Preview Environment Add this label to create an Amplify Preview label Aug 5, 2024
Copy link
Contributor

github-actions bot commented Aug 5, 2024

Copy link
Contributor

@caleballdrin caleballdrin left a comment

Choose a reason for hiding this comment

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

Great job! Just a couple of changes.

onClick={handleClearAllClick}
variant="outlined"
>
{t('Clear All')}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this button is needed. It is not on the angular.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know it's not on Angular, but when using it, I like to see all the contacts and be able to clear filters easily. Especially since we push people into the asked filter on load.

Copy link
Contributor

Choose a reason for hiding this comment

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

When I've used appeals, I've never thought of them as filters. I've thought of them more as categories. In Angular there is no Clear button and there is no option to not have a category/filter selected. The default is always the Asked category. There really is no need to see all the contacts at once. So I would suggest keeping the angular functionality.


const existingContactIds = data?.appeal?.contactIds ?? [];

const onSubmit = async (attributes: AddContactFormikSchema) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this also add the contact to the 'Asked' category?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, there isn't a filter to set that. I think the issue is that I'm not using the correct filter to grab the asked. However, there isn't a filter for it, so I'm talking to Andrew about that one too.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if filters aren't the way it is being organized in the angular.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think it's the way graphQL handles the filtering in the backend.

@dr-bizz dr-bizz force-pushed the MPDX-7955-add-header-info-functionality branch from c2648a2 to 0d73ade Compare August 23, 2024 16:07
Base automatically changed from MPDX-7955-add-header-info-functionality to main August 26, 2024 12:54
@dr-bizz
Copy link
Contributor Author

dr-bizz commented Aug 29, 2024

Closing this PR as I created a new PR to clean up the history, which I then split into 4 separate PRs to allow other devs to easily review the PRs.

@dr-bizz dr-bizz closed this Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Preview Environment Add this label to create an Amplify Preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants