@@ -51,9 +51,12 @@ export default class Models extends Component {
5151 </ h4 >
5252 < Collapse isOpened = { showModels } >
5353 {
54- definitions . entrySeq ( ) . map ( ( [ name ] ) => {
54+ definitions . entrySeq ( ) . map ( ( [ name ] ) => {
5555
56- const schema = specSelectors . specResolvedSubtree ( [ ...specPathBase , name ] )
56+ const fullPath = [ ...specPathBase , name ]
57+ const schema = specSelectors . specResolvedSubtree ( fullPath ) || Im . Map ( )
58+ const rawSchema = specSelectors . specJson ( ) . getIn ( fullPath , Im . Map ( ) )
59+ const displayName = schema . get ( "title" ) || rawSchema . get ( "title" ) || name
5760
5861 if ( layoutSelectors . isShown ( [ "models" , name ] , false ) && schema === undefined ) {
5962 // Firing an action in a container render is not great,
@@ -63,7 +66,8 @@ export default class Models extends Component {
6366
6467 const content = < ModelWrapper name = { name }
6568 expandDepth = { defaultModelsExpandDepth }
66- schema = { schema || Im . Map ( ) }
69+ schema = { schema || Im . Map ( ) }
70+ displayName = { displayName }
6771 specPath = { Im . List ( [ ...specPathBase , name ] ) }
6872 getComponent = { getComponent }
6973 specSelectors = { specSelectors }
@@ -72,7 +76,9 @@ export default class Models extends Component {
7276 layoutActions = { layoutActions } />
7377
7478 const title = < span className = "model-box" >
75- < span className = "model model-title" > { name } </ span >
79+ < span className = "model model-title" >
80+ { displayName }
81+ </ span >
7682 </ span >
7783
7884 return < div id = { `model-${ name } ` } className = "model-container" key = { `models-section-${ name } ` } >
@@ -81,6 +87,7 @@ export default class Models extends Component {
8187 collapsedContent = { this . getCollapsedContent ( name ) }
8288 onToggle = { this . handleToggle }
8389 title = { title }
90+ displayName = { displayName }
8491 modelName = { name }
8592 hideSelfOnExpand = { true }
8693 expanded = { defaultModelsExpandDepth > 1 }
0 commit comments