unitedstates / BillMap

Utilities and applications for the FlatGov project by Demand Progress
Other
14 stars 2 forks source link

Understand the Context - "Press Statements" tab pagination and scroll #485

Open cybkong opened 3 years ago

cybkong commented 3 years ago

Understand the Context section- pagination and scroll for "Press Statements" tab needs to be corrected Story 79 https://billmap.govtrack.us/bills/117hr1

Screen Shot 2021-07-07 at 3 37 02 PM

aih commented 3 years ago

@cybkong, thank you for this issue. For future issues, please make sure to provide enough context to reproduce the issue. This usually includes:

  1. A sample url
  2. A screenshot including the url, if possible
  3. A copy of the full Story description, if there is one. That helps document the issue as we're working on it. If the story changes, copy those changes to a comment in the issue.

For items 1,2 above, for example: https://billmap.govtrack.us/bills/117hr1 image

leedavidr commented 3 years ago

Ok I think 116hr1 has 46 pages for press statements

I think pagination is being done manually in the HTML, and datatables supports pagination in the other tables @ayeshamk was there a reason we're using manual pagination here or can I switch it out?

@aih @ayeshamk Also, locally, I can't seem to access 116hr1, etc. Do I have to run the bill jobs again to make sure? I ran it recently but maybe it failed for those? I have some odd behaviors on local that I need to look at soon.

Screen Shot 2021-07-07 at 3 29 54 PM Screen Shot 2021-07-07 at 3 32 16 PM
leedavidr commented 3 years ago

I think we just have to remove the commented out code above and add the initialization of data tables on bills.js

But locally I'm not able to test on 117hr1 or 116hr1, I'll try re running bills jobs to fix local environment, but if anyone has other data/bills I could use, let me know! Or maybe Ayesha or Ari can test the fix and check in

Screen Shot 2021-07-07 at 3 36 01 PM
aih commented 3 years ago

I'll test it out. I have uploaded a recent django fixture of the whole db that will have data for all of the bills. I'm not sure if it's worth downloading and restoring that dump. @leedavidr, I'll send you a message on Slack with details.

aih commented 3 years ago

I tried the suggested solution in a branch, but it doesn't work. This is probably due to the timing of the collection of data for the press statements from the API: the data is not available in time to create the Datatable with pagination.

IMO the way the Press Statements is currently being collected is a temporary solution. We will want to get the data from the API on the back-end and query our own back-end for that. Then render and apply the Datatable once the data is available. All of that is time-consuming, so I suggest we put this issue on the backlog for future.

image

leedavidr commented 3 years ago

Ok thank you Ari, we'll move this down

I think there may be a way to initialize the data when we need but sounds like the current way it works is not the ideal scenario anyway

@nkinaba @cybkong