mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Merge pull request #4974 from jakemcdermott/switch-default-job-panel
Switch default job panel to output Reviewed-by: Jake McDermott <yo@jakemcdermott.me> https://github.com/jakemcdermott
This commit is contained in:
commit
08df2cad68
@ -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 });
|
||||
}
|
||||
|
@ -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 => {
|
||||
|
@ -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 {
|
||||
<Switch>
|
||||
<Redirect
|
||||
from="/jobs/:type/:id"
|
||||
to="/jobs/:type/:id/details"
|
||||
to="/jobs/:type/:id/output"
|
||||
exact
|
||||
/>
|
||||
{job && [
|
||||
|
@ -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 });
|
||||
|
Loading…
Reference in New Issue
Block a user