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

feat: revamp grant creation flow #9706

Merged
merged 9 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/assets/v2/images/grants/new.svg

This file was deleted.

2 changes: 1 addition & 1 deletion app/assets/v2/js/grants/_detail-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ Vue.component('grant-details', {
}
},
theme: 'snow',
placeholder: 'Give a detailed desciription about your Grant'
placeholder: 'Describe what your project is about. What would you like to build? How will you use the funding?'
},
grantRegions: [
{ 'name': 'north_america', 'label': 'North America'},
Expand Down
47 changes: 37 additions & 10 deletions app/assets/v2/js/grants/_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,21 @@ Vue.mixin({
}
});
},
resetAddress() {
let vm = this;
let form = vm.form;

form.eth_payout_address = '';
form.celo_payout_address = '';
form.zcash_payout_address = '';
form.zil_payout_address = '';
form.harmony_payout_address = '';
form.binance_payout_address = '';
form.polkadot_payout_address = '';
form.kusama_payout_address = '';
form.rsk_payout_address = '';
form.algorand_payout_address = '';
},
onFileChange(e) {
let vm = this;

Expand Down Expand Up @@ -326,6 +341,26 @@ const grant_regions = [
{ 'name': 'southeast_asia', 'label': 'Southeast Asia'}
];

const grant_chains = [
{ 'name': 'eth', 'label': 'Ethereum'},
{ 'name': 'zcash', 'label': 'ZCash'},
{ 'name': 'celo', 'label': 'Celo'},
{ 'name': 'zilliqa', 'label': 'Zilliqa'},
{ 'name': 'harmony', 'label': 'Harmony'},
{ 'name': 'binance', 'label': 'Binance'},
{ 'name': 'polkadot', 'label': 'Polkadot'},
{ 'name': 'kusama', 'label': 'Kusama'},
{ 'name': 'algorand', 'label': 'Algorand'}
];

if (document.contxt.is_staff) {
const staff_chains = [
{ 'name': 'rsk', 'label': 'RSK'}
];

grant_chains.push(...staff_chains);
}

const externalFundingOptions = [
{'key': 'yes', 'value': 'Yes, this project has raised external funding.'},
{'key': 'no', 'value': 'No, this project has not raised external funding.'}
Expand All @@ -341,9 +376,9 @@ if (document.getElementById('gc-new-grant')) {
data() {
return {
chainId: '',
grant_types: document.grant_types,
grant_tags: document.grant_tags,
grant_regions: grant_regions,
grant_chains: grant_chains,
externalFundingOptions: externalFundingOptions,
usersOptions: [],
network: 'mainnet',
Expand Down Expand Up @@ -371,7 +406,7 @@ if (document.getElementById('gc-new-grant')) {
kusama_payout_address: '',
rsk_payout_address: '',
algorand_payout_address: '',
grant_type: '',
grant_type: 'gr12',
grant_tags: [],
network: 'mainnet'
},
Expand Down Expand Up @@ -417,14 +452,6 @@ if (document.getElementById('gc-new-grant')) {
}
return value;
};
},
grant_type_logo() {
const grant_type = this.grant_types.find(g_type => g_type.name === this.form.grant_type);

if (grant_type) {
return grant_type.image_url;
}
return undefined;
}
},
mounted() {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/v2/scss/forms/drop.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.form__drop {
align-items: center;
background-color: #F2F6F9;
border: 1px dashed #9B9B9B;
border-radius: 3px;
cursor: pointer;
Expand All @@ -9,6 +8,7 @@
justify-content: center;
padding: 24px;
position: relative;
min-height: 8rem;
}

.form__drop.is-dragging {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $border-radius: $vs-border-radius;
.vs__actions {
display: flex;
align-items: center;
padding: 4px 6px 0 3px;
padding: 0px 6px 0 3px;
}

/* Dropdown Toggle States */
Expand Down
4 changes: 3 additions & 1 deletion app/avatar/management/commands/fix_broken_avatars.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

'''

from avatar.models import *
from django.core.management.base import BaseCommand

from avatar.models import *


class Command(BaseCommand):

help = 'fixes avatars whose pngs have failed'
Expand Down
2 changes: 0 additions & 2 deletions app/dashboard/sync/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from dashboard.helpers import bounty_activity_event_adapter, get_bounty_data_for_activity
from dashboard.models import Activity, BountyEvent, BountyFulfillment

# from dashboard.utils import populate_hackathon_activity_index

logger = logging.getLogger(__name__)


Expand Down
80 changes: 80 additions & 0 deletions app/grants/fixtures/grant_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[
{
"model": "grants.granttype",
"pk": 1,
"fields": {
"created_on": "2021-10-18T18:21:10.384Z",
"modified_on": "2021-10-18T18:21:10.384Z",
"name": "tech",
"label": "Tech",
"is_active": true,
"is_visible": true,
"logo": ""
}
},
{
"model": "grants.granttype",
"pk": 2,
"fields": {
"created_on": "2021-10-18T18:21:10.391Z",
"modified_on": "2021-10-18T18:21:10.391Z",
"name": "media",
"label": "Community",
"is_active": true,
"is_visible": true,
"logo": ""
}
},
{
"model": "grants.granttype",
"pk": 3,
"fields": {
"created_on": "2021-10-18T18:21:10.392Z",
"modified_on": "2021-10-18T18:21:10.392Z",
"name": "matic",
"label": "Matic: Build-n-Earn",
"is_active": true,
"is_visible": true,
"logo": ""
}
},
{
"model": "grants.granttype",
"pk": 4,
"fields": {
"created_on": "2021-10-18T18:21:10.393Z",
"modified_on": "2021-10-18T18:21:10.393Z",
"name": "health",
"label": "Health",
"is_active": true,
"is_visible": true,
"logo": ""
}
},
{
"model": "grants.granttype",
"pk": 5,
"fields": {
"created_on": "2021-10-18T18:21:10.394Z",
"modified_on": "2021-10-18T18:21:10.394Z",
"name": "change",
"label": "Crypto for Black Lives",
"is_active": true,
"is_visible": true,
"logo": ""
}
},
{
"model": "grants.granttype",
"pk": 6,
"fields": {
"created_on": "2021-10-18T18:21:10.394Z",
"modified_on": "2021-10-18T18:21:10.394Z",
"name": "gr12",
"label": "Grants Round 12",
"is_active": true,
"is_visible": true,
"logo": ""
}
}
]
3 changes: 2 additions & 1 deletion app/grants/management/commands/estimate_clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@

"""

import argparse

from django.core.management.base import BaseCommand
from django.utils import timezone

from grants.clr import predict_clr
from grants.models import GrantCLR
from grants.tasks import process_predict_clr

import argparse

class Command(BaseCommand):

Expand Down
Loading