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

WIP grants/index: search functionality #2522

Merged
merged 3 commits into from
Nov 9, 2018

Conversation

thelostone-mc
Copy link
Member

Description

WIP

Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)

@thelostone-mc thelostone-mc added frontend This needs frontend expertise. grants labels Oct 23, 2018

_grants = Grant.objects.all().order_by(sort)
if keyword:
_grants = Grant.objects.filter(title__icontains = keyword).order_by(sort)

Choose a reason for hiding this comment

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

E251 unexpected spaces around keyword / parameter equals

@codecov
Copy link

codecov bot commented Oct 23, 2018

Codecov Report

❗ No coverage uploaded for pull request base (grants-search@1c79929). Click here to learn what that means.
The diff coverage is 12.5%.

Impacted file tree graph

@@               Coverage Diff                @@
##             grants-search    #2522   +/-   ##
================================================
  Coverage                 ?   29.63%           
================================================
  Files                    ?      154           
  Lines                    ?    12148           
  Branches                 ?     1621           
================================================
  Hits                     ?     3600           
  Misses                   ?     8430           
  Partials                 ?      118
Impacted Files Coverage Δ
app/app/urls.py 86.66% <100%> (ø)
app/grants/urls.py 100% <100%> (ø)
app/grants/views.py 18.95% <6.66%> (ø)

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 1c79929...8b49109. Read the comment docs.

@@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.

"""
from django.conf.urls import include, url

Choose a reason for hiding this comment

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

F401 'django.conf.urls.include' imported but unused
F401 'django.conf.urls.url' imported but unused

@@ -30,12 +30,14 @@
from django.template.response import TemplateResponse
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.http import HttpResponse, JsonResponse

Choose a reason for hiding this comment

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

F401 'django.http.JsonResponse' imported but unused

grants_by_title = Grant.objects.filter(title__icontains=keyword)
grants_by_desc = Grant.objects.filter(description__icontains=keyword)
grants_by_url = Grant.objects.filter(reference_url__icontains=keyword)
grants_pks = (grants_by_desc | grants_by_title | grants_by_url).values_list('pk', flat=True)

Choose a reason for hiding this comment

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

F841 local variable 'grants_pks' is assigned to but never used

@captnseagraves
Copy link
Contributor

@thelostone-mc Is there anything I can do to help keep this moving?

@thelostone-mc
Copy link
Member Author

@captnseagraves I'm a lil confused on how to proceed with this!
If you pull this in you'll notice that the search works but the page refreshes each time the user click on search as opposed to using the the api

I belive @mbeacom had some concerns using the API route , so I'm not too sure on what the right thing to do here is.
Would you have the bandwidth to get that checked out ? 😓

@captnseagraves
Copy link
Contributor

@thelostone-mc Sure thing! I'll take a look!

@captnseagraves captnseagraves changed the base branch from grants to grants-search November 9, 2018 16:55
url(r'^api/v0.1/kudos_search/', dashboard.views.get_kudos, name='kudos_search'),

Choose a reason for hiding this comment

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

W293 blank line contains whitespace

@captnseagraves captnseagraves merged commit b0d7b65 into gitcoinco:grants-search Nov 9, 2018
@mbeacom
Copy link
Contributor

mbeacom commented Nov 9, 2018

@captnseagraves This was a WIP? 🤔

@thelostone-mc thelostone-mc deleted the grants-search branch November 20, 2018 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend This needs frontend expertise.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants