Skip to content
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

Fixes #38113 - Add a link to REX bootc job templates in image mode details card. #11272

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/katello/plugin.rb
Original file line number Diff line number Diff line change
@@ -698,6 +698,7 @@ def katello_template_setting_values(name)
RemoteExecutionFeature.register(:katello_module_stream_action, N_("Katello: Module Stream Actions"),
:description => N_("Perform a module stream action via Katello interface"),
:provided_inputs => ['action', 'module_spec', 'options'])
RemoteExecutionFeature.register(:katello_bootc_action, N_("Katello: Bootc Action"), :description => N_("Katello Bootc interface"))
RemoteExecutionFeature.register(:katello_bootc_upgrade, N_("Katello: Bootc Upgrade"), :description => N_("Bootc upgrade via Bootc interface"))
RemoteExecutionFeature.register(:katello_bootc_switch, N_("Katello: Bootc Switch"), :description => N_("Bootc switch via Bootc interface"))
RemoteExecutionFeature.register(:katello_bootc_rollback, N_("Katello: Bootc Rollback"), :description => N_("Bootc rollback via Bootc interface"))
Original file line number Diff line number Diff line change
@@ -9,13 +9,19 @@ import {
} from '@patternfly/react-core';
import CardTemplate from 'foremanReact/components/HostDetails/Templates/CardItem/CardTemplate';
import FontAwesomeImageModeIcon from '../../../../components/extensions/Hosts/FontAwesomeImageModeIcon';
import { createJob } from '../Tabs/customizedRexUrlHelpers';

const cardHeader = (
<>
<span style={{ marginRight: '0.5rem' }}>{__('Image mode details')}</span>
<FontAwesomeImageModeIcon />
</>
);
const actionUrl = hostname => createJob({
hostname,
feature: 'katello_bootc_action',
inputs: {},
});

const ImageModeCard = ({ isExpandedGlobal, hostDetails }) => {
const imageMode = hostDetails?.content_facet_attributes?.bootc_booted_image;
@@ -28,6 +34,7 @@ const ImageModeCard = ({ isExpandedGlobal, hostDetails }) => {
masonryLayout
isExpandedGlobal={isExpandedGlobal}
>
<a href={actionUrl(hostDetails.name)}>{__('Modify via remote execution')}</a>
<DescriptionList isHorizontal>
<DescriptionListGroup>
<Dt>{__('Running image')}</Dt>
@@ -58,6 +65,7 @@ const ImageModeCard = ({ isExpandedGlobal, hostDetails }) => {
ImageModeCard.propTypes = {
isExpandedGlobal: PropTypes.bool,
hostDetails: PropTypes.shape({
name: PropTypes.string,
content_facet_attributes: PropTypes.shape({
bootc_booted_image: PropTypes.string,
bootc_booted_digest: PropTypes.string,