Fixes #39349 - implement new button structure with kebab menu#817
Conversation
Lukshio
left a comment
There was a problem hiding this comment.
Just some nitpick to reduce brace hell
2cfebe6 to
d243b13
Compare
d243b13 to
0a8fc4e
Compare
|
Rebase + CI failure fix needed |
b05459d to
1ebbd20
Compare
1ebbd20 to
e7f2651
Compare
|
@andreilakatos Buttons should be on the title level |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
WalkthroughTask details rendering was split into a simplified task content component, a new header component, and updated route wiring. The task action controls now live in an overflow dropdown, and the page passes the task action and callbacks into the new header. Route imports, tests, and component registry entries were updated to use the ShowTaskDetails module root. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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: 5
🧹 Nitpick comments (1)
webpack/ForemanTasks/Routes/ShowTaskDetails/TaskDetailsHeader.js (1)
43-47: 🎯 Functional Correctness | 🔵 TrivialCheck React version compatibility for
defaultPropsBased on the project dependencies (
@theforeman/vendor>= 12.1.1) and the timeline of The Foreman ecosystem, the project relies on React 16.x during that vendor version range. In React 16,defaultPropson function components are supported, unlike in React 18/19+ where they are deprecation targets or ignored.The code using
defaultPropson function components (TitleComponentandTaskDetailsPage) is valid for the current React version in this repository. While migrating to parameter defaults (e.g.,({ action = '', state = '', result = '' })) is a recommended modernization step for future-proofing, it is not strictly required by the current runtime version.🤖 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/ForemanTasks/Routes/ShowTaskDetails/TaskDetailsHeader.js` around lines 43 - 47, The use of defaultProps on the function components TitleComponent and TaskDetailsPage is compatible with the repository’s current React 16 runtime, so no compatibility-driven refactor is required here. Keep the existing defaultProps definitions unless you are intentionally doing a broader modernization pass; if so, update the component signatures consistently rather than changing only one of them.
🤖 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/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js`:
- Around line 16-21: The Task component test only verifies the TaskInfo metadata
path and does not lock in the new header/body split. Update the Task.test.js
case around Task to add a negative assertion that the cancel/overflow action
controls are not rendered, using the Task render and any existing control
labels/test identifiers tied to TaskButtons or TaskDetailsHeader. This ensures
the test fails if action controls are reintroduced under the details body
instead of staying in the header.
In `@webpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.js`:
- Around line 145-150: The overflow dropdown in TaskButtons is seeding its menu
from stale state because SimpleDropdown is using initialItems instead of a
controlled items prop. Update the TaskButtons render path that builds
overflowItems so the dropdown re-renders when task-related props like
taskReload, canEdit, and state change; either pass the live items through
SimpleDropdown’s items prop or switch this menu to PatternFly’s Dropdown
component with controlled content.
In
`@webpack/ForemanTasks/Routes/ShowTaskDetails/__tests__/TaskDetailsPage.test.js`:
- Around line 204-205: The current assertions in TaskDetailsPage.test.js are too
broad and can pass even when the header layout is broken, because TaskInfo also
renders matching icons in the body. Update the Running/Error and cancel-button
checks to query within the title row or header container instead of using global
screen queries, so the test validates the new header placement; use the existing
header/title-row wrapper and keep the assertions scoped there across the
affected blocks.
In `@webpack/ForemanTasks/Routes/ShowTaskDetails/index.js`:
- Around line 41-45: `mapStateToProps` in ShowTaskDetails is using a separate
task-id source via `getTaskID`, which can diverge from the router param used by
`TaskDetailsPage`. Update the `mapStateToProps`/`connect` flow so the only task
id comes from `match.params.id`, and pass that same value through to the page
and any action callbacks instead of reading `window.location.pathname` or
re-parsing it elsewhere.
In `@webpack/ForemanTasks/Routes/ShowTaskDetails/TaskDetailsHeader.js`:
- Around line 60-61: Move the trailing props spread in TaskDetailsHeader so the
derived resumable and cancellable values are applied after any connected values
from ShowTaskDetails/index.js; currently the spread overwrites the local
executionPlan-based flags before TaskButtons sees them. Update the
TaskDetailsHeader props ordering around the TaskButtons call so the computed
resumable/cancellable values win, and apply the same ordering fix anywhere else
in the component where the spread appears.
---
Nitpick comments:
In `@webpack/ForemanTasks/Routes/ShowTaskDetails/TaskDetailsHeader.js`:
- Around line 43-47: The use of defaultProps on the function components
TitleComponent and TaskDetailsPage is compatible with the repository’s current
React 16 runtime, so no compatibility-driven refactor is required here. Keep the
existing defaultProps definitions unless you are intentionally doing a broader
modernization pass; if so, update the component signatures consistently rather
than changing only one of them.
🪄 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: db98c71b-0085-4838-b788-a6ca2d46889d
📒 Files selected for processing (15)
webpack/ForemanTasks/Components/TaskDetails/Components/Task.jswebpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.jswebpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.jswebpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.jswebpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskButtons.test.jswebpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.jswebpack/ForemanTasks/Routes/ShowTaskDetails/TaskDetailsHeader.jswebpack/ForemanTasks/Routes/ShowTaskDetails/TaskDetailsHeader.scsswebpack/ForemanTasks/Routes/ShowTaskDetails/TaskDetailsPage.jswebpack/ForemanTasks/Routes/ShowTaskDetails/__tests__/TaskDetailsHeader.test.jswebpack/ForemanTasks/Routes/ShowTaskDetails/__tests__/TaskDetailsPage.test.jswebpack/ForemanTasks/Routes/ShowTaskDetails/index.jswebpack/Routes/routes.jswebpack/Routes/routes.test.jswebpack/index.js
💤 Files with no reviewable changes (3)
- webpack/index.js
- webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js
- webpack/ForemanTasks/Components/TaskDetails/tests/TaskDetails.test.js
f2beb1a to
dc76c88
Compare
dc76c88 to
35c742b
Compare
| } from '@patternfly/react-core'; | ||
| import { translate as __ } from 'foremanReact/common/I18n'; | ||
| import { STATUS } from 'foremanReact/constants'; | ||
| import { usePermissions } from 'foremanReact/common/hooks/Permissions/permissionHooks'; |
|
Now it's spinning but is off center and overflowing Screencast_20260630_130449.mp4 |
66baf87 to
ace21c1
Compare
Issue resolved 😄 |
|
Thanks @andreilakatos |






Uh oh!
There was an error while loading. Please reload this page.