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.
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:
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.
Return Pagination Info:
File: mailings-controller.js
Task:
Along with mailings data, return additional pagination details such as currentPage, totalPages, and totalMailings.
Frontend:
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.
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.
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:
The backend must correctly parse pagination parameters and limit the number of mailings returned based on these parameters.
The frontend must update to reflect only the mailings for the selected page, with correct pagination controls that match the total number of mailings available.
Users should be able to navigate between pages with minimal delay.
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:
Modify Mailings Fetch Endpoint:
mailings-controller.js
readMailings
function to acceptpage
andlimit
parameters from the query string..skip()
and.limit()
methods.Return Pagination Info:
mailings-controller.js
currentPage
,totalPages
, andtotalMailings
.Frontend:
Update API Call in Vue Component:
BsGroupMailingsTab.vue
Pagination Controls in UI:
BsMailingsAdminTable.vue
<v-pagination>
component to display pagination controls based on the returned pagination data.State Management:
BsGroupMailingsTab.vue
Acceptance Criteria:
Time Estimate:
https://github.com/Badsender-com/LePatron.email/assets/80390318/918f5b41-521d-446e-b991-0b4c7f6bd237