mirror of
https://github.com/ansible/awx.git
synced 2026-02-02 10:08:10 -03:30
add FormRow component; rename unwrapped components with underscore
This commit is contained in:
15
src/components/FormRow.jsx
Normal file
15
src/components/FormRow.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
|
||||
export default function FormRow ({ children }) {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridGap: '20px',
|
||||
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))'
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
import { ConfigContext } from '../../../context';
|
||||
import FormRow from '../../../components/FormRow';
|
||||
import FormField from '../../../components/FormField';
|
||||
import FormActionGroup from '../../../components/FormActionGroup';
|
||||
import AnsibleSelect from '../../../components/AnsibleSelect';
|
||||
@@ -96,13 +97,7 @@ class OrganizationForm extends Component {
|
||||
onSubmit={this.handleSubmit}
|
||||
render={formik => (
|
||||
<Form autoComplete="off" onSubmit={formik.handleSubmit}>
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridGap: '20px',
|
||||
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))'
|
||||
}}
|
||||
>
|
||||
<FormRow>
|
||||
<FormField
|
||||
id="edit-org-form-name"
|
||||
name="name"
|
||||
@@ -139,7 +134,7 @@ class OrganizationForm extends Component {
|
||||
)
|
||||
)}
|
||||
</ConfigContext.Consumer>
|
||||
</div>
|
||||
</FormRow>
|
||||
<InstanceGroupsLookup
|
||||
api={api}
|
||||
value={instanceGroups}
|
||||
|
||||
@@ -84,5 +84,5 @@ OrganizationEdit.contextTypes = {
|
||||
custom_virtualenvs: PropTypes.arrayOf(PropTypes.string)
|
||||
};
|
||||
|
||||
export { OrganizationEdit as OrganizationEditNoRouter };
|
||||
export { OrganizationEdit as _OrganizationEdit };
|
||||
export default withRouter(OrganizationEdit);
|
||||
|
||||
@@ -104,5 +104,5 @@ OrganizationAdd.contextTypes = {
|
||||
custom_virtualenvs: PropTypes.arrayOf(PropTypes.string)
|
||||
};
|
||||
|
||||
export { OrganizationAdd as OrganizationAddNoRouter };
|
||||
export { OrganizationAdd as _OrganizationAdd };
|
||||
export default withRouter(OrganizationAdd);
|
||||
|
||||
Reference in New Issue
Block a user