-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Feature: Add pagination and search to templates page #2850
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
base: master
Are you sure you want to change the base?
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: knadh#2847
Implements pagination, search, and sorting functionality for the templates list page, addressing issue knadh#2847. Changes: - Add query-templates SQL query with pagination, search and sorting - Add QueryTemplates function to core/templates.go - Update GetTemplates API handler to support pagination parameters - Add Templates type and Total field to template model - Update frontend Templates.vue with pagination and search UI - Update API call to support pagination parameters - Add i18n translation for search placeholder The implementation follows the existing patterns used in campaigns and lists pages for consistency. Fixes knadh#2847 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit bc7962c.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
| return c.JSON(http.StatusOK, okResp{models.PageResults{Results: []models.Template{}}}) | ||
| } | ||
|
|
||
| out := models.PageResults{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks backwards-compatibility by changing the current API response structure.
Summary
This PR adds pagination and search functionality to the templates list page, addressing issue #2847.
Features implemented:
Changes
Backend
queries/templates.sql: Added new
query-templatesSQL query with:COUNT(*) OVER()for total countOFFSETandLIMITfor paginationILIKEsearch on name fieldORDER BYsubstitutionmodels/templates.go: Added
Templatesslice type andTotalfield to Template struct for pagination supportmodels/queries.go: Added
QueryTemplatesquery reference as string typeinternal/core/core.go: Added
templateQuerySortFieldsfor allowed sort columnsinternal/core/templates.go: Added
QueryTemplates()function for paginated template retrievalcmd/templates.go: Updated
GetTemplateshandler to support pagination parameters (page,query,order_by,order)Frontend
frontend/src/api/index.js: Updated
getTemplatesto accept paramsfrontend/src/views/Templates.vue:
b-tablepagination propstemplates.totali18n/en.json: Added
templates.queryPlaceholdertranslationTesting
Screenshots
The UI follows the same pattern as the existing Campaigns and Lists pages for consistency.
Fixes #2847
🤖 Generated with Claude Code