-
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
MHP 3099 -- Convert Celebrate Feed to GraphQL & Add Polling #1444
Conversation
# Conflicts: # src/components/CelebrateItem/index.tsx # src/containers/CelebrateDetailScreen/__tests__/__snapshots__/CelebrateDetailScreen.tsx.snap # src/containers/CelebrateDetailScreen/index.tsx # src/containers/CelebrateFeed/__tests__/__snapshots__/CelebrateFeed.tsx.snap # src/containers/CelebrateFeed/index.tsx # testUtils/globalMocks.ts
src/containers/CelebrateDetailScreen/__tests__/CelebrateDetailScreen.tsx
Outdated
Show resolved
Hide resolved
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.
Yay more GraphQL! 🎉 Looks pretty good 😀
src/containers/CelebrateDetailScreen/__tests__/CelebrateDetailScreen.tsx
Outdated
Show resolved
Hide resolved
src/components/CelebrateCommentBox/__tests__/CelebrateCommentBox.tsx
Outdated
Show resolved
Hide resolved
src/containers/CelebrateDetailScreen/__tests__/CelebrateDetailScreen.tsx
Outdated
Show resolved
Hide resolved
src/containers/CelebrateDetailScreen/__tests__/CelebrateDetailScreen.tsx
Outdated
Show resolved
Hide resolved
return ( | ||
<Fragment> | ||
{isCommentCardVisible ? null : ( | ||
//@ts-ignore |
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.
Is this valid JSX?
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.
Same as above. The JSX renders fine and there are no lint errors, so I guess it's valid?
{isMineNotReported ? <Flex value={1} /> : null} | ||
{menuActions ? ( | ||
<PopupMenu | ||
// @ts-ignore |
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.
Is this valid JSX?
<CommentItem | ||
//@ts-ignore |
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.
Is this valid JSX?
# Conflicts: # src/containers/Groups/GroupUnreadFeed.tsx # src/containers/Groups/__tests__/GroupUnreadFeed.tsx # src/containers/Groups/__tests__/__snapshots__/GroupUnreadFeed.tsx.snap
pollInterval: 30000, | ||
notifyOnNetworkStatusChange: true, |
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.
This is already the global default https://github.com/CruGlobal/missionhub-react-native/blob/develop/src/apolloClient.ts#L84.
notifyOnNetworkStatusChange: true, |
story: 'story', | ||
createdCommunity: 'V4::Organization', | ||
joinedCommunity: 'V4::OrganizationalPermission', | ||
story: 'V4::Story', |
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 made https://jira.cru.org/browse/MHP-3161 so hopefully we can just generate this type from the API in the future.
Forgive me, I had no idea where to end on this!
I took the three screens that have the celebrate feed (GroupCelebrate, GroupUnread, and MemberCelebrate), ripped out the celebration feed stuff, and had all of the celebrate feed handling happen inside CelebrateFeed. I converted it to GraphQL so that we could add polling, refreshing every 30 seconds.
In doing so, there were MANY sub-components and screens branching off of CelebrateFeed that needed to be updated. Some needed to be converted from snake_case to camelCase due to the GraphQL change. Also several components were expecting organization to be a property of celebrateItem, which it is not in GraphQL, so I had to find work-arounds. I also decided to apply the new GraphQL generated types everywhere I could find. There were several components that would have broken if I left them untouched-- and then a few more that I probably could have left alone but felt good to convert.
I'm pretty sure I went overboard on this one. Let me know if there is anything that you want me to revert or improve. Thanks in advance!