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

MBL-1371: Only show 'Coming Soon' if project is actually pre-launch #2042

Merged

Conversation

amy-at-kickstarter
Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter commented Apr 18, 2024

📲 What

Check both displayPrelaunch and prelaunchActivated flags on Project before showing "Coming Soon" in the project status.

🤔 Why

When I swapped this page to use GraphQL, it started returning values in displayPrelaunch and prelaunchActivated which were formerly nil. This caused the status badges to be incorrect.

On a little digging, the existing logic to check for prelaunch status didn't make sense:

  • prelaunchActivated refers to whether the prelaunch page is available
  • displayPrelaunch is true if the project has not actually launched yet

I surmised that checking for both, not either, is the correct behavior.

I kept the behavior that checks the launch date - turns out that is used for detecting prelaunch projects fetched via /v1/discover i.e. search.

👀 See

I checked this by comparing the status badges for my saved projects on prod with the badges in this version. I also created a prelaunch project on staging and verified that it shows "Coming soon" until I actually hit "launch".

Screenshot 2024-04-18 at 5 14 51 PM
Screenshot 2024-04-18 at 5 16 13 PM

@amy-at-kickstarter
Copy link
Contributor Author

I just realized that BackerDashboardProjectCell is also used in our search flow. Leaving that as a task for Monday to test Search, too.

@amy-at-kickstarter amy-at-kickstarter force-pushed the bug/adyer/mbl-1371/fix-backer-dashboard-status branch from 954f7d9 to 2cbabd3 Compare April 22, 2024 14:12
@amy-at-kickstarter amy-at-kickstarter force-pushed the bug/adyer/mbl-1371/fix-backer-dashboard-status branch from 2cbabd3 to cccebec Compare April 22, 2024 14:50
switch (project.displayPrelaunch, project.dates.launchedAt, project.prelaunchActivated) {
case (.some(true), _, _),
(_, _, .some(true)):
switch (project.displayPrelaunch, project.prelaunchActivated, project.dates.launchedAt) {
Copy link
Contributor Author

@amy-at-kickstarter amy-at-kickstarter Apr 22, 2024

Choose a reason for hiding this comment

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

Reordered these arguments for clarity - the two bools, then the launch time.

@amy-at-kickstarter
Copy link
Contributor Author

amy-at-kickstarter commented Apr 22, 2024

OK, I did some additional spot checks here -

I tested search (and found and fixed a bug). Now the cards here should display the same information as cards on web for search, including for prelaunch projects:
Screenshot 2024-04-22 at 10 26 25 AM
Screenshot 2024-04-22 at 10 26 38 AM

I also created my own prelaunch project on staging, just to verify that it looks like I expect:
Screenshot 2024-04-22 at 10 12 18 AM

@amy-at-kickstarter amy-at-kickstarter marked this pull request as ready for review April 22, 2024 14:54
@amy-at-kickstarter amy-at-kickstarter requested review from a team and ifosli and removed request for a team April 22, 2024 14:54
@amy-at-kickstarter amy-at-kickstarter self-assigned this Apr 22, 2024
@amy-at-kickstarter amy-at-kickstarter merged commit 71fccc8 into main Apr 23, 2024
5 checks passed
@amy-at-kickstarter amy-at-kickstarter deleted the bug/adyer/mbl-1371/fix-backer-dashboard-status branch April 23, 2024 21:26
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