mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 06:29:31 -02:30
Fixes navigation issue and address ps issues.
This commit is contained in:
@@ -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 });
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user