Merge pull request #295 from marshmalien/job-template-directory-name

Job template directory name
This commit is contained in:
Marliana Lara
2019-06-26 15:10:33 -04:00
committed by GitHub
8 changed files with 16 additions and 13 deletions

View File

@@ -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/'
} }

View File

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

View File

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

View File

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

View File

@@ -0,0 +1 @@
export { default } from './JobTemplateEdit';

View File

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

View File

@@ -1 +0,0 @@
export { default } from './TemplateEdit';

View File

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