Skip to content

Commit

Permalink
fix property field
Browse files Browse the repository at this point in the history
  • Loading branch information
Anu-Ujin committed Jun 17, 2019
1 parent 6283d69 commit e481488
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions src/modules/settings/properties/components/PropertyForm.tsx
Expand Up @@ -142,12 +142,10 @@ class PropertyForm extends React.Component<Props, State> {
};

renderContent = (formProps: IFormProps) => {
const {
groups,
closeModal,
renderButton,
field = {} as IField
} = this.props;
const { groups, closeModal, renderButton, field } = this.props;

const object = field || ({} as IField);

const { values, isSubmitted } = formProps;
const { type } = this.state;

Expand All @@ -158,7 +156,7 @@ class PropertyForm extends React.Component<Props, State> {
<FormControl
{...formProps}
name="text"
defaultValue={field.text || ''}
defaultValue={object.text || ''}
required={true}
/>
</FormGroup>
Expand All @@ -169,7 +167,7 @@ class PropertyForm extends React.Component<Props, State> {
{...formProps}
name="description"
componentClass="textarea"
defaultValue={field.description || ''}
defaultValue={object.description || ''}
/>
</FormGroup>

Expand All @@ -180,7 +178,7 @@ class PropertyForm extends React.Component<Props, State> {
{...formProps}
name="groupId"
componentClass="select"
defaultValue={field.groupId || ''}
defaultValue={object.groupId || ''}
required={true}
>
{groups.map(group => {
Expand Down Expand Up @@ -223,7 +221,7 @@ class PropertyForm extends React.Component<Props, State> {
{...formProps}
componentClass="select"
name="validation"
defaultValue={field.validation || ''}
defaultValue={object.validation || ''}
>
<option />
<option value="email">Email</option>
Expand Down
@@ -1,7 +1,7 @@
import gql from 'graphql-tag';
import { ButtonMutate } from 'modules/common/components';
import { IButtonMutateProps } from 'modules/common/types';
import { withProps } from 'modules/common/utils';
import { __, withProps } from 'modules/common/utils';
import * as React from 'react';
import { compose, graphql } from 'react-apollo';
import { PropertyForm } from '../components';
Expand Down

0 comments on commit e481488

Please sign in to comment.