codefordenver / partner-finder

Using an open dataset with registered colorado business to build a tool that manages outreach to potential CFD partners.
3 stars 14 forks source link

PaginationControl upper page limit is always 100 #134

Closed galbwe closed 3 years ago

galbwe commented 3 years ago

The upper page limit in the pagination control on the home page always displays 100, even if there are not 100 pages.

Screen Shot 2021-09-28 at 11 54 59 PM

Make the home component call the /leads/n_pages api endpoint and then render the PaginationControl component to show the correct number of pages.

TueeNguyen commented 3 years ago

I'd like to work on this issue, please. Thank you!

galbwe commented 3 years ago

Hey @TueNguyen2911 I'll send you an invite to collaborate on the project.

TueeNguyen commented 3 years ago

I've accepted, thank you!

TueeNguyen commented 3 years ago

Hi @galbwe, after going through some struggle installing docker. This is what I have after running docker ps

image

Seems like it's missing the front_end container, it's not the same as the README.md. Am I missing something?

galbwe commented 3 years ago

@TueNguyen2911 that happened to me before when I first cloned the repo. Here is the workaround that I used:

I'll create a ticket to address this. Thanks for bringing it up!

TueeNguyen commented 3 years ago

It works! I've got the front_end container now.

I have another question, I was trying to get an access token but encountered this error. I googled for an answer but nothing seemed useful. image

galbwe commented 3 years ago

So when the flask app starts in the development configuration, it logs an access token to the terminal. If the containers are running in the background, you should be able to view the logs with

docker compose logs api

The lines with the token should look similar to this

api_1       | [2021-10-06 03:12:03 +0000] [13] [INFO] To authenticate as user@gmail.com, include this header with the request:
api_1       |   Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InVzZXJAZ21haWwuY29tIiwiZXhwaXJlcyI6IjIwMjEtMTAtMDdUMDM6MTI6MDMuNzExODE4KzAwOjAwIiwiYWRtaW4iOmZhbHNlfQ.Ls2CQ2nfsvXky7vn_PmUwuGKyMpC-ET6JH9n5Mmgtms
TueeNguyen commented 3 years ago

Right, I've got the token. However, I don't see any react app running in my localhost:1234.

Thank you for bearing with me!

galbwe commented 3 years ago

All good.

First, what do you see in a browser when trying to visit localhost:1234?

Second, what is the output of docker compose logs frontend ?

TueeNguyen commented 3 years ago

In localhost:1234 , I see "this site can't be reached", basically nothing

And this is the output of docker compose logs frontend image

galbwe commented 3 years ago

Okay that looks like it might be the same problem that caused the container to shut down. I created https://github.com/codefordenver/partner-finder/issues/148 to address it. I think it should just be a matter of updating the frontend Dockerfile to look in the right directory for parcel-bundler. I'll see if I can get that resolved quickly.

TueeNguyen commented 3 years ago

Edit: It worked! Changing RUN yarn install to RUN yarn Yes I did try, react app is still not showing

galbwe commented 3 years ago

Okay, cool. I'm glad you are in.

I still have no idea why that fixes it though. I Initially thought install was only an npm command, but according to the yarn docs, yarn and yarn install do the same thing.

TueeNguyen commented 3 years ago

Finally I'm in! I'm confused too, if yarn and yarn install do the same thing, why the container didn't start

galbwe commented 3 years ago

Not sure either. I'm leaving #148 open in case someone knows the solution.