Skip to content

Commit

Permalink
Fixes #36780 - Hide multiple titles on run job page
Browse files Browse the repository at this point in the history
  • Loading branch information
kmalyjur authored and adamruzicka committed Nov 22, 2023
1 parent f5840a9 commit 29fbd3a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 44 deletions.
2 changes: 1 addition & 1 deletion lib/foreman_remote_execution/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Engine < ::Rails::Engine

initializer 'foreman_remote_execution.register_plugin', before: :finisher_hook do |_app|
Foreman::Plugin.register :foreman_remote_execution do
requires_foreman '>= 3.8'
requires_foreman '>= 3.9'
register_global_js_file 'global'
register_gettext

Expand Down
35 changes: 10 additions & 25 deletions webpack/JobWizard/JobWizardPageRerun.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import URI from 'urijs';
import {
Alert,
Title,
Divider,
Skeleton,
Flex,
FlexItem,
Button,
} from '@patternfly/react-core';
import { Alert, Divider, Skeleton, Button } from '@patternfly/react-core';
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
import { useAPI } from 'foremanReact/common/hooks/API/APIHooks';
import PageLayout from 'foremanReact/routes/common/PageLayout/PageLayout';
Expand Down Expand Up @@ -54,25 +46,18 @@ const JobWizardPageRerun = ({
header={title}
breadcrumbOptions={breadcrumbOptions}
searchable={false}
toolbarButtons={
<Button
variant="link"
component="a"
href={`/old/job_invocations/${id}/rerun${search}`}
>
{__('Use old form')}
</Button>
}
>
<React.Fragment>
<React.Fragment>
<Flex>
<FlexItem>
<Title headingLevel="h2" size="2xl">
{title}
</Title>
</FlexItem>
<FlexItem align={{ default: 'alignRight' }}>
<Button
variant="link"
component="a"
href={`/old/job_invocations/${id}/rerun${search}`}
>
{__('Use old form')}
</Button>
</FlexItem>
</Flex>
<Divider component="div" />
</React.Fragment>
{!status || status === STATUS.PENDING ? (
Expand Down
27 changes: 9 additions & 18 deletions webpack/JobWizard/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Title, Flex, FlexItem, Button } from '@patternfly/react-core';
import { Button } from '@patternfly/react-core';
import { translate as __ } from 'foremanReact/common/I18n';
import PageLayout from 'foremanReact/routes/common/PageLayout/PageLayout';
import { JobWizard } from './JobWizard';
Expand All @@ -18,23 +18,14 @@ const JobWizardPage = ({ location: { search } }) => {
header={title}
breadcrumbOptions={breadcrumbOptions}
searchable={false}
beforeToolbarComponent={
<Flex>
<FlexItem>
<Title headingLevel="h2" size="2xl">
{title}
</Title>
</FlexItem>
<FlexItem align={{ default: 'alignRight' }}>
<Button
variant="link"
component="a"
href={`/old/job_invocations/new${search}`}
>
{__('Use legacy form')}
</Button>
</FlexItem>
</Flex>
toolbarButtons={
<Button
variant="link"
component="a"
href={`/old/job_invocations/new${search}`}
>
{__('Use legacy form')}
</Button>
}
pageSectionType="wizard"
>
Expand Down

0 comments on commit 29fbd3a

Please sign in to comment.