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

Close submissions #72

Merged
merged 6 commits into from
Sep 3, 2024
Merged

Close submissions #72

merged 6 commits into from
Sep 3, 2024

Conversation

Pabl0cks
Copy link
Member

@Pabl0cks Pabl0cks commented Sep 3, 2024

Fixes #71

Used an ENV var to manage when the submission deadline, so we can know if the period is open or closed. Was not needed for us (we can merge at the exact end date) but it may be nice to have it for the generic version of the Hackathons platform.

If the ENV var doesn't exists or is not a valid date, I'm assuming the submission period is closed for security (not opening submissions by accident while configuring the hackathon).

If submission period is over:

  • /apply button dissapears in the Sticky submission info from homepage
  • Submit button in the form changes to "Submissions Closed"
  • Can't send POST submission requests, throwing an error "Submissions are closed"

In our case, we should set this in Vercel:

NEXT_PUBLIC_SUBMISSION_DEADLINE="2024-09-03T11:59:59Z"

Copy link

vercel bot commented Sep 3, 2024

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

Name Status Preview Comments Updated (UTC)
extensions-hackathon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 3, 2024 11:50am

@Pabl0cks Pabl0cks requested a review from carletex September 3, 2024 09:25
Copy link
Contributor

@carletex carletex left a comment

Choose a reason for hiding this comment

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

Discussed with @Pabl0cks about this in Telegram.

We have to be careful with timezones (and check if the dates methods are returning always UTC, or if in some instances it'll return the server / client timezone and then the check won't work correctly). The code is also using new Date() and Date.now()

Two options (since we have to close in 30 min)

  • We remove all the deadline checks and we just merged a closed version
  • We leave the NEXT_PUBLIC_SUBMISSION_DEADLINE var empty (which will assume is closed)

@Pabl0cks
Copy link
Member Author

Pabl0cks commented Sep 3, 2024

To ensure nothing will fail with date checks on different environments, changed to const isSubmissionClosed = true; approach.

When we change the repo to make it forkable and maybe hold more hackathons in the same platform, we can change the implementation to a date check, or store the status of each hackathon 🙏

@Pabl0cks Pabl0cks changed the title Close submissions based on deadline Close submissions Sep 3, 2024
@Pabl0cks Pabl0cks merged commit 099a7af into main Sep 3, 2024
3 checks passed
@Pabl0cks Pabl0cks deleted the close-submissions branch September 3, 2024 11:59
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.

Close hackathon submissions
2 participants