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

Add hackathon projects #5414

Merged
merged 13 commits into from
Nov 6, 2019
Merged

Add hackathon projects #5414

merged 13 commits into from
Nov 6, 2019

Conversation

octavioamu
Copy link
Contributor

@octavioamu octavioamu commented Oct 29, 2019

Description
  • Projects board (w/ filters, pagination (9 x page) winners and admin managing)
  • Add project (for users only available on start work and work submission)
  • Edit project (everyone on the project team can edit in start work, work submission or project board)
  • Handle multiple projects for same bounty (you can edit your current project or add a new one)
  • Flow prompt when starting work and when finish fulfilment (after submission is minted)
  • Handle image preview and square verification.
  • You can't remove yourself from a project

Also:

  • Update select2 version
  • Fix a problem with select2 where required select wasn't working/

Project card
image

Project Modal add/edition
image

Multiple Projects handling
image

Refers/Fixes

Ref: #5322 #5420

Testing

Tested locally with a lot of diff situations, and multiple bounties, hackathon and projects
https://share.vidyard.com/watch/h5d5nv916eRiAeYK5ErnHL?

@codecov
Copy link

codecov bot commented Oct 29, 2019

Codecov Report

Merging #5414 into master will increase coverage by 0.53%.
The diff coverage is 30.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5414      +/-   ##
==========================================
+ Coverage   29.83%   30.36%   +0.53%     
==========================================
  Files         241      242       +1     
  Lines       20433    21954    +1521     
  Branches     2926     3445     +519     
==========================================
+ Hits         6096     6667     +571     
- Misses      14086    14984     +898     
- Partials      251      303      +52
Impacted Files Coverage Δ
app/app/urls.py 87.71% <ø> (-2.29%) ⬇️
app/dashboard/views.py 13.03% <11.22%> (+0.06%) ⬆️
app/dashboard/admin.py 71.29% <72.72%> (+7.58%) ⬆️
app/dashboard/models.py 50.77% <93.75%> (+0.3%) ⬆️
app/quests/views.py 15.51% <0%> (-8.9%) ⬇️
app/quests/helpers.py 18.6% <0%> (-2.64%) ⬇️
app/retail/utils.py 8.8% <0%> (-1.13%) ⬇️
app/retail/views.py 27.17% <0%> (-0.96%) ⬇️
app/app/context.py 47.45% <0%> (-0.7%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c3f67c...bd4f1c3. Read the comment docs.

app/dashboard/views.py Outdated Show resolved Hide resolved
@octavioamu octavioamu marked this pull request as ready for review November 5, 2019 01:22
@octavioamu octavioamu changed the title add hackathon projects Add hackathon projects Nov 5, 2019
@danlipert
Copy link
Contributor

looks great but the vidyard link doesn't work :( @octavioamu

@octavioamu
Copy link
Contributor Author

looks great but the vidyard link doesn't work :( @octavioamu

fixed, is the same video I posted in the squad channel https://share.vidyard.com/watch/h5d5nv916eRiAeYK5ErnHL?

Copy link
Contributor

@danlipert danlipert left a comment

Choose a reason for hiding this comment

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

Looks amazing! Really nice work - just a few suggestions and fixes

app/assets/v2/js/hackathon-projects.js Outdated Show resolved Hide resolved
@@ -53,6 +53,11 @@
{% endif %}
<span class="d-block font-title-lg">
{{ hackathon.start_date|date:"M j, Y" }} - {{ hackathon.end_date|date:"M j, Y" }}
{% if hackathon.end_date|timeuntil >= "1 min" %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the comparison here actually work? I don't think something like "8 hours" >= "1 min" works with string comparisons, but if im wrong I will be amazed at Django's usefulness :) If it turns out we need better comparison logic, according to the Django docs timeuntil will return the string "0 minutes" if the end date here is already passed so we can just check {% if hackathon.end_date|timeuntil != "0 minutes" %} https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#timeuntil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it works pretty well I used also on hackathon onboard. Django magic do it with the actual dates not strings .

Copy link
Contributor

Choose a reason for hiding this comment

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

thats crazy! magic django!

app/dashboard/views.py Outdated Show resolved Hide resolved
app/dashboard/views.py Outdated Show resolved Hide resolved
app/dashboard/views.py Outdated Show resolved Hide resolved
app/dashboard/views.py Outdated Show resolved Hide resolved
profile = request.user.profile if request.user.is_authenticated and hasattr(request.user, 'profile') else None
try:
bounty = Bounty.objects.current().get(id=bounty_id)
projects = HackathonProject.objects.filter(bounty__standard_bounties_id=bounty.standard_bounties_id, profiles__id=profile.id).nocache()
Copy link
Contributor

Choose a reason for hiding this comment

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

For the filter query here, could we just do HackathonProject.objects.filter(bounty=bounty)?

Copy link
Contributor Author

@octavioamu octavioamu Nov 5, 2019

Choose a reason for hiding this comment

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

That will work with current bounty? Because when submission the bounty id is a new one not associated with the hackathon project

Copy link
Contributor

Choose a reason for hiding this comment

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

ah I see, makes sense!

app/dashboard/views.py Outdated Show resolved Hide resolved
'projects': projects_paginated,
'order_by': order_by,
'filters': filters,
'query': q.split
Copy link
Member

Choose a reason for hiding this comment

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

do we wanna do a check if q exists ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is already request.GET.get('q', '') and I use on the view if exist to show the terms is being query

Copy link
Member

@thelostone-mc thelostone-mc left a comment

Choose a reason for hiding this comment

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

left a few comments but otherwise all chill :)

@danlipert danlipert merged commit d31397a into master Nov 6, 2019
@thelostone-mc thelostone-mc deleted the hackathon-projects branch June 27, 2020 00:49
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.

3 participants