feat: add custom sponsor page archive/unarchive functionality#809
feat: add custom sponsor page archive/unarchive functionality#809
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds archive/unarchive support for sponsor customized pages: new Redux action types and thunks that call PUT/DELETE /archive, reducer cases to update page.is_archived, component wiring to dispatch the thunks and refresh pages, i18n strings, and tests for both flows. Changes
Sequence DiagramsequenceDiagram
participant User as User (UI)
participant Component as SponsorPagesTab
participant Thunk as Redux Thunk
participant API as API Server
participant Reducer as Pages Reducer
participant Store as Redux Store
User->>Component: Click Archive/Unarchive button
Component->>Thunk: dispatch archiveCustomizedPage(pageId) or unarchiveCustomizedPage(pageId)
Thunk->>API: PUT /archive (pageId) or DELETE /archive (pageId)
API-->>Thunk: success response
Thunk->>Reducer: dispatch SPONSOR_CUSTOMIZED_PAGE_ARCHIVED or SPONSOR_CUSTOMIZED_PAGE_UNARCHIVED (payload: pageId)
Thunk->>Component: show success snackbar
Reducer->>Store: update customizedPages.pages[*].is_archived
Store-->>Component: updated state -> UI reflects archived status
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
bda0423 to
9e4d822
Compare
9e4d822 to
5c1373e
Compare
9a95df7 to
b1e7ea0
Compare
|
@tomrndom please review conflicts |
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
ce35755 to
0544618
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/pages/sponsors/sponsor-pages-tab/index.js`:
- Around line 176-179: The handler handleArchiveCustomizedPage currently only
calls archiveCustomizedPage(item.id) or unarchiveCustomizedPage(item.id), which
can leave the UI (especially when hideArchived filter is active) stale; update
the handler to await the archive/unarchive action and then refresh the
customized pages list using the existing list loader (e.g., dispatch or call the
fetch/load function that populates the tab) with the current filters (including
hideArchived) so the row/totals update immediately after the toggle; reference
handleArchiveCustomizedPage, archiveCustomizedPage, unarchiveCustomizedPage and
the hideArchived filter when implementing this change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6ff2a0fb-2bc3-4749-ae15-dd14388c4f47
📒 Files selected for processing (5)
src/actions/sponsor-pages-actions.jssrc/i18n/en.jsonsrc/pages/sponsors/sponsor-pages-tab/__tests__/sponsor-pages-tab.test.jssrc/pages/sponsors/sponsor-pages-tab/index.jssrc/reducers/sponsors/sponsor-page-pages-list-reducer.js
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
ref: https://app.clickup.com/t/86b8nf9mr
Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com
Summary by CodeRabbit