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 list view for grants and migrate to vue #7336

Merged
merged 9 commits into from
Sep 9, 2020

Conversation

zoek1
Copy link
Contributor

@zoek1 zoek1 commented Sep 7, 2020

Description
  • star/unstar a grant using vue
  • list view of all the grants,
  • Fix grant nav sort issue
  • Hide idle grants by default
  • Show my contributions on each grant card
  • Display my grants in the grants view

https://www.loom.com/share/8eec68f5f2d243c58968f9bd2db25a96

Refers/Fixes

#7163
#7166
#7190
#7268
#7167
#7165

Superseded #7332

Testing

@thelostone-mc thelostone-mc changed the base branch from master to round-7-integration September 8, 2020 05:23
[[ grant.monthly_amount_subscribed ]] DAI
</span>
<span class="amount mb-2 font-smaller-3">MONTHLY RECURRING</span>
</template>
Copy link
Member

Choose a reason for hiding this comment

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

^ This section is outdated !
It has to be similar to L156-168

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, i'll do the changes today 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


count = Grant.objects.filter(
network=network, hidden=False, active=True, grant_type=_grant_type
).count()
Copy link
Member

@thelostone-mc thelostone-mc Sep 8, 2020

Choose a reason for hiding this comment

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

^ could we make this call only once. I know this ported over code but
We could do

active_grants= Grant.objects.filter(
    network=network, hidden=False, active=True
)

for _grant_type in GrantType.objects.all():
     count = active_grants.filter(grant_type=_grant_type).count()
     ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@codecov
Copy link

codecov bot commented Sep 9, 2020

Codecov Report

Merging #7336 into round-7-integration will decrease coverage by 0.14%.
The diff coverage is 18.93%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           round-7-integration    #7336      +/-   ##
=======================================================
- Coverage                26.50%   26.36%   -0.15%     
=======================================================
  Files                      301      306       +5     
  Lines                    29917    30285     +368     
  Branches                  4416     4469      +53     
=======================================================
+ Hits                      7929     7984      +55     
- Misses                   21711    22031     +320     
+ Partials                   277      270       -7     
Impacted Files Coverage Δ
app/app/urls.py 85.96% <ø> (ø)
...d/management/commands/sync_pending_fulfillments.py 0.00% <0.00%> (ø)
app/grants/0069_grant_github_project_url.py 0.00% <0.00%> (ø)
app/grants/admin.py 47.05% <ø> (ø)
app/grants/clr.py 0.00% <0.00%> (ø)
app/grants/forms.py 0.00% <ø> (ø)
app/grants/management/commands/analytics_clr.py 0.00% <0.00%> (ø)
...ants/management/commands/update_brightid_status.py 0.00% <0.00%> (ø)
app/grants/urls.py 100.00% <ø> (ø)
app/kudos/tasks.py 29.33% <0.00%> (+0.38%) ⬆️
... and 29 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 c50e4a0...4da204c. Read the comment docs.

@@ -1331,7 +1335,7 @@ def presave_contrib(sender, instance, **kwargs):

def next_month():
"""Get the next month time."""
return localtime(timezone.now() + timedelta(days=30))
return (timezone.now() + timedelta(days=30))
Copy link
Member

Choose a reason for hiding this comment

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

Why are we doing 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.

In my env this line throws one exception due to localtime. I'll rollback this.

</div>
<div class="col-md-3 col-sm-12 py-4 pr-md-5 pl-md-0 grant-action">
<form class="js-addDetailToCart-form" v-if="!grant.is_on_team">
{% include 'grants/components/hidden_inputs.html' %}
Copy link
Member

Choose a reason for hiding this comment

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

won't this be included multiple times @zoek1 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but removing this will require redoing the cart logic. I decided left to change in the future.

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.

a few more comments

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, left just a few comments

@@ -144,3 +353,29 @@ $('#minimize').on('click', () => {
});
});

$(document).on('click', '.star-action', async(e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

could we change this to vuejs?


<div class="col-12 pb-4">
<form class="js-addDetailToCart-form" v-if="!grant.is_on_team">
{% include 'grants/components/hidden_inputs.html' %}
Copy link
Contributor

Choose a reason for hiding this comment

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

lots of ids will be repeated on this loop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, i'm concerned about this although this is how originally was implemented. I can remove the ids to fix this, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes if that work at least until this get refactored to be with the vue scope

Comment on lines 1 to 15
<input type="hidden" id="grant_id" name="grant_id" :value="grant.id">
<input type="hidden" id="grant_slug" name="grant_slug" :value="grant.slug">
<input type="hidden" id="grant_url" name="grant_url" :value="grant.url">
<input type="hidden" id="grant_title" name="grant_title" :value="grant.title">
<input type="hidden" id="grant_contract_version" name="grant_contract_version" :value="grant.contract_version">
<input type="hidden" id="grant_contract_address" name="grant_contract_address" :value="grant.contract_address">
<input type="hidden" id="grant_token_symbol" name="grant_token_symbol" :value="grant.token_symbol">
<input type="hidden" id="grant_admin_address" name="grant_admin_address" :value="grant.admin_address">
<input type="hidden" id="grant_token_address" name="grant_token_address" :value="grant.token_address">
<input type="hidden" id="grant_logo" name="grant_logo" :value="grant.logo_url">
<input type="hidden" id="grant_clr_prediction_curve" name="grant_clr_prediction_curve" :value="grant.clr_prediction_curve">
<input type="hidden" id="grant_image_css" name="grant_image_css" :value="grant.image_css">
<input type="hidden" id="is_clr_eligible" name="is_clr_eligible" :value="grant.is_clr_eligible ? grant.is_clr_eligible : ''">
<input type="hidden" id="grant_donation_amount" name="grant_donation_amount" :value="amount" v-if="grant.amount">

Copy link
Contributor

Choose a reason for hiding this comment

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

so the point of vue is the data is reactive, so this all data is already on [[grant]] why not doing this logic with the data you already have?
Is this a REST POST or just a django from post?

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 i'll remove this when i'll implement this issue. #7164 because i need to refactor how items are added to the cart.

@zoek1 zoek1 requested a review from octavioamu September 9, 2020 15:43
@@ -353,7 +368,7 @@ $('#minimize').on('click', () => {
});
});

$(document).on('click', '.star-action', async(e) => {
$(document).on('click', '.following-action', async(e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

now that was moved into vue this still needed for others areas?

Copy link
Contributor

Choose a reason for hiding this comment

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

ohh I saw it is on funding.html right?

@octavioamu
Copy link
Contributor

cool @zoek1 , lets go ahead and remove those ids to avoid repeating them and I will merge it

@octavioamu octavioamu merged commit c785b1a into gitcoinco:round-7-integration Sep 9, 2020
@owocki
Copy link
Contributor

owocki commented Sep 9, 2020

im getting "AnonymousUser' object has no attribute 'profile" when i try to access /grants on this branch

i think its on this line

    contributions = Contribution.objects.filter(
        id__in=request.user.profile.grant_contributor.filter(subscription_contribution__success=True).values(
            'subscription_contribution__id')).prefetch_related('subscription')

@owocki
Copy link
Contributor

owocki commented Sep 9, 2020

@zoek1 i just checked it out and at 100k feet it looks good. a few detail oriented comments / feedback:

  1. can you pls round the amount raised + final CLR matcch fields pls
    https://bits.owocki.com/9ZuX6b6l
  2. can u pls reverse the coloring of these filters?
    https://bits.owocki.com/E0unNxNL
  3. the 'all time funding' field doesnt seem to work https://bits.owocki.com/E0unNxBL
  4. responsive design is messed up on the list view https://bits.owocki.com/7KuLwDrr
  5. I can't scroll past the first 6 grants. we need to re-enable the infinite scroll we used to have on that page
  6. lets remove the 'browse grants' button; it is not needed
  7. none of the grants show the match estimates for the current round.
  8. activity view no longer works https://bits.owocki.com/8LuPWXXo
  9. can you remove the 'admin choose network' dropdown? it doesnt seem to work https://bits.owocki.com/mXuyNwwk

@octavioamu
Copy link
Contributor

octavioamu commented Sep 10, 2020

about the 'admin choose network' we need it to test rinkeby networks when doing regressions, is hidden for the end user so should be fine.

@owocki
Copy link
Contributor

owocki commented Sep 10, 2020

i just fixed the rounding issue + the anonymous user issue on round-7-integration

thelostone-mc added a commit that referenced this pull request Sep 14, 2020
* Add zkSync Checkout (#7314)

* Integrate minimal working ETH-only zkSync checkout

* Refactor L1 checkout a bit to enable more code re-use with zkSync

* Adds full working checkout flow using localstorage, supports ERC20 + ETH

* Improve checkout UX by adding modal whehn using zkSync

* Warn user before closing or reloading if they started zkSync checkout

* Switch to deterministic from ephemeral wallet, fix allowance bug

Allowance bug info: If user already had sufficient allowance, tokens were not transferred

* Pull out logic into functions to facilitate re-sending on interrupted deposits

* zkSync checkout now POSTs to database and shows success message on completion

* Handle zkSync checkout interruptions

* Fix ESLint errors, add some try/catch blocks

* Fix bug in tx validator that prevented testing on rinkeby

Also some prep and cleanup for tx validator update

* Update tx validator to handle zkSync transfers

* Tweak: Show metamask popup on zkSync checkout prompts

* Only allow zkSync modal to be closed with a button to prevent accidental closures when checking out

* zkSync checkout can now be resumed if interrupted

Adds endpoint to look for dropped and replaced transactions to help with this

* Various UI/UX updates based on Figma mockups

- Update tx processing section of zkSync checkout modal
- Update grant detauls page to show Etherscan and zkScan links
- Add note about supported L2 account types on new grant page

* Update address of batch deposit contract

* Reduce gas by only using batch deposit contract when necessary, regular zkSync contract otherwise

* Now throws error if user tries to use zkSync checkout with unsupported token

* add list view for grants and migrate to vue (#7336)

* add list view for grants and migrate to vue

* hide idle grants by default

* Add contributions on grants

* add my grants

* Minor fix

* Implement follow in vuejs

* remove duplicated ids

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>

* fixes #7223

* zkSync updates part 2 (#7348)

* Checks and validates cart amounts to ensure they are packable

* Add support for additional deposits. After donations are complete, all leftover balances are sent to user's web3 address

* Update appearance of zkSync modal to match new designs

* Add additional checkout flow to support users who already have a zkSync balance

* Update detail.js

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>

* updated dates, just in case we got it wrong with db migration

* round up fixes

* fix for the anonymous user issue

* fix up clr info on cards

* show contribution button only if user has logged in

* update icon

* hide browse grants button

* rounding issue

* reload page on switch type/category

* fix grants without round

* fix favorite

* fix component initialization

* eslint fix

* fix grant activity

* sloppy fix

* a few fixes

* add pagination

* readd stuff

* switch btwn rinkeby+mainnet &show sybil info

* Fix my grants and add team members (#7354)

* Grants Round 7 Trust Bonus Improvements (#7353)

* Show SMS on trust bonus page w/ conditional verify button or status

* Add placeholder for twitter verification & handle SMS verification via cart link

* Conditionally show Trust Bonus banner in cart

* Include link in cart trust bonus button + bonus screen touchups

* Increase the size of the BrightID QR Code

* Fix linting indentation error

* fix for loading sidecart

* debounce search

* remove already loaded scripts

* move filter "my grants"

* zkSync updates part 3 (#7356)

* Update tx validator to support zkSync transfers when user already has funds on L2

* Add loading screen to zkSync modal

* Improve gas estimates, recommend checkout approach to user, limit zkSync to 100 contributions

* Change zkSync fees to be additive, show which tokens in cart don't support zkSync

* Fix so all zksync gas limit estimtes are strings

* Bug fixes to cart and tx validator

* Update cart copy and add zkSync details to GRANTS.md

* Update GRANTS.md

* adds grant funding info; per lefteris feedback

* adds grant funding info; per lefteris feedback

* fix for sms verification

* ads trust tab coming soon stuff

* stopgap for #7131 (comment)

* new grants header

* zkSync bug fixes (#7368)

* Fix zkScan URLs

* Ensure default network is mainnet

* Impove how tokens are fetched, close zksync modal on 'insufficient balance' errors

* Bug fix: prevents users from checking out when donation amounts + fees exceed their L1 wallet balance

* matic banner

* round 7 integration; adds brightid events to calenndar

* udpates img

* styles for banners and grid fixes

* Additional cart improvements (#7374)

* Add gas estimation for approval txs

* Fixes for Argent and BN, CSS tweak for mobile

* helper script to re-add team members that were removed by #7319

* updates grant scripts

* adds learn more link

* adds brightID info to sybilscore

* iexact

Co-authored-by: Matt <matt@mattsolomon.dev>
Co-authored-by: Miguel Angel Gordián <miguel@gordian.dev>
Co-authored-by: owocki <ksowocki@gmail.com>
Co-authored-by: octavioamu <octavioamuchastegui@gmail.com>
Co-authored-by: Ben DiFrancesco <ben@scopelift.co>
zoek1 added a commit to zoek1/web-1 that referenced this pull request Sep 14, 2020
* add list view for grants and migrate to vue

* hide idle grants by default

* Add contributions on grants

* add my grants

* Minor fix

* Implement follow in vuejs

* remove duplicated ids

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>
zoek1 added a commit to zoek1/web-1 that referenced this pull request Sep 14, 2020
* add list view for grants and migrate to vue

* hide idle grants by default

* Add contributions on grants

* add my grants

* Minor fix

* Implement follow in vuejs

* remove duplicated ids

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>
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.

4 participants