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

Adds fund branding organisation information with a bounty #2039

Merged
merged 10 commits into from
Sep 24, 2018

Conversation

SaptakS
Copy link
Contributor

@SaptakS SaptakS commented Aug 20, 2018

Description
  • Allows funder to add fund branding organisation in the funding form
  • Gitcoinbot comments the fund branding information as part of the comment.
Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)

funder form, gitcoinbot comment, model, migration

Testing
Refers/Fixes

Fixes: #1895

@@ -431,11 +431,12 @@ def build_github_notification(bounty, event_name, profile_pairs=None):
learn_more_msg = f"* Learn more [on the Gitcoin Issue Details page]({absolute_url})"
crowdfund_amount = f"(plus a crowdfund of {bounty.additional_funding_summary_sentence})" if bounty.additional_funding_summary_sentence else ""
crowdfund_thx = ", ".join(f"@{tip.from_username}" for tip in bounty.tips.filter(is_for_bounty_fulfiller=True) if tip.from_username)
funding_organisation_brand = f"__ as part of the {bounty.funding_organisation} fund" if bounty.funding_organisation else ""

Choose a reason for hiding this comment

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

E501 line too long (127 > 120 characters)

@SaptakS
Copy link
Contributor Author

SaptakS commented Aug 20, 2018

I haven't tested the gitcoinbot functionality whether it is working properly. @mbeacom can you help me with testing it and put this on staging?

Also, as mentioned in the issue, I was unable to find a way to comment in red in github. If anyone knows any alternative or feels the copy should be changed somewhere, please comment.

@codecov
Copy link

codecov bot commented Aug 20, 2018

Codecov Report

Merging #2039 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2039      +/-   ##
==========================================
+ Coverage   27.77%   27.79%   +0.01%     
==========================================
  Files         140      140              
  Lines       11358    11360       +2     
  Branches     1542     1542              
==========================================
+ Hits         3155     3157       +2     
  Misses       8093     8093              
  Partials      110      110
Impacted Files Coverage Δ
app/dashboard/router.py 28.26% <ø> (ø) ⬆️
app/dashboard/helpers.py 17.2% <ø> (ø) ⬆️
app/dashboard/models.py 50.19% <100%> (+0.03%) ⬆️
app/dashboard/notifications.py 16.98% <100%> (+0.16%) ⬆️

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 88ae18a...42a5f42. Read the comment docs.

@owocki
Copy link
Contributor

owocki commented Aug 20, 2018

note that we'll have to make this compatible with #1528 eventually

@owocki
Copy link
Contributor

owocki commented Aug 20, 2018

code LGTM; didnt test tho

@owocki
Copy link
Contributor

owocki commented Aug 20, 2018

note that mitch was requesting that ECF branding be available on the bounty details / issue explorer pages too on his issue ...

not just in the github issue

@@ -407,6 +407,7 @@ def create_new_bounty(old_bounties, bounty_payload, bounty_details, bounty_id):
'contract_address': bounty_details.get('token'),
'network': bounty_details.get('network'),
'bounty_type': metadata.get('bountyType', ''),
'funding_organisation': metadata.get('fundingOrganisation', ''),
Copy link
Contributor

Choose a reason for hiding this comment

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

this key shuld be added to latest_old_bounty_dict in this file

@SaptakS
Copy link
Contributor Author

SaptakS commented Aug 21, 2018

@owocki I thought we decided in the issue to go with option 2, which is adding to the github issue. I can add to bounty details and issue explorer page, but then I need what I need to add. Will the logo be different or just a copy or something else?

@owocki
Copy link
Contributor

owocki commented Aug 21, 2018

asked on #1895 (comment) --- i think for now lets just deploy solution 2 and only do solution 1 if mitch replies affirmatively

@SaptakS
Copy link
Contributor Author

SaptakS commented Aug 21, 2018

Cool

@@ -929,6 +929,7 @@ def bounty_details(request, ghuser='', ghrepo='', ghissue=0, stdbounties_id=None
if issue_url:
try:
bounties = Bounty.objects.current().filter(github_url=issue_url)
print(bounties)
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 need this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope.

thelostone-mc
thelostone-mc previously approved these changes Aug 22, 2018
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.

👍

@@ -244,6 +244,7 @@ class Bounty(SuperModel):
idx_project_length = models.IntegerField(default=0, db_index=True)
idx_status = models.CharField(max_length=9, choices=STATUS_CHOICES, default='open', db_index=True)
issue_description = models.TextField(default='', blank=True)
funding_organisation = models.TextField(null=True, blank=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

@SaptakS Will this ever be greater than 255 characters? If not, would you mind switching it to a models.CharField(blank=True, max_length=255) or whatever the max length might be (probably less... 100 maybe?) and dropping the null=True - Typically, you don't want to set null=True on TextField or CharField.

Following the change, can you delete and recreate the migration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. I will put default='' in that case

@thelostone-mc
Copy link
Member

@saptak wanna just console.log the output and test this out ?

@mbeacom mbeacom merged commit c029aa9 into gitcoinco:master Sep 24, 2018
@mkosowsk
Copy link

@mbeacom @SaptakS this is now live, correct?

When funding an issue I'm not sure where to look to fill out this info 🤔

Is it part of the https://gitcoin.co/funding/new?url=https://github.com/EXAMPLE page?

@mbeacom
Copy link
Contributor

mbeacom commented Sep 24, 2018

@mkosowsk It just went live. If you refresh the new funding page, you should see the new input field.

@mkosowsk
Copy link

@mbeacom superb! Thanks for the help 👍

Looks great @SaptakS 🥇

SaptakS added a commit that referenced this pull request Sep 26, 2018
* Adds fund branding organisation information with a bounty

* makes stickler happy

* Related to Kevin's comment

* Makes changes in the model file

* Update migration file

* Modifies migrations to prevent conflict
mbeacom pushed a commit that referenced this pull request Oct 10, 2018
* Fix #1976 - Adjust gitcoin bot get_notifications to use pygh

* - Captured prevention of advanced payout form submission when recipient githu username is empty

Fixes: #2010

* better handling of delete requests for accounts

* Adjust makefile entry for collectstatic

* Adjust travis gh-pages deployment to only run following the lint-test stage

* Adds all activities

* Resolve #2234 - Remove error prone ja i18n and update all untranslated str for django and djangojs

* Fixes the tab module

* Profile activity_type

* Resolve autotranslate errors and compile messages

* Adds all activities with different category

* Adds tips in the activities

* Removes current categories

* html: updated text on banner contributor page

* feedback : added review

- added media queries
- adds translations + fixed spacing

* Fix #2246 - Switch org param to query icontains vs contains

* Fix #2246 - Switch org_bounties query to icontains vs contains to resolve bounty counts on org page

* css: removing multiple font-family declarations (#2192)

* css: removing multiple font-family declarations

* pydocmd: added styleguide

* Wipes out font-family from random css

* sync_geth across entire stdbounties id set 3x a week

* fix for #2248 (comment)

* Hack for:

In [4]: for tip in Tip.objects.filter(from_name='False'):
   ...:     print(tip.pk, tip.from_name)
   ...:
311 False
312 False
313 False
318 False
319 False
323 False
338 False
339 False
350 False
351 False
383 False
390 False
391 False
316 False
448 False
449 False
461 False
462 False
508 False

* fix for case sensitivitty

* Fix #2258 - Allow hidden users to view own profile from /profile/handle vs only /profile/

* Add current_profile check before accessing handle in profile_helper

* Add VSCode remote debugging handling and documentation

* Fix eslint on receive.js - travis

* Add emphasis to envvar addition before down/up of compose services for vscode debugger

* Adjust vscode launch.json snippet for default GC setup in docs

* Stopgap fix for premailer not honoring django static or templating vars for asset paths

* Adjust premailer to use base_url

* Keyword in title of Issue Explorer

* Update roundup email for 21SEP2018 (#2264)

* Update roundup email for 21SEP2018

* copy updates

* fix box position bug in select2

* Pin markdown package to resolve DRF markdown.version issue

* Fix #2232 - Adjust ENS hash txns to allow blank, switch to default empty str, and catch if empty (#2233)

* Adds fund branding organisation information with a bounty (#2039)

* Adds fund branding organisation information with a bounty

* makes stickler happy

* Related to Kevin's comment

* Makes changes in the model file

* Update migration file

* Modifies migrations to prevent conflict

* Increase Funding Limit Request Form (#2209)

* Increase Funding Limit Request Form

Fixes #2199

* Increase Funding Limit Request Form: lint

* Increase Funding Limit Request Form: lint

* Adjust dashboard migrations for conflicts

* not every contract has 18 token decimals

* updates documentation (#2270)

* gas price wei issue

* Adds Activity type and date

* Makes the issue title a required field in new funding

* Temporarily removes advanced payout as an option

* Update roundup email for 28SEP2018 (#2298)

* Adjust GH get_gh_notification handling

* Adjust notification count handling in get_notifications

* Adjust issue_details to use profile access token

* Fix #2299 - Update path to gitcoinbot readme...

* Adjust document refs for user to currentProfile and pass token to issue dets endpoint

* Fix #2305 - Resolve get_amount 404 on new bounty page (#2306)

* avatar: added space cadet clothing

Fixes : #1663

* WIP: Make It Clear Issue Has Been Crowdfunded V2

Fixes #2164

* svgo coin.svg

* crowdfunding: some ui updates.

Also revamped the additional_funding_summary bounty-property

* crowdfunding: small adjustments

* crowdfunding: fix-isort

* crowdfunding: final bits

* crowdfund: stylefix again

* crowdfund: lint

* crowdfunding: style fixes

* crowdfunding: responsive fix

* crowdfunding: decimal places 2 -> 3

* crowdfunding: fix accordion rotation

* crowdfunding: another round of improvements

* crowdfunding: ditto

* crowdfunding: hiring logo and layout

* crowdfunding: hiring logo

* bounty: hide start + submit work for funder (#2315)

Fixes: #2308

* Fix travis

* crowdfunding: normalizeAmount - decimals for tokens = 3 and dollar = 2

* Adjust loggers for gitcoin bot

* Adjust loggers for gitcoin bot

* Resolve no profile attr errors

* Add GH ratelimit healthcheck, job, cmd and additional Infura specific healthcheck (#2318)

* Add GH ratelimiting cmd/job/hc and infura pinned hc

* Remove moved healthcheck imports

* Adjust pydocmd config with new healthchecks path

* #2320

* make fix

* fix overflowing text on toolbox cards

* Fix #2329 - Adjust email template URL references and fix bad ref

* fix ios text (#2326)

* str object has no method get

* fixed parsing color from path containing domain name in avatar builder (#2321)

Fixes: #2150

* Catch on AttributeError and log sync_github errors to sentry

* lead engineer

* fix for https://sentry.gitcoin.co/gitcoin/gitcoin-prod-backend/issues/1153/?referrer=slack

* take users word for it if no gitcoin profile

* search github

* code review

* Adjust Travis config to handle GeoIP dbs (#2338)

* Add GeoIP deps to Travis env

* Derp - sudp apt-get commands

* Darn sudos

* Add search methods

* Hook up search method to user_search

* Adjust lookup to pass current token

* Add current_profile and adjust obj ref

* Timborden/location leaderboards (#2268)

* adds leaderboard by city/country/continent

* is_user_based

* code review

* test fix

* is_user_based

* is user based

* Update leaderboard tests and profile login geoIP lookup

* Resolve linting errors

* Resolve bug

* More linting fixes

* Code review changes

* Code review fixes

* Fix #2342 - Upgrade to Django 2.1.2

* mutates jobs a little bit

* Fix tooltip of start and stop work links

* Display tip received time only if it exists

* re-enables org profiles (#2343)

* Fix assemble_leaderboard

* Adds tooltip on top of user input field in Advanced payout and Basic payout

* Migrate image converter to pyvips (#2346)

* Migrate image converter to pyvips

* Remove old methods

* Adjust docstring for convert_img

* Add libvips to travis deps

* Remove unused wand import - derp

* cancel rate

* - added font class to body tag

Fixes: #2280

* refactored custom tooltip

* WIP: Feature/increase dashboard tests coverage (#858)

* dashboard: Tests cleanup.

* fixed timezone warnings
* added @staticmethod decorators where needed
* introduced consistent test naming scheme, all classes deriving from TestCase end with Test
* PEP8 line too long warnings fixed by splitting to multiline strings
* added __init__.py to let pytest find all tests when running `docker-compose exec web pytest app/dashboard/tests/*`

Refs: #607

* test_dashboard_models: Add test_exclude_bounty_by_status.

Verify that bounties can be excluded by status.

Refs: #607

* test_dashboard_models: Add test_relative_bounty_url_with_malformed_issue_number test.

The test verifies relative bounty url when malformed issue number is provided.

Refs: #607

* test_dashboard_models: Add test_get_natural_value_if_bad_token_address_provided test.

Natural value should be zero when bad token address is provided.

Issue: #607

* test_dashboard_models: Add bounty submit after expiration date tests.

Add tests:

* test_can_submit_legacy_bounty_after_expiration_date
* test_cannot_submit_standard_bounty_after_expiration_date
* test_can_submit_standard_bounty_after_expiration_date_if_deadline_extended

Refs: #607

* test_dashboard_models: Add test_title_or_desc test.

Test test_title_or_desc bounty property. Verify it returns bounty title if defined.

Refs: #607

* test_dashboard_models: title_or_desc shall return GitHub URL if no title.

Refs: #607

* test_dashboard_models: test github_issue_number.

Refs: #607

* test_dashboard_models: test github_org_name.

Refs: #607

* test_dashboard_models: test github_repo_name.

Refs: #607

* test_dashboard_models: test bounty status.

Refs: #607

* test_dashboard_embed: Add embed tests.

* test_wrap_text
* test_summarize_bounties
* test_stat
* test_embed

Issue: #607

* test_dashboard_embed: Add bounty to embed test.

Refs: #607

* test_dashboard_embed: Add avatar test.

Refs: #607

* test_dashboard_embed: Travis vs rate limiting.

GitHub API is restricted https://developer.github.com/v3/#rate-limiting
Test will also pass in that scenario. Other than that later we can mock the response.

Refs: #607

* test_notifications: Test craiglist post.

Refs: #607

* test_dashboard_utils: Add get_bounty and bounty contract tests.

* test_get_bounty
* test_get_bounty_contract

Refs: #607

* test_dashboard_utils: add get_bounty_id tests.

* test_get_bounty_id_from_db
* test_get_bounty_id_from_web3

Refs: #607

* Update test_dashboard_embed.py

* Line length

* Remove stat

* Update test_dashboard_models.py

* Remove avatar view test and fix indentation throughout new tests

* Resolve travis failures

* Remove some tests we shouldn't be performing

* Remove craigslist test and unused imports

* Bounty Requests: Move to django forms (#2096)

* Bounty Requests: Move to django forms

* Bounty Request: Fix form label binding

* Bounty Request: Fix last commit

* Disable leaderboards by location on live

* Update roundup email for 5OCT2018 (#2360)

* Update roundup email for 5OCT2018

* Review updates @owocki

* Adjust ES subscriber creation for odd doesnotexist bug

* payout: added autocomplete (#2296)

* added autocomplete

* fix user search

* fix lint

* prettified autocomplete

* stickler: fixes

* autocomplete : fixes

* enable advanced payout

* updated button styling

* Added title and meta tags (#2231)

* Added meta and canonical tags

* Added funding detail tags

* if -> elif and dropped unused assignments

Added translation blocks

* save recent searches in tabs above search bar -- like http://www.hipmunk.com/ does (#1447)

* save search recents

* linting

* removes save search button

* copy

* search history: css udpate

* fix: eslint errors

* do not save searches that are already ssaved

* deletes

* linting

* Fix eslint

* Remove title...

* remove title from about

* a new hairstyle, a tri-pony tail

* Update utils.py

fixed line that was 100+ chars

* Update utils.py

deleted whitespace

* - remove previous change
- add `g-font-muli` to `shared/nav.html`

* avatar: fixed pony tail

* Created new accessory cateogory Masks and created a Jack-o-Lantern Mask

* avatar: fix masks accessories

* lint fixes

* Added tooltip hover on tips page

* tip : autocomplete shows payout address (#2372)

* tip : autocomplete shows payout address

* remove repeating code

* results page should not destroy my CPU when it first loads... onnly load mesh data if/when needed

* adds mesh network gif

* number transactions

* pie chart

* some more fixes for results page

* bug: advanced payout

fixes: #2380

* lint fixes

* added feedback comments

* Adding live exemplars with proper formatting.

* ability to post leaderboard to slack

* updated leaderboard

* templates

* ethereum blockchain messaging removal

* fixes up the quarterly stats emails so they can be send

* npm audit

* npm audit

* npm update

* a few small fixes

*  a few small stat email fixes

* css

* still trying to fix the css

* one last time

* lorem ipsum somehow made it in

* landing: contributor page (#2405)

Fixes: https://github.com/gitcoinco/Marketing/issues/11

* top 3 thing

* fixes increase payout #2407

* hott new unfurl image for /results

* add a custom ERC20 token

* grants/index: refactor

* grants/new : refactor + update

- enable adding team-members in form
- remove duplicate file new_grant.js
- custom css + lint fix
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.

Request for Adding Fund Branding to Gitcoin Pages and Gitcoinbot Messages
6 participants