mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 16:28:43 -03:30
Merge pull request #295 from marshmalien/job-template-directory-name
Job template directory name
This commit is contained in:
@@ -4,10 +4,12 @@ import AnsibleSelect, { _AnsibleSelect } from './AnsibleSelect';
|
|||||||
|
|
||||||
const mockData = [
|
const mockData = [
|
||||||
{
|
{
|
||||||
|
key: 'baz',
|
||||||
label: 'Baz',
|
label: 'Baz',
|
||||||
value: '/venv/baz/'
|
value: '/venv/baz/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
key: 'default',
|
||||||
label: 'Default',
|
label: 'Default',
|
||||||
value: '/venv/ansible/'
|
value: '/venv/ansible/'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const StyledLaunchButton = styled(Button)`
|
|||||||
padding: 5px 8px;
|
padding: 5px 8px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color:#d9534f;
|
background-color: #0066cc;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import TemplateForm from '../shared/TemplateForm';
|
|||||||
import { JobTemplatesAPI } from '@api';
|
import { JobTemplatesAPI } from '@api';
|
||||||
import { JobTemplate } from '@types';
|
import { JobTemplate } from '@types';
|
||||||
|
|
||||||
class TemplateEdit extends Component {
|
class JobTemplateEdit extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
template: JobTemplate.isRequired,
|
template: JobTemplate.isRequired,
|
||||||
};
|
};
|
||||||
@@ -60,4 +60,4 @@ class TemplateEdit extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withRouter(TemplateEdit);
|
export default withRouter(JobTemplateEdit);
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { JobTemplatesAPI } from '@api';
|
import { JobTemplatesAPI } from '@api';
|
||||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||||
import TemplateEdit from './TemplateEdit';
|
import JobTemplateEdit from './JobTemplateEdit';
|
||||||
|
|
||||||
jest.mock('@api');
|
jest.mock('@api');
|
||||||
|
|
||||||
describe('<TemplateEdit />', () => {
|
describe('<JobTemplateEdit />', () => {
|
||||||
const mockData = {
|
const mockData = {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: 'Foo',
|
name: 'Foo',
|
||||||
@@ -24,7 +24,7 @@ describe('<TemplateEdit />', () => {
|
|||||||
|
|
||||||
test('initially renders successfully', () => {
|
test('initially renders successfully', () => {
|
||||||
mountWithContexts(
|
mountWithContexts(
|
||||||
<TemplateEdit
|
<JobTemplateEdit
|
||||||
template={mockData}
|
template={mockData}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -32,7 +32,7 @@ describe('<TemplateEdit />', () => {
|
|||||||
|
|
||||||
test('handleSubmit should call api update', () => {
|
test('handleSubmit should call api update', () => {
|
||||||
const wrapper = mountWithContexts(
|
const wrapper = mountWithContexts(
|
||||||
<TemplateEdit
|
<JobTemplateEdit
|
||||||
template={mockData}
|
template={mockData}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -51,7 +51,7 @@ describe('<TemplateEdit />', () => {
|
|||||||
push: jest.fn(),
|
push: jest.fn(),
|
||||||
};
|
};
|
||||||
const wrapper = mountWithContexts(
|
const wrapper = mountWithContexts(
|
||||||
<TemplateEdit
|
<JobTemplateEdit
|
||||||
template={mockData}
|
template={mockData}
|
||||||
/>,
|
/>,
|
||||||
{ context: { router: { history } } }
|
{ context: { router: { history } } }
|
||||||
1
src/screens/Template/JobTemplateEdit/index.js
Normal file
1
src/screens/Template/JobTemplateEdit/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './JobTemplateEdit';
|
||||||
@@ -17,7 +17,7 @@ import ContentError from '@components/ContentError';
|
|||||||
import RoutedTabs from '@components/RoutedTabs';
|
import RoutedTabs from '@components/RoutedTabs';
|
||||||
import JobTemplateDetail from './JobTemplateDetail';
|
import JobTemplateDetail from './JobTemplateDetail';
|
||||||
import { JobTemplatesAPI } from '@api';
|
import { JobTemplatesAPI } from '@api';
|
||||||
import TemplateEdit from './TemplateEdit';
|
import JobTemplateEdit from './JobTemplateEdit';
|
||||||
|
|
||||||
class Template extends Component {
|
class Template extends Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -131,7 +131,7 @@ class Template extends Component {
|
|||||||
<Route
|
<Route
|
||||||
path="/templates/:templateType/:id/edit"
|
path="/templates/:templateType/:id/edit"
|
||||||
render={() => (
|
render={() => (
|
||||||
<TemplateEdit
|
<JobTemplateEdit
|
||||||
template={template}
|
template={template}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export { default } from './TemplateEdit';
|
|
||||||
@@ -28,8 +28,9 @@ class Templates extends Component {
|
|||||||
}
|
}
|
||||||
const breadcrumbConfig = {
|
const breadcrumbConfig = {
|
||||||
'/templates': i18n._(t`Templates`),
|
'/templates': i18n._(t`Templates`),
|
||||||
[`/templates/${template.type}/${template.id}/details`]: i18n._(t`${template.name} Details`),
|
[`/templates/${template.type}/${template.id}`]: `${template.name}`,
|
||||||
[`/templates/${template.type}/${template.id}/edit`]: i18n._(t`${template.name} Edit`)
|
[`/templates/${template.type}/${template.id}/details`]: i18n._(t`Details`),
|
||||||
|
[`/templates/${template.type}/${template.id}/edit`]: i18n._(t`Edit Details`),
|
||||||
};
|
};
|
||||||
this.setState({ breadcrumbConfig });
|
this.setState({ breadcrumbConfig });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user