-
Notifications
You must be signed in to change notification settings - Fork 99
Fixes #39349 - implement new button structure with kebab menu #817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Lukshio
merged 5 commits into
theforeman:master
from
andreilakatos:taskdetails-pf5-update-buttons
Jun 30, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e7f2651
Fixes #39349 - implement new button structure with kebab menu
andreilakatos 81b5e48
Refs #39349 - move buttons to page title, provide state props to the …
andreilakatos 35c742b
Refs #39349 - route task id via props and align TaskDetails RTL tests
andreilakatos e42cc37
Refs #39349 - hide task header actions without view permission or on …
andreilakatos ace21c1
Refs #39349 - move task buttons css to a separate file
andreilakatos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
78 changes: 8 additions & 70 deletions
78
webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,75 +1,13 @@ | ||
| import React, { useState } from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import React from 'react'; | ||
| import { Stack, StackItem } from '@patternfly/react-core'; | ||
| import TaskInfo from './TaskInfo'; | ||
| import { | ||
| ForceUnlockConfirmationModal, | ||
| UnlockConfirmationModal, | ||
| } from '../../common/ClickConfirmation'; | ||
| import { TaskButtons } from './TaskButtons'; | ||
|
|
||
| const Task = props => { | ||
| const { | ||
| taskReload, | ||
| id, | ||
| forceCancelTaskRequest, | ||
| unlockTaskRequest, | ||
| action, | ||
| taskReloadStart, | ||
| } = props; | ||
| const forceUnlock = () => { | ||
| if (!taskReload) { | ||
| taskReloadStart(id); | ||
| } | ||
| forceCancelTaskRequest(id, action); | ||
| }; | ||
| const unlock = () => { | ||
| if (!taskReload) { | ||
| taskReloadStart(id); | ||
| } | ||
| unlockTaskRequest(id, action); | ||
| }; | ||
| const [unlockModalOpen, setUnlockModalOpen] = useState(false); | ||
| const [forceUnlockModalOpen, setForceUnlockModalOpen] = useState(false); | ||
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <UnlockConfirmationModal | ||
| onClick={unlock} | ||
| isOpen={unlockModalOpen} | ||
| setModalClosed={() => setUnlockModalOpen(false)} | ||
| /> | ||
| <ForceUnlockConfirmationModal | ||
| onClick={forceUnlock} | ||
| isOpen={forceUnlockModalOpen} | ||
| setModalClosed={() => setForceUnlockModalOpen(false)} | ||
| /> | ||
| <TaskButtons | ||
| taskReloadStart={taskReloadStart} | ||
| setUnlockModalOpen={setUnlockModalOpen} | ||
| setForceUnlockModalOpen={setForceUnlockModalOpen} | ||
| {...props} | ||
| /> | ||
| const Task = props => ( | ||
| <Stack hasGutter> | ||
| <StackItem> | ||
| <TaskInfo {...props} /> | ||
| </React.Fragment> | ||
| ); | ||
| }; | ||
|
|
||
| Task.propTypes = { | ||
| taskReload: PropTypes.bool, | ||
| id: PropTypes.string, | ||
| forceCancelTaskRequest: PropTypes.func, | ||
| unlockTaskRequest: PropTypes.func, | ||
| action: PropTypes.string, | ||
| taskReloadStart: PropTypes.func, | ||
| }; | ||
|
|
||
| Task.defaultProps = { | ||
| taskReload: false, | ||
| id: '', | ||
| forceCancelTaskRequest: () => null, | ||
| unlockTaskRequest: () => null, | ||
| action: '', | ||
| taskReloadStart: () => null, | ||
| }; | ||
| </StackItem> | ||
| </Stack> | ||
| ); | ||
|
|
||
| export default Task; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
webpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| .task-buttons { | ||
| .spin { | ||
| -webkit-animation: spin 1s infinite linear; | ||
| -moz-animation: spin 1s infinite linear; | ||
| -o-animation: spin 1s infinite linear; | ||
| animation: spin 1s infinite linear; | ||
| -webkit-transform-origin: 50% 50%; | ||
| transform-origin: 50% 50%; | ||
| -ms-transform-origin: 50% 50%; /* IE 9 */ | ||
| } | ||
|
|
||
| @-moz-keyframes spin { | ||
| from { | ||
| -moz-transform: rotate(0deg); | ||
| } | ||
|
|
||
| to { | ||
| -moz-transform: rotate(360deg); | ||
| } | ||
| } | ||
|
|
||
| @-webkit-keyframes spin { | ||
| from { | ||
| -webkit-transform: rotate(0deg); | ||
| } | ||
|
|
||
| to { | ||
| -webkit-transform: rotate(360deg); | ||
| } | ||
| } | ||
|
|
||
| @keyframes spin { | ||
| from { | ||
| transform: rotate(0deg); | ||
| } | ||
|
|
||
| to { | ||
| transform: rotate(360deg); | ||
| } | ||
| } | ||
|
|
||
| .dynflow-button > span { | ||
| pointer-events: auto; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.