Fixes navigation issue and address ps issues.

This commit is contained in:
Alex Corey
2020-02-19 09:36:07 -05:00
parent 32e017bd03
commit 8f6b679c85
3 changed files with 4 additions and 5 deletions

View File

@@ -62,8 +62,8 @@ class LaunchButton extends React.Component {
const { data: job } = await launchJob; const { data: job } = await launchJob;
history.push( history.push(
`/${ `/${
resource.type === 'workflow_job_template' ? 'workflow' : 'jobs' resource.type === 'workflow_job_template' ? 'jobs/workflow' : 'jobs'
}/${job.id}` }/${job.id}/output`
); );
} else { } else {
this.setState({ promptError: true }); this.setState({ promptError: true });

View File

@@ -55,7 +55,7 @@ describe('LaunchButton', () => {
expect(JobTemplatesAPI.readLaunch).toHaveBeenCalledWith(1); expect(JobTemplatesAPI.readLaunch).toHaveBeenCalledWith(1);
await sleep(0); await sleep(0);
expect(JobTemplatesAPI.launch).toHaveBeenCalledWith(1); expect(JobTemplatesAPI.launch).toHaveBeenCalledWith(1);
expect(history.location.pathname).toEqual('/jobs/9000'); expect(history.location.pathname).toEqual('/jobs/9000/output');
}); });
test('should launch the correct job type', async () => { test('should launch the correct job type', async () => {
WorkflowJobTemplatesAPI.readLaunch.mockResolvedValue({ WorkflowJobTemplatesAPI.readLaunch.mockResolvedValue({

View File

@@ -91,8 +91,7 @@ function WorkflowJobTemplateDetail({ template, i18n, webHookKey }) {
</Link> </Link>
); );
}; };
const canLaunch = const canLaunch = summary_fields?.user_capabilities?.start;
summary_fields.user_capabilities && summary_fields.user_capabilities.start;
const recentPlaybookJobs = summary_fields.recent_jobs.map(job => ({ const recentPlaybookJobs = summary_fields.recent_jobs.map(job => ({
...job, ...job,
type: 'job', type: 'job',