Skip to content

Commit fefe021

Browse files
octavioamuthelostone-mcowockichibieiRhonin
authored
Grants round 8 (#7900)
* setup json grants endpoint and view * add remove from cart * add model fields * add styles * template changes * links on cat * grant edition * Kevin fix multigrant (#7870) * n:n matching rounds <> grants * add migration * chore: tiny fixes Co-authored-by: owocki <[email protected]> * fix(grant): validate twitter handle for /grants/new (#7890) * fix(grant): validate twitter handle for /grants/new * fix(grants): validate twitter handle in /new * fix broken grant creation + add region support * Idena Integration (#7646) * Added basic setups * Implemented rest of flow * Import refactoring * Compress new image * Removed Idena from soon section * Typo * Redesign idena trust section * Check for idena uniques * Applied review suggestion * Added idena disconnect button * Moved idena_token from database to redis * Moved idena_nonce from database to redis * Moved idena_status and is_idena_verified to db from redis * Added update_idena_status command * Added recheck button * Added daily cronjob for update idena status * Added idena to post data * Added idena to clr calculation * Added idena to trust bounes * Typo * Some tweaks * Recreated migration Co-authored-by: Aditya Anand M C <[email protected]> * recreate migration * Add Saturation Documentation (#7887) * add quick documentation on saturation methods. * add saturation documentation migration Co-authored-by: Aditya Anand M C <[email protected]> * set default prediction curve * another fix * save grant * saving grant is killing me * was a comma... * fix quill render * add editable fields * video in description * refactor of grantclr to make the round_num an actual int + add a subround/customer field (#7685) * WIP refactor * linter * adds customer field * fix: help texts in model fields * fix(views): sub_round_slug default should be 'all' * attempt at frontend todos * feat: make customer_name & sub_round_slug optional - add unique_together constraint * feat: more params to clr_grants view and /clr urls * feat: implement new clr params in frontend * feat: new migration * feat: add new clr params in card info * update pledge grant creation * merge migrations Co-authored-by: Chibuotu Amadi <[email protected]> * add new endpoint for grant cancellation (#7912) * cancel grant * zkSync refactor (#7899) * Initial setup and cleanup for zksync refactor * zkSync CheckoutManager now implemented and working * Handle unsupported tokens and update fee estimate accordingly * Support fee estimation, delete old zksync code, pass data to parent with events * Add zkSync modal with all required functionality * Add zksync balance check, warn user if closing window after checkout started * Bump zksync version * Add missing grant_type field to default Rinkeby grants, update zksync gas estimate (#7915) * fix for grants without type * Add ActiveCLR Navigations (#7877) * Add custom display text and owner to model * Include active_clr rounds in context data * Update the sidebar with active_clr links * Add active CLRs on grants top * Fix spacing * Make banner clickable * Fix sidebar activerounds link * Reorder sidebar * Fix indent * Redo migrations * Use gitcoin icon as default * Fix indent * Hide sidenav if no active CLR rounds * fix: use sub_round_slug in active_clr_round display * new migration * use sub_round_slug in sidebar_search * indent code * chore: update help text * fix issue * update help text * improve display of clr round text Co-authored-by: Chibuotu Amadi <[email protected]> Co-authored-by: Aditya Anand M C <[email protected]> * chore(grants): estimate clr via celery (#7913) * chore: move predict_clr to celery task * keep predict_clr login in clr.py; house keeping * update clr print statements with sub_round_slug * add debug comment to predict_clr task * move print statements to predict_clr celery; use passed args * review feedback * add missing 'self' argument to predict_clr task Co-authored-by: Aditya Anand M C <[email protected]> * ui: redo collection UI #7750 (#7929) * Make Grant Banner/Bacgkround image customizable (#7855) * Fix reverse url issue by checking if params exist * Fix typo * Create model and register in Admin * Display custom routing policy * Add comment to model class and fix display in admin * Fix incorrect variable spelling * Redo Migrations * Create new model and add further model docs * Removed trailing comma * recreate migration Co-authored-by: Aditya Anand M C <[email protected]> * fix styles and model repr * Implement new contributions flow (#7891) * Implement new flow * backend wiring * update banner button styling * minor fix Co-authored-by: Aditya Anand M C <[email protected]> * Check if query params exists before attempting to access elements / Grants auto fill (#7898) * Check if query params exists before attempting to access elements * Uncomment block * Rewrite to use URLSearchParams * add image upload to details edit * fix code * bump eslint optional-chaining support and fix lint errors * remove prints * Refactor And Improve The Trust Bonus Tab (#7934) * Replace the Ad-hoc Trust Bonus UI with a single Vue App * Remove the trust bonus template and replace it with a new one that uses Vue top to bottom * Create a re-usable Vue component for active trust service rows, with events for callbacks, and slots for overriding any given component of the UI as needed * Create individual Vue components for each of the modal views required by certain trust services, including refactoring the BrightID implementation to use Vue * Cleanup copy and design of the POAP modal * Convert the new Idena row to use the Vue component * Rip all SMS verification code out of the cart * Show Trust Bonus message in cart based on all services * Send a single email for all grant items in cart (#7880) * Send a single email for all items in cart Don't send an email for negative grant contribution as well as wait for grant processing task to complete before sending Remove old code Remove space Remove unused import Update with new templates Co-authored-by: Miguel Angel Gordián <[email protected]> * Ensure styles are the same * Remove chord * Update thank_you_for_supporting.txt * Fix sync helper to use new api Co-authored-by: Miguel Angel Gordián <[email protected]> * bump travis node version * Generate collection thumbnail (#7587) * Genrate collection thumbnail * Fix tuple error on grant url * Update avatar for collection thumbs * #7822 * travis npm cache false * travis syntax * compress image and upload logo * add "maximize your grant" blog link to new grant email (#7945) * Grants checkout POST request + tx validator updates (#7942) * Some cleanup/prep before updating POST requests * Saves and deletes JSON store for standard checkout * Working POST requests with validation for L1 and L2 checkout * Various validator changes and setup + upgrade zksync-checkout version + enforce from address * Add migration for updating checkout_type field * Add checkout_type support, fix beforeunload handler, bump zksync-checkout version * Set checkout_type on contribution creation * Remove unused grant checks and unused zksync-recovery code * Validator properly validates zkSync transactions * a/b test of sort order (#7941) * #7792 * redo mig + fix indent Co-authored-by: Aditya Anand M C <[email protected]> * add twitter verification * missing migration * quick view * fix styles and bugs * Fixing idena verified badge (#7946) * fix broken UI * show my items only if user is logged in * update text in did you know * update helptext + make background_image in GRPolicy * add policy name in GRPolicy * update grant cancel text * split button into 2 lines * round off decimals * remove current/past sponsors * fix broke CLR URL in UI * ensure rectangular CLR banner gets applied on landing * fix banner image + append / to url * clear error on successfull submit * hide prediction curve when grant is not part of CLR * title styles * fix UI error * enable tabs * styles for tx tab * show only active grant types in UI * back link * fix rerender rich description * Fix incorrect donation summary values (#7952) * make label clickable * add idle grants * validation * fix edit grants bug * add browser validation * strict validation * hide follow on logout * fix checker for landing * post_data fix for grants round 8 * update grant count * broken addToCart URL * fix grant edit flow * chore: show view collection instead on add to cart in explorer * ensure logged in user sees fav + add to collection * fix broken code * Fix display of some collections (#7960) * revert: multiple contrib -> 1 email change * Fixes grants 8 (#7962) * Fix checkIsCurator function * Fix removeCollection function due to bad object construction * Remove mandatory @ and validate twitter urls * add is on team for cart * change card state from sidebar * small clr styles * fix(grants): backend twitter validation (#7961) * revert: multiple contrib -> 1 email change * fix: twitter validation * validate twitter handle in grant edit * add missing '@' symbol * fix if logic * improve backend validation * fix spacing * fix indentation * return response; save username in db Co-authored-by: Aditya Anand M C <[email protected]> * add back sidecart to details * add compressor to grants creation * Bump zksync version, prevent user from clicking standard checkout button twice (#7972) * Open Idena download link in a new tab (#7973) * Fix twitter profile verification error (#7974) * fix thumbail and grant preview on mini collections view (#7975) * unify styles * fix broken ts * fix twitter username validation in frontend (#7976) * fix edit grants not working (#7977) * remove logo watcher * collections card images css * Email & other fixes (#7964) * quest_of_the_day return 0 if length is 0 * Returns an IndexError otherwise * fix: remove <br/> * the buttons need to be placed sideways * Minor ui fix * Replace Slack icon to Discord invite in emails' footer * update gr8 twitter cards (#7980) * eslint Co-authored-by: Aditya Anand M C <[email protected]> Co-authored-by: owocki <[email protected]> Co-authored-by: Chibuotu Amadi <[email protected]> Co-authored-by: Rhonin <[email protected]> Co-authored-by: fronk <[email protected]> Co-authored-by: Matt <[email protected]> Co-authored-by: Abdulhakeem Adetunji Mustapha <[email protected]> Co-authored-by: Miguel Angel Gordián <[email protected]> Co-authored-by: Ben DiFrancesco <[email protected]> Co-authored-by: corydickson <[email protected]> Co-authored-by: Angela Gilhotra <[email protected]> Co-authored-by: Dan Lipert <[email protected]>
1 parent 4ad250a commit fefe021

File tree

107 files changed

+6347
-4499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+6347
-4499
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"plugins": [],
1616
"parserOptions": {
1717
"sourceType": "module",
18-
"ecmaVersion": 9,
18+
"ecmaVersion": 2020,
1919
"ecmaFeatures": {
2020
"modules": true,
2121
"arrowFunctions": true,

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ python: 3.7
33
dist: xenial
44
sudo: true
55

6-
node_js:
7-
- "9"
6+
node_js: 14
87

98
os:
109
- linux
@@ -15,6 +14,7 @@ services:
1514
- redis-server
1615

1716
cache:
17+
npm: false
1818
directories:
1919
- $HOME/.cache/pip
2020
- node_modules

app/app/fixtures/grants.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"image_css": "",
3131
"activeSubscriptions": "[]",
3232
"hidden": false,
33-
"team_members": [33]
33+
"team_members": [33],
34+
"grant_type": 1
3435
}
3536
},
3637
{
@@ -64,7 +65,8 @@
6465
"image_css": "",
6566
"activeSubscriptions": "[]",
6667
"hidden": false,
67-
"team_members": [33]
68+
"team_members": [33],
69+
"grant_type": 1
6870
}
6971
},
7072
{
@@ -98,7 +100,8 @@
98100
"image_css": "",
99101
"activeSubscriptions": "[]",
100102
"hidden": false,
101-
"team_members": [33]
103+
"team_members": [33],
104+
"grant_type": 1
102105
}
103106
},
104107
{

app/app/settings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,4 +893,8 @@ def callback(request):
893893
ADDEVENT_CLIENT_ID = env('ADDEVENT_CLIENT_ID', default='')
894894
ADDEVENT_API_TOKEN = env('ADDEVENT_API_TOKEN', default='')
895895

896-
BRIGHTID_PRIVATE_KEY = env('BRIGHTID_PRIVATE_KEY', default='wrong-private-key')
896+
BRIGHTID_PRIVATE_KEY = env('BRIGHTID_PRIVATE_KEY', default='wrong-private-key')
897+
898+
# Idena
899+
IDENA_TOKEN_EXPIRY = 60 * 60 # 1 Hours
900+
IDENA_NONCE_EXPIRY = 60 * 2 # 2 Min

app/app/urls.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,26 @@
151151
dashboard.views.profile_tax_settings,
152152
name='profile_set_tax_settings'
153153
),
154+
url(
155+
r'^api/v0.1/profile/(?P<handle>.*)/start_session_idena',
156+
dashboard.views.start_session_idena,
157+
name='start_session_idena'
158+
),
159+
url(
160+
r'^api/v0.1/profile/(?P<handle>.*)/authenticate_idena',
161+
dashboard.views.authenticate_idena,
162+
name='authenticate_idena'
163+
),
164+
url(
165+
r'^api/v0.1/profile/(?P<handle>.*)/logout_idena',
166+
dashboard.views.logout_idena,
167+
name='logout_idena'
168+
),
169+
url(
170+
r'^api/v0.1/profile/(?P<handle>.*)/recheck_idena_status',
171+
dashboard.views.recheck_idena_status,
172+
name='recheck_idena_status'
173+
),
154174
url(
155175
r'^api/v0.1/profile/(?P<handle>.*)/verify_user_twitter',
156176
dashboard.views.verify_user_twitter,
@@ -198,6 +218,7 @@
198218
url(r'^api/v0.1/search/', search.views.get_search, name='search'),
199219
url(r'^api/v0.1/choose_persona/', dashboard.views.choose_persona, name='choose_persona'),
200220
url(r'^api/v1/onboard_save/', dashboard.views.onboard_save, name='onboard_save'),
221+
url(r'^api/v1/file_upload/', dashboard.views.file_upload, name='file_upload'),
201222

202223
# chat
203224
url(r'^chat/login/', chat.views.chat_login, name='chat_login'),

app/assets/v2/css/bootstrap-vue.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/v2/css/buttons.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,19 @@ button:focus {
100100

101101
.btn-gc-blue,
102102
.btn-gc-green,
103+
.btn-gc-dark-green,
103104
.btn-gc-purple,
104105
.btn-gc-pink {
105106
color: white;
106107
}
107108

108-
.btn-outline-gc-blue,
109-
.btn-outline-gc-purple,
110-
.btn-outline-gc-green,
111-
.btn-outline-white {
112-
/* padding: .75rem 1.5rem; */
109+
110+
.btn-gc-dark-green {
111+
background-color: var(--gc-dark-green);
112+
}
113+
114+
.btn-gc-dark-green:hover {
115+
background-color: var(--gc-green);
113116
}
114117

115118
.btn-gc-blue {

app/assets/v2/css/colors.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ html {
55
--gc-purple: #0D0764;
66
--gc-purple-hover: #0b0d9d;
77
--gc-green: #0FCE7C;
8+
--gc-dark-green: #0ACE7C;
89
--gc-green-hover: #25E899;
910
--gc-light-green: rgb(211, 250, 235);
1011
--gc-pink: #f9006c;

app/assets/v2/css/gitcoin.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ h4,
117117
color: #3E00FF;
118118
}
119119

120+
.gc-text-darkblue {
121+
color: var(--gc-purple);
122+
}
123+
120124
.gc-text-green {
121125
color: #0FCE7C;
122126
}

app/assets/v2/css/grants/cart.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@
100100
outline: none;
101101
}
102102

103-
.vue-tel-input input {
104-
height: 50px;
105-
}
106-
107103
.vti__dropdown-list.below {
108104
top: 50px !important;
109105
}

app/assets/v2/css/grants/collection.css

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@
4040
grid-template-columns: repeat(2, 1fr);
4141
}
4242

43+
.collection-item__img--small-grid {
44+
display: grid;
45+
grid-template-columns: repeat(3, 1fr);
46+
}
47+
4348
.collection-item__img {
44-
height: 11rem;
4549
background-color: #0D023B;
4650
overflow: hidden;
4751
padding: 10px 18px;
@@ -55,9 +59,18 @@
5559
margin: 2px;
5660
}
5761

62+
.collection-item__img__cover--small {
63+
background: linear-gradient(0deg, #FFFFFF, #FFFFFF), linear-gradient(0deg, #FFFFFF, #FFFFFF), linear-gradient(0deg, #FFFFFF, #FFFFFF), linear-gradient(0deg, #FFFFFF, #FFFFFF), #FFFFFF;
64+
border-radius: 2px;
65+
height: 55px;
66+
width: 84%;
67+
place-self: center;
68+
margin: 2px;
69+
}
70+
5871
.collection-item__img img {
5972
width: 100%;
60-
object-fit: contain;
73+
object-fit: cover;
6174
height: 100%;
6275
}
6376

@@ -89,7 +102,12 @@
89102
width: 20px;
90103
}
91104

92-
.collection-item__owner-image img, .collection-item__owner-image--cover img {
105+
.collection-item__owner-image--large {
106+
height: 45px;
107+
width: 45px;
108+
}
109+
110+
.collection-item__owner-image img, .collection-item__owner-image--cover img, .collection-item__owner-image--large img {
93111
width: 100%;
94112
border-radius: 50%;
95113
}

app/assets/v2/css/grants/fund.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@
121121
}
122122

123123
#gitcoin-grant-section .badge-inactive {
124-
background: #E8F3FF;
125-
color: #4A90E2;
124+
background: #ffffff;
125+
border-color: #D8D8D8;
126+
color: #666666;
126127
}
127128

128129
.inactive {

app/assets/v2/css/grants/grant.css

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
background-color: #ffde55;
236236
}
237237

238-
.clr .label {
238+
.clr .label, .clr-label {
239239
background: #0FCE7C;
240240
color: #fff;
241241
border-radius: 3px;
@@ -283,10 +283,6 @@
283283
font-weight: 500;
284284
}
285285

286-
.rounded-circle {
287-
margin-right: 8px;
288-
}
289-
290286
#search_form button {
291287
border: none;
292288
background: transparent;
@@ -529,7 +525,6 @@
529525

530526
.arrow_box {
531527
position: relative;
532-
background: #fff;
533528
border: 1px solid #0FCE7C;
534529
border-radius: 3px;
535530
}

app/assets/v2/images/project_logos/idena.svg

Lines changed: 1 addition & 0 deletions
Loading
1.83 KB
Loading
544 KB
Loading

app/assets/v2/js/avatar_builder.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable no-prototype-builtins */
2+
13
let openSection;
24
const layers = [
35
'Wallpaper',

app/assets/v2/js/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const _alert = function(msg, _class, remove_after_ms) {
289289
'message': msg
290290
};
291291
}
292-
var numAlertsAlready = $('.alert:visible').length;
292+
var numAlertsAlready = $('body > .alert:visible').length;
293293
var top = numAlertsAlready * 44;
294294
var id = 'msg_' + parseInt(Math.random() * 10 ** 10);
295295

app/assets/v2/js/cart-data.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class CartData {
99
}
1010

1111
static cartContainsGrantWithId(grantId) {
12+
grantId = String(grantId);
1213
const cart = this.loadCart();
1314
const idList = cart.map(grant => {
1415
return grant.grant_id;
@@ -123,6 +124,8 @@ class CartData {
123124
}
124125

125126
static removeIdFromCart(grantId) {
127+
grantId = String(grantId);
128+
126129
let cartList = this.loadCart();
127130

128131
const newList = cartList.filter(grant => grant.grant_id !== grantId);

0 commit comments

Comments
 (0)