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