-
Notifications
You must be signed in to change notification settings - Fork 0
Contest Tile: Add support for Rolling Triage #76
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -15,7 +15,13 @@ function getContestStatuses( | |||
contestStatus: Status.UPCOMING, | |||
}; | |||
} | |||
if (isBefore(currentTime, botRaceEnd) && isAfter(currentTime, start)) { | |||
if (isAfter(currentTime, end)) { |
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.
Moved this up to the top, it avoids issues in local dev when the botrace time of 1 hour is longer than the contest in tests. It's also a good early exit anyway
contestStatus: Status.ENDED, | ||
}; | ||
} | ||
if (isBefore(currentTime, botRaceEnd) && (isAfter(currentTime, start) || isEqual(currentTime, start))) { |
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.
Added isEqual here, it fixes the issue where if currentTime and start happen to be equivalent the undefined
status' get returned.
botRaceEnd, | ||
formattedEnd: format(endDate, "d MMM h:mm a"), | ||
formattedStart: format(startDate, "d MMM h:mm a"), | ||
timeZone: timeZone, | ||
formattedBotRaceEnd: format(botRaceEnd, "d MMMM h:mm a"), | ||
formattedBotRaceEnd: format(botRaceEnd, "d MMM h:mm a"), |
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 was formatted differently, which I noticed in the tests. We don't have bot races anymore, but I figured these should match the other date formats.
3014dff
to
2be0198
Compare
Rolling triage audits won't resume exactly at the resume time, so this gives some leeway
There's more reworking that needs to happen here. We need the audit status as we have to take into account whether or not the audit is paused as that can be transitioned manually and cause things like resumption to happen early. The logic in here will need to get refactored. Ideally we should just be passing Audit partial objects around instead of picking specific fields, because it forces us to modify params all over the place when we just want to add another prop. |
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.
All looks good, love the tests and extra storybook examples! Sorry i sent you on a goose chase there with the recently changed implementation on the main site!
Content changes are in, going to start the release train. |
Summary
ContestCountdown
, that wraps the Countdown component and only requires a ContestSchedule and the optional click handler. It will automatically handle the language selection that's usually owned by the parent component and repeated in multiple places.References