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

fix: public squads integration #3118

Merged
merged 11 commits into from
May 23, 2024
Merged

fix: public squads integration #3118

merged 11 commits into from
May 23, 2024

Conversation

sshanzel
Copy link
Member

@sshanzel sshanzel commented May 20, 2024

Changes

  • Utilize queries and mutations related to requesting squads to go public.
  • Introduced a new type of Feed item to render the eligibility card.
  • Refactored the feed item type from strings to enums.
  • Make the edit settings page reflect the actual request status.
  • Display eligibility card based on status.

Events

Did you introduce any new tracking events?
Don't forget to update the Analytics Taxonomy sheet

Log the new/changed events below:

Type event_name value
Change/New event name extra: { ... }

Please make sure existing components are not breaking/affected by this PR

Manual Testing

On those affected packages:

  • Have you done sanity checks in the webapp?
  • Have you done sanity checks in the extension?
  • Does this not break anything in companion?

Did you test the modified components media queries?

  • MobileL (420px)
  • Tablet (656px)
  • Laptop (1020px)

Did you test on actual mobile devices?

  • iOS (Chrome and Safari)
  • Android

MI-336 #done
MI-344 #done

Preview domain

https://mi-336.preview.app.daily.dev

@sshanzel sshanzel requested a review from a team as a code owner May 20, 2024 03:10
@sshanzel sshanzel requested review from rebelchris, omBratteng, capJavert and nensidosari and removed request for a team May 20, 2024 03:10
Copy link

vercel bot commented May 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2024 4:39pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
storybook ⬜️ Ignored (Inspect) May 23, 2024 4:39pm

Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

Minor comments from my side :)

extends Pick<UseFeedOptionalParams<T>, 'options'>,
extends Pick<
UseFeedOptionalParams<T>,
'options' | 'showPublicSquadsEligibility'
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this be one of the options better?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that at first, but it was a type from useQuery itself. options?: UseInfiniteQueryOptions<FeedData>

Thought it would be simpler just to add it.

packages/shared/src/components/FeedItemComponent.tsx Outdated Show resolved Hide resolved
packages/shared/src/components/cards/common.tsx Outdated Show resolved Hide resolved
@@ -34,5 +73,29 @@ export const usePublicSquadRequests = (): UsePublicSquadRequestsResult => {
return {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we maybe memoize some of these?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Most of the values here are stable. I think we can memoize the status so we won't have to instantiate and calculate days all the time.

@sshanzel
Copy link
Member Author

sshanzel commented May 22, 2024

Would love to hear you guys think 👀 cc @rebelchris @nensidosari

Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

Some minor questions, think we can almost wrap this up :)

packages/shared/src/components/FeedItemComponent.tsx Outdated Show resolved Hide resolved
Comment on lines +83 to +88
const fourteenDaysAgo = subDays(new Date(), 14);
const requestDate = new Date(latestRequest.createdAt);
return fourteenDaysAgo < requestDate
? SquadStatus.Rejected
: SquadStatus.InProgress;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what was discussed on RFC, but why do we do this logic on the frontend, feels like this should be handled on API side?
CC: @capJavert

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not going to be used for validation but something we need to display some alert.

Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

Cool no blockers code wise from my side.

Copy link
Contributor

@nensidosari nensidosari left a comment

Choose a reason for hiding this comment

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

This looks good from my side as well! 🚀

@sshanzel sshanzel merged commit 6ec4d2f into MI-217-public-squads May 23, 2024
10 checks passed
@sshanzel sshanzel deleted the MI-336 branch May 23, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants