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;
history.push(
`/${
resource.type === 'workflow_job_template' ? 'workflow' : 'jobs'
}/${job.id}`
resource.type === 'workflow_job_template' ? 'jobs/workflow' : 'jobs'
}/${job.id}/output`
);
} else {
this.setState({ promptError: true });

View File

@ -55,7 +55,7 @@ describe('LaunchButton', () => {
expect(JobTemplatesAPI.readLaunch).toHaveBeenCalledWith(1);
await sleep(0);
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 () => {
WorkflowJobTemplatesAPI.readLaunch.mockResolvedValue({

View File

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