@@ -311,7 +311,6 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
311311 this . isOneOf ,
312312 this . isAllOf
313313 ) ;
314- console . log ( "🚀 ~ PropertyShapeDocument ~ _rangeChanged ~ this.isComple:" , this . isComplex )
315314 this . isScalarArray = this . isArray
316315 ? this . _computeIsScalarArray ( range )
317316 : false ;
@@ -740,13 +739,24 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
740739 > </ api-type-document > ` ;
741740 }
742741
742+ _getTypeLabelData ( ) {
743+ const { propertyDataType, avroValue } = this ;
744+ if ( avroValue === 'map' ) {
745+ return { dataType :'Map' , customValue :false }
746+ }
747+ if ( propertyDataType === 'Unknown type' && avroValue ) {
748+ return { dataType :avroValue , customValue :true }
749+ }
750+ return { dataType :propertyDataType , customValue :false }
751+ }
752+
743753 /**
744754 * @return {TemplateResult } Template for a type name label
745755 */
746756 _getTypeNameTemplate ( ) {
747- let dataType = this . propertyDataType ;
748- const id = this . _targetTypeId ;
749757 const { isScalarArray } = this ;
758+ let { dataType} = this . _getTypeLabelData ( ) ;
759+ const id = this . _targetTypeId ;
750760 if ( id ) {
751761 const label = this . _targetTypeName ;
752762 return html `
@@ -782,6 +792,18 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
782792 < div class ="fixed-type-size "> < span > Size: ${ size } </ span > </ div > ` ;
783793 }
784794
795+ /**
796+ * @return {TemplateResult | String } Template size value (only for async / avro)
797+ */
798+ _getCustomAvroValueTemplate ( ) {
799+ const { customValue} = this . _getTypeLabelData ( )
800+ if ( ! customValue ) {
801+ return ''
802+ }
803+ return html `
804+ < div class ="fixed-type-size "> < span > This is a custom avro value</ span > </ div > ` ;
805+ }
806+
785807 /**
786808 * @return {TemplateResult | String } Template size value (only for async / avro)
787809 */
@@ -869,13 +891,9 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
869891 displayName,
870892 propertyName,
871893 parentTypeName,
872- hasParentTypeName,
873- isComplex,
874- avroValue
894+ hasParentTypeName
875895 } = this ;
876- if ( ! hasDisplayName && ! propertyName && isComplex && avroValue ) {
877- return html `< div class ="property-display-name "> ${ avroValue } </ div > `
878- }
896+
879897 return html ` ${ hasDisplayName
880898 ? html `< div class ="property-display-name "> ${ displayName } </ div > `
881899 : '' }
@@ -904,7 +922,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
904922 avroValue,
905923 _renderToggleButton
906924 } = this ;
907- if ( ! hasDisplayName && ! propertyName && isComplex && ! avroValue && _renderToggleButton ) {
925+ if ( ! hasDisplayName && ! propertyName && isComplex && avroValue && _renderToggleButton ) {
908926 return ' no-name'
909927 }
910928 return ''
@@ -942,6 +960,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
942960 > `
943961 : '' }
944962 </ div >
963+ ${ this . _getCustomAvroValueTemplate ( ) }
945964 ${ this . _getDefaultValueAvroTemplate ( ) }
946965 ${ this . _getFixedTypeSizeAvroTemplate ( ) }
947966 ${ this . _getTypeNamespaceAvroTemplate ( ) }
0 commit comments