Skip to content

fix: adjust function to reload table if one item is saved#876

Merged
smarcet merged 1 commit into
masterfrom
fix/form-template-item-update
May 4, 2026
Merged

fix: adjust function to reload table if one item is saved#876
smarcet merged 1 commit into
masterfrom
fix/form-template-item-update

Conversation

@tomrndom
Copy link
Copy Markdown

@tomrndom tomrndom commented Apr 16, 2026

ref: https://app.clickup.com/t/86b96g8y6

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling when adding multiple inventory items: the form now refreshes to show any successfully added items even if some additions fail (partial failures no longer block visible updates).
    • Fixed per-page pagination to consistently respect the "Show archived" checkbox across sponsor form lists and tabs, ensuring archived items stay correctly filtered when changing page size.

@tomrndom tomrndom requested a review from smarcet April 16, 2026 02:20
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a0b94fca-758c-4478-83dd-3f3208b58920

📥 Commits

Reviewing files that changed from the base of the PR and between c70f14e and 38445c4.

📒 Files selected for processing (3)
  • src/pages/sponsors-global/form-templates/form-template-item-list-page.js
  • src/pages/sponsors/sponsor-form-item-list-page/index.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/index.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/pages/sponsors/sponsor-form-item-list-page/index.js
  • src/pages/sponsors-global/form-templates/form-template-item-list-page.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/index.js

📝 Walkthrough

Walkthrough

Switched per-page handlers to pass showArchived (replacing hideArchived) for archived-item filtering across sponsor-related pages, and changed form-template item cloning to use Promise.allSettled, refreshing items when at least one clone succeeds.

Changes

Cohort / File(s) Summary
Form-template Promise update
src/pages/sponsors-global/form-templates/form-template-item-list-page.js
Replaced Promise.all with Promise.allSettled for cloneFromInventoryItem calls; removed prior .catch logging; list refresh now occurs when at least one clone is fulfilled.
Pagination / archived-flag fix
src/pages/sponsors/sponsor-form-item-list-page/index.js, src/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/index.js
Updated per-page handlers to pass showArchived (current checkbox state) into get* calls instead of hideArchived, making archived-filter behavior consistent when changing page size.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • smarcet

Poem

🐇 I hopped through lines both neat and bright,
Settled promises softly in the night.
Archived flags now show what they should,
A single success makes the list feel good.
🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title refers to reloading a table when a single item is saved, but the actual changes involve fixing archived-filter handling and switching from Promise.all to Promise.allSettled across multiple files. Revise the title to accurately reflect the main changes: 'fix: use showArchived parameter instead of hideArchived and switch to Promise.allSettled for refresh logic' or similar.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/form-template-item-update

Review rate limit: 3/5 reviews remaining, refill in 13 minutes and 4 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomrndom tomrndom force-pushed the fix/form-template-item-update branch from 2bfe0fe to c70f14e Compare April 28, 2026 19:28
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@tomrndom tomrndom force-pushed the fix/form-template-item-update branch from c70f14e to 38445c4 Compare April 29, 2026 10:58
Copy link
Copy Markdown

@smarcet smarcet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smarcet smarcet merged commit 08e2650 into master May 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants