mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
Merge pull request #6658 from mabashian/6655-job-redirect
Fixes issue where job type redirects weren't firing correctly Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
fe9de0d4cc
@ -19,7 +19,6 @@ import { JOB_TYPE_URL_SEGMENTS } from '@constants';
|
||||
function Jobs({ i18n }) {
|
||||
const history = useHistory();
|
||||
const location = useLocation();
|
||||
const { id } = useParams();
|
||||
const match = useRouteMatch();
|
||||
const [breadcrumbConfig, setBreadcrumbConfig] = useState({
|
||||
'/jobs': i18n._(t`Jobs`),
|
||||
@ -42,6 +41,12 @@ function Jobs({ i18n }) {
|
||||
[i18n]
|
||||
);
|
||||
|
||||
function TypeRedirect({ view }) {
|
||||
const { id } = useParams();
|
||||
const { path } = useRouteMatch();
|
||||
return <JobTypeRedirect id={id} path={path} view={view} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Breadcrumbs breadcrumbConfig={breadcrumbConfig} />
|
||||
@ -55,10 +60,10 @@ function Jobs({ i18n }) {
|
||||
</PageSection>
|
||||
</Route>
|
||||
<Route path={`${match.path}/:id/details`}>
|
||||
<JobTypeRedirect id={id} path={match.path} view="details" />
|
||||
<TypeRedirect view="details" />
|
||||
</Route>
|
||||
<Route path={`${match.path}/:id/output`}>
|
||||
<JobTypeRedirect id={id} path={match.path} view="output" />
|
||||
<TypeRedirect view="output" />
|
||||
</Route>
|
||||
<Route path={`${match.path}/:type/:id`}>
|
||||
<Job
|
||||
@ -68,7 +73,7 @@ function Jobs({ i18n }) {
|
||||
/>
|
||||
</Route>
|
||||
<Route path={`${match.path}/:id`}>
|
||||
<JobTypeRedirect id={id} path={match.path} />
|
||||
<TypeRedirect />
|
||||
</Route>
|
||||
</Switch>
|
||||
</>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user