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

Fix responsiveness issue for casa and volunteer data tables #5308

Merged
merged 7 commits into from
Nov 19, 2023

Conversation

SajjadAhmad14
Copy link
Collaborator

What github issue is this PR for, if any?

Resolves #5261

What changed, and why?

The pagination for volunteers and casa cases tables is now responsive.

How will this affect user permissions?

  • Volunteer permissions:
  • Supervisor permissions:
  • Admin permissions:

Screenshots please :)

responsive-table

@schoork
Copy link
Collaborator

schoork commented Oct 27, 2023

@SajjadAhmad14 Could you give me some steps to get to a page to see this in action? The best page I can find only has two pages.

@SajjadAhmad14
Copy link
Collaborator Author

SajjadAhmad14 commented Oct 30, 2023

@SajjadAhmad14 Could you give me some steps to get to a page to see this in action? The best page I can find only has two pages.

@schoork How I approached is by tweaking into the db/seeds files to increase the size of entries for volunteers and casa cases so that I could test the resposiveness for large set of data in the tables. Please send me a message in slack if you want my help to seed the data for volunteers and casa cases. Thanks!

@schoork
Copy link
Collaborator

schoork commented Nov 2, 2023

@SajjadAhmad14 I'm still getting the pagination links set vertically. Are you seeing something different?
Screenshot 2023-11-02 at 5 33 18 AM
Screenshot 2023-11-02 at 5 33 12 AM

@SajjadAhmad14
Copy link
Collaborator Author

SajjadAhmad14 commented Nov 2, 2023 via email

@schoork
Copy link
Collaborator

schoork commented Nov 2, 2023

Yes, please make all buttons horizontal across all screen sizes. Ticket is a little confusing.

@SajjadAhmad14
Copy link
Collaborator Author

SajjadAhmad14 commented Nov 2, 2023

Great! I pushed recent changes and now both previous and next buttons are in one line. Also the page numbers are responsive on all screens as well.

casa-cases_responsive
volunteers-responsive

@schoork
Copy link
Collaborator

schoork commented Nov 2, 2023

Wow! Very quick @SajjadAhmad14 . I'm actually a fan of the previous and next buttons being on the same line as the page number buttons, but I'd like to see if we can @bcastillo32 or @MalloryPriceDesign to weigh in.

@MalloryPriceDesign
Copy link

Wow! Very quick @SajjadAhmad14 . I'm actually a fan of the previous and next buttons being on the same line as the page number buttons, but I'd like to see if we can @bcastillo32 or @MalloryPriceDesign to weigh in.

@SajjadAhmad14 thanks for working on this! If possible, could you align the previous and next buttons on the same line as the page number buttons?

@SajjadAhmad14
Copy link
Collaborator Author

SajjadAhmad14 commented Nov 5, 2023

Wow! Very quick @SajjadAhmad14 . I'm actually a fan of the previous and next buttons being on the same line as the page number buttons, but I'd like to see if we can @bcastillo32 or @MalloryPriceDesign to weigh in.

@SajjadAhmad14 thanks for working on this! If possible, could you align the previous and next buttons on the same line as the page number buttons?

Thanks for the review! These buttons can be on the same line but only for desktop and large screen size. These buttons got hidden on tablet and small sizes if they are on the same line with the page numbers. So for medium and small screen sizes I have to adjust them to be on a separate line for the reason of visibilty and this way the pagination style does not look same for all the screen sizes. I think the better user experience is that if we can make it look same for all the screens sizes and that's only possible with the solution that numbers and buttons align on different lines. But I am open for suggestions! Thanks!


@media only screen and (max-width: 2560px) {

#casa-cases_paginate.dataTables_paginate.paging_simple_numbers {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the reason for using the id of the tables in these? CSS won't get propagated to all data tables.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@schoork How do you propose to target the pagination? I am currently using CSS media queries to target different classes to make the pagination responsive. Can you guide me should I not use the CSS and use some JavaScript instead?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just wouldn't use an id here.

#casa-cases_paginate.dataTables_paginate.paging_simple_numbers {

.dataTables_paginate.paging_simple_numbers {

@schoork
Copy link
Collaborator

schoork commented Nov 6, 2023

@SajjadAhmad14 We need to find a solution where

  1. all the buttons are on the same line, and
  2. the previous and next buttons are shown in some form

Here are some screenshots of [PlainAdmin's pagination|https://demo.plainadmin.com/tables-responsive#0] (we use a lot of PlainAdmin styling in the site). The >> and << buttons might be helpful for fitting in the mobile view if the Previous and Next are too wide.

Happy to jump in/help if you get stuck.

Screenshot 2023-11-06 at 7 33 31 AM
Screenshot 2023-11-06 at 7 33 24 AM
Screenshot 2023-11-06 at 7 33 11 AM

@schoork
Copy link
Collaborator

schoork commented Nov 18, 2023

Screenshots for the new changes.
Screenshot 2023-11-18 at 10 40 42 AM
Screenshot 2023-11-18 at 10 40 33 AM
Screenshot 2023-11-18 at 10 40 23 AM

@schoork
Copy link
Collaborator

schoork commented Nov 18, 2023

FYI. There is currently no way to change the number of numbered page buttons based on the size of the window (mobile does work better with fewer buttons).
https://datatables.net/forums/discussion/73664

@schoork schoork merged commit b33269d into main Nov 19, 2023
13 checks passed
@schoork schoork deleted the responsive-datatable branch November 19, 2023 13:36
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.

Responsive Support For Volunteer and Casa Cases table
3 participants