Fixes #39539 - Host actions are disabled after bulk action#11801
Fixes #39539 - Host actions are disabled after bulk action#11801MariaAga wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughBulk host action modals now receive table refresh callbacks from host action contexts. Wizard contexts propagate the same callback to review footers, which invoke it after bulk operations and before closing. ChangesBulk host refresh integration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/BulkAssignCVEnvsModal.jsError: Cannot read config file: /webpack/.eslintrc.js webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/index.jsError: Cannot read config file: /webpack/.eslintrc.js webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.jsError: Cannot read config file: /webpack/.eslintrc.js
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
🤖 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
`@webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js`:
- Line 197: Move the refreshTableData() call in the BulkManageTracesModal flow
into the success path of resolveBulkTraces, after the PUT request completes
successfully. Remove the earlier unconditional invocation so table data
refreshes only after the backend update is confirmed.
🪄 Autofix (Beta)
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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b59a4732-9ca3-40ca-a5b5-1f78dd4629c0
📒 Files selected for processing (14)
webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/BulkAssignCVEnvsModal.jswebpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/index.jswebpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.jswebpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/index.jswebpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_ReviewFooter.jswebpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.jswebpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.jswebpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/index.jswebpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_ReviewFooter.jswebpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.jswebpack/components/extensions/Hosts/BulkActions/BulkRepositorySetsWizard/03_ReviewFooter.jswebpack/components/extensions/Hosts/BulkActions/BulkRepositorySetsWizard/BulkRepositorySetsWizard.jswebpack/components/extensions/Hosts/BulkActions/BulkSystemPurposeModal/BulkSystemPurposeModal.jswebpack/components/extensions/Hosts/BulkActions/BulkSystemPurposeModal/index.js
| }, | ||
| }, | ||
| })); | ||
| refreshTableData(); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check the definition of resolveBulkTraces to see if it accepts a callback or returns a Promise.
rg -A 10 'export const resolveBulkTraces'Repository: Katello/katello
Length of output: 153
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== resolveBulkTraces matches ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'resolveBulkTraces' .
printf '\n== refreshTableData call sites in BulkActions modals ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'refreshTableData\(\)' webpack/components/extensions/Hosts/BulkActions
printf '\n== files for BulkManageTracesModal ==\n'
fd -a 'BulkManageTracesModal.js|BulkManage.*Modal.js' webpack/components/extensions/Hosts/BulkActionsRepository: Katello/katello
Length of output: 1733
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== BulkManageTracesActions.js ==\n'
cat -n webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesActions.js
printf '\n== BulkManageTracesModal.js around dispatch ==\n'
sed -n '160,215p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js
printf '\n== similar modal patterns ==\n'
sed -n '145,185p' webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js
printf '\n---\n'
sed -n '100,135p' webpack/components/extensions/Hosts/BulkActions/BulkSystemPurposeModal/BulkSystemPurposeModal.jsRepository: Katello/katello
Length of output: 6275
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the exact implementation of resolveBulkTraces and the surrounding modal callback.
sed -n '1,120p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesActions.js
printf '\n---\n'
sed -n '170,205p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js
# Check whether nearby bulk-action modals wait for async completion via callbacks/promises.
printf '\n== search for success callbacks in bulk action modals ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'successCallback|then\(|await |callback' webpack/components/extensions/Hosts/BulkActionsRepository: Katello/katello
Length of output: 20069
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== BulkManageTracesModal.js top/middle ==\n'
sed -n '1,260p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js
printf '\n== BulkManageTracesModal.test.js relevant cases ==\n'
sed -n '1,420p' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/__tests__/BulkManageTracesModal.test.js
printf '\n== search for refreshTableData prop usage in traces area ==\n'
rg -n --hidden --glob '!**/node_modules/**' 'refreshTableData' webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal webpack/components/extensions/Hosts -g '!**/__tests__/**'Repository: Katello/katello
Length of output: 26506
Move refreshTableData() into the resolveBulkTraces success path. It currently runs before the PUT request finishes, so the refresh can race the backend and re-read stale data; this should follow the same completion timing as the other bulk modals.
🤖 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
`@webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js`
at line 197, Move the refreshTableData() call in the BulkManageTracesModal flow
into the success path of resolveBulkTraces, after the PUT request completes
successfully. Remove the earlier unconditional invocation so table data
refreshes only after the backend update is confirmed.
depends on theforeman/foreman#11110
to test:
user has permissions to edit hosts
go to new host index
click on host kebab - edit is enabled
run X action
edit is still enabled.
Summary by CodeRabbit