Skip to content

Commit

Permalink
fix: No maxLength label is displayed for arrays of items #1701
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriy Zaleskyy committed Oct 8, 2021
1 parent bccd213 commit 543ecc4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/Fields/FieldDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { l } from '../../services/Labels';
import { OptionsContext } from '../OptionsProvider';
import { FieldModel } from '../../services/models/Field';
import styled from '../../styled-components';
import { ArraySchema } from '../Schema';

const MAX_PATTERN_LENGTH = 45;

Expand Down Expand Up @@ -63,11 +64,19 @@ export class FieldDetails extends React.PureComponent<FieldProps, { patternShown
}
}


return (
<div>
<div>
<TypePrefix>{schema.typePrefix}</TypePrefix>
<TypeName>{schema.displayType}</TypeName>
{schema.type === 'array' ?
<ArraySchema schema={schema}/>
:
(<>
<TypePrefix>{schema.typePrefix}</TypePrefix>
<TypeName>{schema.displayType}</TypeName>
</>
)
}
{schema.displayFormat && (
<TypeFormat>
{' '}
Expand Down

0 comments on commit 543ecc4

Please sign in to comment.