From 63bed7a30ddd71f5835d6dd95382c89436a26ae8 Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 8 Apr 2020 11:08:30 -0400 Subject: [PATCH 1/2] Fixes issue where job type redirects weren't firing correctly --- awx/ui_next/src/screens/Job/Jobs.jsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/awx/ui_next/src/screens/Job/Jobs.jsx b/awx/ui_next/src/screens/Job/Jobs.jsx index e1d5e4e528..607dfda2e6 100644 --- a/awx/ui_next/src/screens/Job/Jobs.jsx +++ b/awx/ui_next/src/screens/Job/Jobs.jsx @@ -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 ; + } + return ( <> @@ -55,10 +60,10 @@ function Jobs({ i18n }) { - + - + - + From 188b23e88f31c8044f5c042a6484a224254379db Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 8 Apr 2020 11:12:31 -0400 Subject: [PATCH 2/2] No need to pass undefined explicitly. view will be undefined if it's not passed --- awx/ui_next/src/screens/Job/Jobs.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui_next/src/screens/Job/Jobs.jsx b/awx/ui_next/src/screens/Job/Jobs.jsx index 607dfda2e6..55a9c36660 100644 --- a/awx/ui_next/src/screens/Job/Jobs.jsx +++ b/awx/ui_next/src/screens/Job/Jobs.jsx @@ -44,7 +44,7 @@ function Jobs({ i18n }) { function TypeRedirect({ view }) { const { id } = useParams(); const { path } = useRouteMatch(); - return ; + return ; } return (