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 hooks and add new question type #6778

Merged
merged 21 commits into from
Jun 22, 2020
Merged

Conversation

zoek1
Copy link
Contributor

@zoek1 zoek1 commented Jun 5, 2020

Description
Refers/Fixes

#6443
#6818 (comment)

Testing

Full demo
https://www.loom.com/share/09491d01b0aa488f9e470bc55cba3cdd

Add images to forms
https://www.loom.com/share/96e866f704934c3187bcca800c2e0f4d

@codecov
Copy link

codecov bot commented Jun 5, 2020

Codecov Report

Merging #6778 into master will increase coverage by 0.01%.
The diff coverage is 26.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6778      +/-   ##
==========================================
+ Coverage   26.93%   26.94%   +0.01%     
==========================================
  Files         297      297              
  Lines       28373    28434      +61     
  Branches     4153     4168      +15     
==========================================
+ Hits         7641     7662      +21     
- Misses      20458    20497      +39     
- Partials      274      275       +1     
Impacted Files Coverage Δ
app/dashboard/views.py 10.56% <0.00%> (-0.06%) ⬇️
app/retail/views.py 21.53% <16.66%> (-0.14%) ⬇️
app/dashboard/models.py 49.34% <34.48%> (-0.16%) ⬇️
app/dashboard/admin.py 64.73% <44.44%> (-1.36%) ⬇️
app/dashboard/embed.py 31.60% <0.00%> (+3.44%) ⬆️

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 6d898ef...1910881. Read the comment docs.

Copy link
Contributor

@PixelantDesign PixelantDesign left a comment

Choose a reason for hiding this comment

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

Lookin good!

Could we add the background color and circular design around the avatar for these cards?

Should T's&C's be on it's own. question @frankchen07 ?

@zoek1
Copy link
Contributor Author

zoek1 commented Jun 5, 2020

I'll add the styles in another PR, i just want validate with @frankchen07 that the questions and the card works as expected, is that ok @PixelantDesign ?

hackathon=hackathon_event)
answer.open_response = entry['value']
hackathon=hackathon_event,
open_response=entry['value'])
Copy link
Member

Choose a reason for hiding this comment

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

could we fix up the indentation ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@frankchen07 frankchen07 left a comment

Choose a reason for hiding this comment

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

Thank you for the videos. It looks good to me. Just one question/comment @zoek1:

Screen Shot 2020-06-05 at 10 48 13

what's the "on" entry for the terms and conditions (single choice) question?

@zoek1
Copy link
Contributor Author

zoek1 commented Jun 5, 2020

It was an error of duplication, but now it's fixed. The "on" should not appear anymore @frankchen07

@PixelantDesign
Copy link
Contributor

sounds good! so the styling will be in another PR?

@frankchen07
Copy link
Contributor

frankchen07 commented Jun 8, 2020

@zoek1 - one more, the X to exit the survey doesn't work, you can only exit if you click outside the survey. Can we get the X to work properly? Hopefully it's not a huge fix.

If they exit prematurely, they also don't finish their registration, they'll click register again and it will drop them off at the same question they left off on. I think we can leave this as is.

@frankchen07
Copy link
Contributor

new hooks for the townsquare team formation/intro experiments look great!

also thanks for fixing single choice and single options @zoek1!

LGTM from the loom video

Copy link
Contributor

@PixelantDesign PixelantDesign left a comment

Choose a reason for hiding this comment

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

Looking great @zoek1!

The last thing I see is the image behind the profile icon on the townsquare registration card.
After that we can request engineering review!

@thelostone-mc
Copy link
Member

@PixelantDesign + @frankchen07 Approve the PR so that we know when it's good for engineering review 🙌

Copy link
Contributor

@octavioamu octavioamu left a comment

Choose a reason for hiding this comment

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

looking good Zoek, is this working fine with the others flows?
Example, when you find a hackathon bounty on normal explorer and click start work you are redirected to hackathon register page and then moved back into the bounty.
Or when you are not logged in, ask first to login?

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.

Approved in general but I do worry about the image upload handling w/ S3

def img(self, instance):
header = instance.header
if not header or not header.image:
return 'n/a'
Copy link
Contributor

Choose a reason for hiding this comment

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

why return n/a here instead of just None?

Copy link
Member

Choose a reason for hiding this comment

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

@zoek1 could you fix this up in a follow up PR please ?

header = instance.header
if not header or not header.image:
return 'n/a'
img_html = format_html('<img src={} style="max-width:30px; max-height: 30px">', mark_safe(header.image.url))
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to other reviewers - generally we probably wouldn't allow this with the mark_save tag but in this case its probably ok since only Admins should have the ability to set and add an image

@@ -5026,17 +5029,39 @@ class Poll(SuperModel):
hackathon = models.ManyToManyField(HackathonEvent)


class PollMedia(SuperModel):
name = models.CharField(max_length=350)
image = models.ImageField(
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a feeling this won't work in prod because of the way static files are handled - @thelostone-mc @octavioamu what do y'all think?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm it's done like that for a few other image fields in our model 🤔

@thelostone-mc thelostone-mc merged commit 20a6574 into gitcoinco:master Jun 22, 2020
@PixelantDesign
Copy link
Contributor

yay thanks!

@frankchen07
Copy link
Contributor

awesome, excited to get this up and going

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.

6 participants