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

MHP 3099 -- Convert Celebrate Feed to GraphQL & Add Polling #1444

Merged
merged 34 commits into from
Feb 3, 2020

Conversation

reldredge71
Copy link
Contributor

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!

@reldredge71 reldredge71 requested a review from OzzieOrca January 30, 2020 23:17
Copy link
Contributor

@OzzieOrca OzzieOrca left a 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 😀

return (
<Fragment>
{isCommentCardVisible ? null : (
//@ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this valid JSX?

Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this valid JSX?

reldredge71 and others added 5 commits February 3, 2020 09:11
# Conflicts:
#	src/containers/Groups/GroupUnreadFeed.tsx
#	src/containers/Groups/__tests__/GroupUnreadFeed.tsx
#	src/containers/Groups/__tests__/__snapshots__/GroupUnreadFeed.tsx.snap
OzzieOrca
OzzieOrca previously approved these changes Feb 3, 2020
pollInterval: 30000,
notifyOnNetworkStatusChange: true,
Copy link
Contributor

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.

Suggested change
notifyOnNetworkStatusChange: true,

story: 'story',
createdCommunity: 'V4::Organization',
joinedCommunity: 'V4::OrganizationalPermission',
story: 'V4::Story',
Copy link
Contributor

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.

@reldredge71 reldredge71 merged commit 98ea09a into develop Feb 3, 2020
@reldredge71 reldredge71 deleted the MHP-3099 branch February 3, 2020 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants