@@ -311,7 +311,6 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
311
311
this . isOneOf ,
312
312
this . isAllOf
313
313
) ;
314
- console . log ( "🚀 ~ PropertyShapeDocument ~ _rangeChanged ~ this.isComple:" , this . isComplex )
315
314
this . isScalarArray = this . isArray
316
315
? this . _computeIsScalarArray ( range )
317
316
: false ;
@@ -740,13 +739,24 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
740
739
> </ api-type-document > ` ;
741
740
}
742
741
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
+
743
753
/**
744
754
* @return {TemplateResult } Template for a type name label
745
755
*/
746
756
_getTypeNameTemplate ( ) {
747
- let dataType = this . propertyDataType ;
748
- const id = this . _targetTypeId ;
749
757
const { isScalarArray } = this ;
758
+ let { dataType} = this . _getTypeLabelData ( ) ;
759
+ const id = this . _targetTypeId ;
750
760
if ( id ) {
751
761
const label = this . _targetTypeName ;
752
762
return html `
@@ -782,6 +792,18 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
782
792
< div class ="fixed-type-size "> < span > Size: ${ size } </ span > </ div > ` ;
783
793
}
784
794
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
+
785
807
/**
786
808
* @return {TemplateResult | String } Template size value (only for async / avro)
787
809
*/
@@ -869,13 +891,9 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
869
891
displayName,
870
892
propertyName,
871
893
parentTypeName,
872
- hasParentTypeName,
873
- isComplex,
874
- avroValue
894
+ hasParentTypeName
875
895
} = this ;
876
- if ( ! hasDisplayName && ! propertyName && isComplex && avroValue ) {
877
- return html `< div class ="property-display-name "> ${ avroValue } </ div > `
878
- }
896
+
879
897
return html ` ${ hasDisplayName
880
898
? html `< div class ="property-display-name "> ${ displayName } </ div > `
881
899
: '' }
@@ -904,7 +922,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
904
922
avroValue,
905
923
_renderToggleButton
906
924
} = this ;
907
- if ( ! hasDisplayName && ! propertyName && isComplex && ! avroValue && _renderToggleButton ) {
925
+ if ( ! hasDisplayName && ! propertyName && isComplex && avroValue && _renderToggleButton ) {
908
926
return ' no-name'
909
927
}
910
928
return ''
@@ -942,6 +960,7 @@ export class PropertyShapeDocument extends PropertyDocumentMixin(LitElement) {
942
960
> `
943
961
: '' }
944
962
</ div >
963
+ ${ this . _getCustomAvroValueTemplate ( ) }
945
964
${ this . _getDefaultValueAvroTemplate ( ) }
946
965
${ this . _getFixedTypeSizeAvroTemplate ( ) }
947
966
${ this . _getTypeNamespaceAvroTemplate ( ) }
0 commit comments