From c202574ae326bad42f59a261210d5c704468b4d6 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Wed, 9 Oct 2019 13:05:27 -0400 Subject: [PATCH] Switch default job panel to output --- awx/ui_next/src/components/LaunchButton/LaunchButton.jsx | 4 ++-- .../src/components/LaunchButton/LaunchButton.test.jsx | 4 ++-- awx/ui_next/src/screens/Job/Job.jsx | 6 +++--- awx/ui_next/src/screens/Job/Jobs.jsx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx b/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx index 830a660603..75c1277420 100644 --- a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx +++ b/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx @@ -52,7 +52,7 @@ class LaunchButton extends React.Component { ); if (launchConfig.can_start_without_user_input) { const { data: job } = await JobTemplatesAPI.launch(resource.id); - history.push(`/jobs/${job.id}/details`); + history.push(`/jobs/${job.id}`); } else { this.setState({ promptError: true }); } @@ -95,7 +95,7 @@ class LaunchButton extends React.Component { relaunchConfig.passwords_needed_to_start.length === 0 ) { const { data: job } = await relaunch; - history.push(`/jobs/${job.id}/details`); + history.push(`/jobs/${job.id}`); } else { this.setState({ promptError: true }); } diff --git a/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx b/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx index 75a6a554f2..d8aa67783c 100644 --- a/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx +++ b/awx/ui_next/src/components/LaunchButton/LaunchButton.test.jsx @@ -29,7 +29,7 @@ describe('LaunchButton', () => { ); expect(wrapper).toHaveLength(1); }); - test('redirects to details after successful launch', async done => { + test('redirects to job after successful launch', async done => { const history = { push: jest.fn(), }; @@ -51,7 +51,7 @@ describe('LaunchButton', () => { expect(JobTemplatesAPI.readLaunch).toHaveBeenCalledWith(1); await sleep(0); expect(JobTemplatesAPI.launch).toHaveBeenCalledWith(1); - expect(history.push).toHaveBeenCalledWith('/jobs/9000/details'); + expect(history.push).toHaveBeenCalledWith('/jobs/9000'); done(); }); test('displays error modal after unsuccessful launch', async done => { diff --git a/awx/ui_next/src/screens/Job/Job.jsx b/awx/ui_next/src/screens/Job/Job.jsx index bf4e4761dc..3f82fbdd75 100644 --- a/awx/ui_next/src/screens/Job/Job.jsx +++ b/awx/ui_next/src/screens/Job/Job.jsx @@ -69,8 +69,8 @@ class Job extends Component { } const tabsArray = [ - { name: i18n._(t`Details`), link: `${match.url}/details`, id: 0 }, - { name: i18n._(t`Output`), link: `${match.url}/output`, id: 1 }, + { name: i18n._(t`Output`), link: `${match.url}/output`, id: 0 }, + { name: i18n._(t`Details`), link: `${match.url}/details`, id: 1 }, ]; const CardHeader = styled(PFCardHeader)` @@ -132,7 +132,7 @@ class Job extends Component { {job && [ diff --git a/awx/ui_next/src/screens/Job/Jobs.jsx b/awx/ui_next/src/screens/Job/Jobs.jsx index 8c86472a10..35e90816df 100644 --- a/awx/ui_next/src/screens/Job/Jobs.jsx +++ b/awx/ui_next/src/screens/Job/Jobs.jsx @@ -32,8 +32,8 @@ class Jobs extends Component { const breadcrumbConfig = { '/jobs': i18n._(t`Jobs`), [`/jobs/${type}/${job.id}`]: `${job.name}`, - [`/jobs/${type}/${job.id}/details`]: i18n._(t`Details`), [`/jobs/${type}/${job.id}/output`]: i18n._(t`Output`), + [`/jobs/${type}/${job.id}/details`]: i18n._(t`Details`), }; this.setState({ breadcrumbConfig });