File tree Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ export const TypePrefix = styled(FieldLabel)`
18
18
` ;
19
19
20
20
export const TypeName = styled ( FieldLabel ) `
21
- color: ${ props => transparentizeHex ( props . theme . colors . text , 0.4 ) } ;
21
+ color: ${ props => transparentizeHex ( props . theme . colors . text , 0.8 ) } ;
22
+ ` ;
23
+ export const TypeTitle = styled ( FieldLabel ) `
24
+ color: ${ props => transparentizeHex ( props . theme . colors . text , 0.5 ) } ;
22
25
` ;
23
26
24
27
export const TypeFormat = TypeName ;
@@ -29,7 +32,7 @@ export const RequiredLabel = styled(FieldLabel)`
29
32
font-weight: bold;
30
33
` ;
31
34
32
- export const CircularLabel = styled ( FieldLabel ) `
35
+ export const RecursiveLabel = styled ( FieldLabel ) `
33
36
color: #dd9900;
34
37
font-size: 13px;
35
38
` ;
Original file line number Diff line number Diff line change @@ -6,12 +6,13 @@ import { EnumValues } from './EnumValues';
6
6
import { FieldDetail } from './FieldDetail' ;
7
7
import { ConstraintsView } from './FieldContstraints' ;
8
8
import {
9
- CircularLabel ,
9
+ RecursiveLabel ,
10
10
NullableLabel ,
11
11
PatternLabel ,
12
12
RequiredLabel ,
13
13
TypeFormat ,
14
14
TypeName ,
15
+ TypeTitle ,
15
16
TypePrefix ,
16
17
} from '../../common-elements/fields' ;
17
18
@@ -34,11 +35,12 @@ export class FieldDetails extends React.PureComponent<FieldProps> {
34
35
{ schema . format } >
35
36
</ TypeFormat >
36
37
) }
38
+ { schema . title && < TypeTitle > ({ schema . title } ) </ TypeTitle > }
37
39
< ConstraintsView constraints = { schema . constraints } />
38
40
{ schema . nullable && < NullableLabel > Nullable </ NullableLabel > }
39
41
{ schema . pattern && < PatternLabel > { schema . pattern } </ PatternLabel > }
40
42
{ required && < RequiredLabel > Required </ RequiredLabel > }
41
- { schema . isCircular && < CircularLabel > Circular </ CircularLabel > }
43
+ { schema . isCircular && < RecursiveLabel > Recursive </ RecursiveLabel > }
42
44
</ div >
43
45
{ deprecated && (
44
46
< div >
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as React from 'react';
2
2
import { observer } from 'mobx-react' ;
3
3
4
4
import { FieldDetails } from '../Fields/FieldDetails' ;
5
- import { TypeName , CircularLabel } from '../../common-elements/fields' ;
5
+ import { RecursiveLabel , TypeName , TypeTitle } from '../../common-elements/fields' ;
6
6
7
7
import { SchemaModel } from '../../services/models' ;
8
8
@@ -28,7 +28,8 @@ export class Schema extends React.Component<Partial<SchemaProps>> {
28
28
return (
29
29
< div >
30
30
< TypeName > { schema . displayType } </ TypeName >
31
- < CircularLabel > Circular </ CircularLabel >
31
+ { schema . title && < TypeTitle > { schema . title } </ TypeTitle > }
32
+ < RecursiveLabel > Recursive </ RecursiveLabel >
32
33
</ div >
33
34
) ;
34
35
}
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export class SchemaModel {
100
100
this . pattern = schema . pattern ;
101
101
102
102
this . constraints = humanizeConstraints ( schema ) ;
103
- this . displayType = this . title === '' ? this . type : ` ${ this . title } ( ${ this . type } )` ;
103
+ this . displayType = this . type ;
104
104
this . isPrimitive = isPrimitiveType ( schema ) ;
105
105
this . default = schema . default ;
106
106
this . readOnly = ! ! schema . readOnly ;
You can’t perform that action at this time.
0 commit comments