-
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-7420 - Fix Email Addresses - add pagination #988
MPDX-7420 - Fix Email Addresses - add pagination #988
Conversation
Bundle sizes [mpdx-react]Compared against 103d35e
|
f007de0
to
0743610
Compare
FWIW, I tried upgrading |
6bc2e0f
to
a687ace
Compare
Preview branch generated at https://MPDX-7420-fix-email-addresses-add-pagination.d3dytjb8adxkk5.amplifyapp.com |
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.
Let's remove the !loading
check so that when a new batch of people are being fetched, the entire list doesn't disappear.
We also need to configure the cache policy for people
so that new results are merged into the existing array.
Also, I noticed that the "Showing x of x" text is incorrect.
Since all those suggestions are on unchanged lines, I can't add comments in GitHub, so here's a diff of the changes I'm suggesting.
diff --git a/src/components/Tool/FixEmailAddresses/FixEmailAddresses.tsx b/src/components/Tool/FixEmailAddresses/FixEmailAddresses.tsx
index 4061facbb..2589f9de2 100644
--- a/src/components/Tool/FixEmailAddresses/FixEmailAddresses.tsx
+++ b/src/components/Tool/FixEmailAddresses/FixEmailAddresses.tsx
@@ -320,7 +320,7 @@ export const FixEmailAddresses: React.FC<FixEmailAddressesProps> = ({
return (
<Container>
- {!loading && data && dataState ? (
+ {data && dataState ? (
<FixEmailAddressesWrapper container>
<Grid item xs={12}>
<Typography variant="h4">{t('Fix Email Addresses')}</Typography>
@@ -415,9 +415,12 @@ export const FixEmailAddresses: React.FC<FixEmailAddressesProps> = ({
<Box width="100%" display="flex" justifyContent="center">
<Typography>
<Trans
- defaults="Showing <bold>{{value}}</bold> of <bold>{{value}}</bold>"
+ defaults="Showing <bold>{{value}}</bold> of <bold>{{total}}</bold>"
shouldUnescape
- values={{ value: data.people.nodes.length }}
+ values={{
+ value: data.people.nodes.length,
+ total: data.people.totalCount,
+ }}
components={{ bold: <strong /> }}
/>
</Typography>
diff --git a/src/lib/apollo/cache.ts b/src/lib/apollo/cache.ts
index 307a29f11..2e962a634 100644
--- a/src/lib/apollo/cache.ts
+++ b/src/lib/apollo/cache.ts
@@ -72,6 +72,7 @@ export const createCache = () =>
contacts: paginationFieldPolicy,
donations: paginationFieldPolicy,
financialAccounts: paginationFieldPolicy,
+ people: paginationFieldPolicy,
tasks: paginationFieldPolicy,
userNotifications: paginationFieldPolicy,
// Ignore the input.pageNumber arg so that queries with different page numbers will
}) | ||
} | ||
EmptyPlaceholder={<NoData tool="fixEmailAddresses" />} | ||
style={{ |
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.
I'm seeing a tiny amount of double scrolling. I think this calc may need to be adjusted to make the list slightly smaller.
Double.scrolling.mov
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.
Changing that value can increase the double scroll but not get rid of it entirely it seems. If I hide the scrolling on overflow-y
on the <div class="css-1wkgudm">
I can get rid of the extra scroll bar. However, no height changes I've tried in the DOM make it go away.
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.
Double scrolling issues are the bane of my existence. I can't even reproduce it anymore, so I think this is OK as-is.
Update: It does, I was getting bad tests due to not having more than 25 results. |
This is causing duplicate rows in the tests and breaking them. Specifically, in |
Try updating const defaultGraphQLMock = {
GetInvalidEmailAddresses: {
people: {
nodes: mockInvalidEmailAddressesResponse,
pageInfo: {
hasNextPage: false,
},
},
},
}; Without this |
That seems odd to me that it would default mock a boolean to |
It's technically random with a deterministic seed. So you're happening to get a |
You could run the first and second queries as
You can also change the |
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.
I'm not sure that the last commit with the contacts list helps. I recommended moving it out of this PR, but I'm going to go ahead and approve because the rest looks great!
pages/accountLists/[accountListId]/tools/fixEmailAddresses/[[...contactId]].page.test.tsx
Outdated
Show resolved
Hide resolved
}) | ||
} | ||
EmptyPlaceholder={<NoData tool="fixEmailAddresses" />} | ||
style={{ |
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.
Double scrolling issues are the bane of my existence. I can't even reproduce it anymore, so I think this is OK as-is.
243e693
to
40e7d11
Compare
Getting a CORS issue all the sudden on the preview environment, but don't think that should be related to any changes here. |
Description
Jira
This PR adds an infinite list integration with the Fix Email Addresses tool. It does some improvements to the
InfiniteList
component to remove the flicker and allow for removing the gray background when we don't want it.Checklist: