[Feature] Added pagination and filtration to news admin panel - #32
Conversation
|
Warning Review limit reached
Next review available in: 42 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe admin news list now supports search, status filters, date ranges, and simplified pagination. The news service serializes active filters, while English and Ukrainian translations provide labels for the new controls. ChangesAdmin news filtering
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant NewsAdminList
participant AdminSearchInput
participant NewsFilters
participant newsService
participant SimplePagination
AdminSearchInput->>NewsAdminList: Update search and reset page
NewsFilters->>NewsAdminList: Apply statuses and date range
NewsAdminList->>newsService: Request filtered news page
newsService-->>NewsAdminList: Return admin news response
NewsAdminList->>SimplePagination: Provide page and total pages
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/shared/services/newsService.ts (1)
2-2: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCombine the
@shared/models/newsimports.SonarCloud reports that this module is already imported in this file. Merge
NewsStatusinto the existing import.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/shared/services/newsService.ts` at line 2, Combine the duplicate `@shared/models/news` imports in newsService.ts by adding NewsStatus to the existing import declaration, leaving only one import from that module.Source: Linters/SAST tools
src/pages/admin/News/NewsFilters.tsx (1)
1-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winApply the repository import order.
The static check reports import-order violations in both files.
src/pages/admin/News/NewsFilters.tsx#L1-L6: reorder the aliased and package imports to satisfy the configured import-order rule.src/pages/admin/News/NewsAdminList.tsx#L1-L5: move@components/SimplePaginationbefore@services/newsService.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/admin/News/NewsFilters.tsx` around lines 1 - 6, Reorder imports in src/pages/admin/News/NewsFilters.tsx (lines 1-6) according to the repository’s configured import-order rule, placing aliased and package imports in the required order. In src/pages/admin/News/NewsAdminList.tsx (lines 1-5), move the `@components/SimplePagination` import before `@services/newsService`; no other changes are needed.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/admin/News/NewsFilters.tsx`:
- Around line 72-92: Associate the date labels with their controls in the
NewsFilters date range fields by adding matching htmlFor and id attributes for
the pendingDateFrom and pendingDateTo inputs. Keep the existing values and
handlers unchanged.
---
Nitpick comments:
In `@src/pages/admin/News/NewsFilters.tsx`:
- Around line 1-6: Reorder imports in src/pages/admin/News/NewsFilters.tsx
(lines 1-6) according to the repository’s configured import-order rule, placing
aliased and package imports in the required order. In
src/pages/admin/News/NewsAdminList.tsx (lines 1-5), move the
`@components/SimplePagination` import before `@services/newsService`; no other
changes are needed.
In `@src/shared/services/newsService.ts`:
- Line 2: Combine the duplicate `@shared/models/news` imports in newsService.ts by
adding NewsStatus to the existing import declaration, leaving only one import
from that module.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1911f218-eb05-4ab5-827a-f4e3c50ac299
📒 Files selected for processing (12)
public/i18n/en/admin.jsonpublic/i18n/en/common.jsonpublic/i18n/en/public.jsonpublic/i18n/uk/admin.jsonpublic/i18n/uk/common.jsonpublic/i18n/uk/public.jsonsrc/pages/admin/News/NewsAdminList.tsxsrc/pages/admin/News/NewsFilters.tsxsrc/shared/components/AdminSearchInput.tsxsrc/shared/components/SimplePagination.tsxsrc/shared/models/news.tssrc/shared/services/newsService.ts
💤 Files with no reviewable changes (2)
- public/i18n/en/public.json
- public/i18n/uk/public.json
|



Summary by CodeRabbit
New Features
Bug Fixes