1
0
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:
softwarefactory-project-zuul[bot] 2019-10-10 04:24:04 +00:00 committed by GitHub
commit 08df2cad68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -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 });
}

View File

@ -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 => {

View File

@ -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 && [

View File

@ -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 });