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 pagination to project list #4990

Closed
wants to merge 8 commits into from

Conversation

manthanank
Copy link

@manthanank manthanank commented Dec 23, 2024

This pull request introduces pagination functionality to the projects panel on the website. It includes changes to both the HTML and JavaScript files to implement and handle pagination logic.

Pagination functionality:

  • index.html: Added pagination controls with "Previous" and "Next" buttons and a page information display.
  • javascripts/app.js: Removed @ts-nocheck directive and added a function to handle pagination logic.

JavaScript enhancements:

  • javascripts/app.js: Updated the renderProjects function to render the correct page of projects and added event listeners for pagination controls.
  • javascripts/app.js: Added functions to validate pagination logic and ensure buttons functionality.This pull request introduces pagination functionality to the projects panel in the web application. The key changes include adding pagination controls to the HTML, updating the JavaScript to handle pagination logic, and modifying the renderProjects function to support paginated data.

HTML changes:

  • Added pagination controls (Previous and Next buttons) to the projects panel in index.html.

JavaScript changes:

  • Removed @ts-nocheck directive from javascripts/app.js.
  • Added a paginateProjects function to handle slicing the projects array based on the current page and limit.
  • Updated the renderProjects function to render the correct page of projects and added logic to update pagination controls.
  • Added event listeners for the pagination controls to handle page navigation.Related to Project List missing pagination #4918

Add pagination to the project list to improve navigation and reduce scroll time.

  • Add pagination controls (Next, Previous) to index.html below the project list.
  • Add a container for pagination controls in index.html.
  • Add a function to handle pagination logic in javascripts/app.js.
  • Update the renderProjects function in javascripts/app.js to render the correct page of projects.
  • Add event listeners for pagination controls in javascripts/app.js.

For more details, open the Copilot Workspace session.

Related to #4918

Add pagination to the project list to improve navigation and reduce scroll time.

* Add pagination controls (Next, Previous) to `index.html` below the project list.
* Add a container for pagination controls in `index.html`.
* Add a function to handle pagination logic in `javascripts/app.js`.
* Update the `renderProjects` function in `javascripts/app.js` to render the correct page of projects.
* Add event listeners for pagination controls in `javascripts/app.js`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/up-for-grabs/up-for-grabs.net/issues/4918?shareId=XXXX-XXXX-XXXX-XXXX).
@shiftbot
Copy link
Contributor

👋 I'm a robot checking the state of this pull request to save the human reviewers time. I don't see any changes under _data/projects/ so I don't have any feedback here.

As you make changes to this pull request, I'll re-run these checks.

@shiftkey
Copy link
Member

Does this work as expected? I'm using this link to test pagination of javascript projects but it only renders as one page - and the buttons at the end of the form are disabled:

Screenshot 2024-12-30 at 3 15 21 PM

@shiftkey shiftkey added needs-work Reviewer has indicated changes need to be make to this pull request before it can be merged has-questions Reviewer has outstanding questions about the pull request and removed needs-review labels Dec 30, 2024
* **index.html**
  - Add pagination controls (Next, Previous) below the project list
  - Add a container for pagination controls

* **javascripts/app.js**
  - Add a function to handle pagination logic
  - Update the renderProjects function to render the correct page of projects
  - Add event listeners for pagination controls
* **index.html**
  - Add pagination controls (Next, Previous) below the project list
  - Add a container for pagination controls

* **javascripts/app.js**
  - Add a function to handle pagination logic
  - Update the `renderProjects` function to render the correct page of projects
  - Add event listeners for pagination controls
* **index.html**
  - Add pagination controls (Next, Previous) below the project list
  - Add a container for pagination controls

* **javascripts/app.js**
  - Add a function to handle pagination logic
  - Update the `renderProjects` function to render the correct page of projects
  - Add event listeners for pagination controls
  - Fix the issue where next and previous buttons are disabled
* Remove the function to handle pagination logic
* Update the `renderProjects` function to remove pagination logic
* Remove event listeners for pagination controls
* **index.html**
  - Add pagination controls (Next, Previous) below the project list
  - Add a container for pagination controls

* **javascripts/app.js**
  - Add a function to handle pagination logic
  - Update the `renderProjects` function to include pagination logic
  - Add event listeners for pagination controls
* **index.html**
  - Add pagination controls (Next, Previous) below the project list
  - Add a container for pagination controls
* **javascripts/app.js**
  - Add a function to handle pagination logic
  - Update the `renderProjects` function to render the correct page of projects
  - Add event listeners for pagination controls
* **index.html**
  - Add pagination controls (Next, Previous) below the project list
  - Add a container for pagination controls

* **javascripts/app.js**
  - Add a function to handle pagination logic
  - Update the `renderProjects` function to render the correct page of projects
  - Add event listeners for pagination controls
  - Fix the issue of showing more than 15 cards per page
  - Add a function to validate pagination logic
  - Add a function to ensure buttons functionality works properly
  - Add logic to disable/undisable buttons based on data
@manthanank manthanank closed this Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-questions Reviewer has outstanding questions about the pull request needs-work Reviewer has indicated changes need to be make to this pull request before it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants