Badsender-com / LePatron.email

LePatron is an opensource email builder allowing to industrialize your email template production. Build tailor made email templates and make them available to your non-technical users.
https://www.lepatron.email
GNU General Public License v3.0
73 stars 12 forks source link

Add paginations for mailings and optimise requests #786

Closed omar-bear closed 5 months ago

omar-bear commented 5 months ago

Feature: Server-Side Pagination for Mailings

Description:

The goal of this feature is to implement server-side pagination for mailings to improve performance and reduce the load on the client side. The current system retrieves all mailings at once, which is inefficient for large datasets.

Implementation Details:

Backend:
  1. Modify Mailings Fetch Endpoint:

    • File: mailings-controller.js
    • Task:
      • Update the readMailings function to accept page and limit parameters from the query string.
      • Use these parameters to fetch mailings with pagination from the database using .skip() and .limit() methods.
  2. Return Pagination Info:

    • File: mailings-controller.js
    • Task:
      • Along with mailings data, return additional pagination details such as currentPage, totalPages, and totalMailings.
Frontend:
  1. Update API Call in Vue Component:

    • File: BsGroupMailingsTab.vue
    • Task:
      • Modify the API call to include parameters for pagination.
      • Handle the pagination state within the component's data.
  2. Pagination Controls in UI:

    • Component: BsMailingsAdminTable.vue
    • Task:
      • Integrate Vuetify's <v-pagination> component to display pagination controls based on the returned pagination data.
      • Update the table view when a new page is selected.
  3. State Management:

    • File: BsGroupMailingsTab.vue
    • Task:
      • Manage the current page and items per page state in the Vue component.
      • Reactively update the mailings data when pagination controls are used.

Acceptance Criteria:

Time Estimate:

https://github.com/Badsender-com/LePatron.email/assets/80390318/918f5b41-521d-446e-b991-0b4c7f6bd237

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud