@@ -51,6 +51,13 @@ export const REGEX_TOOLTIP =
5151export const JSON_TOOLTIP =
5252 'JsonPath expression that returns a singular value expected. See http://jsonpath.com for more info.'
5353
54+ const stringType = 'String'
55+ const floatType = 'Float'
56+ const intType = 'Integer'
57+ const booleanType = 'Boolean'
58+
59+ export const dataTypeList = [ stringType , intType , floatType , booleanType ]
60+
5461export const handleValidation = (
5562 property : string ,
5663 formVal : string
@@ -89,8 +96,8 @@ export const sanitizeForm = (form: Subscription): Subscription => {
8996 form . jsonMeasurementKey . path = newVal
9097 }
9198 }
92- if ( form . jsonMeasurementKey . type === 'number ' ) {
93- form . jsonMeasurementKey . type = 'double '
99+ if ( form . jsonMeasurementKey . type === 'integer ' ) {
100+ form . jsonMeasurementKey . type = 'int '
94101 }
95102
96103 if ( form . jsonFieldKeys ) {
@@ -100,8 +107,8 @@ export const sanitizeForm = (form: Subscription): Subscription => {
100107 if ( newVal ) {
101108 f . path = newVal
102109 }
103- if ( f . type === 'number ' ) {
104- f . type = 'double '
110+ if ( f . type === 'integer ' ) {
111+ f . type = 'int '
105112 }
106113 } )
107114 }
@@ -112,8 +119,8 @@ export const sanitizeForm = (form: Subscription): Subscription => {
112119 if ( newVal ) {
113120 t . path = newVal
114121 }
115- if ( t . type === 'number ' ) {
116- t . type = 'double '
122+ if ( t . type === 'integer ' ) {
123+ t . type = 'int '
117124 }
118125 } )
119126 }
@@ -139,8 +146,8 @@ export const sanitizeUpdateForm = (form: Subscription): Subscription => {
139146 form . jsonMeasurementKey . path = newVal
140147 }
141148 }
142- if ( form . jsonMeasurementKey . type === 'number ' ) {
143- form . jsonMeasurementKey . type = 'double '
149+ if ( form . jsonMeasurementKey . type === 'integer ' ) {
150+ form . jsonMeasurementKey . type = 'int '
144151 }
145152 if ( form . jsonFieldKeys ) {
146153 form . jsonFieldKeys . map ( f => {
@@ -149,8 +156,8 @@ export const sanitizeUpdateForm = (form: Subscription): Subscription => {
149156 if ( newVal ) {
150157 f . path = newVal
151158 }
152- if ( f . type === 'number ' ) {
153- f . type = 'double '
159+ if ( f . type === 'integer ' ) {
160+ f . type = 'int '
154161 }
155162 } )
156163 }
@@ -161,8 +168,8 @@ export const sanitizeUpdateForm = (form: Subscription): Subscription => {
161168 if ( newVal ) {
162169 t . path = newVal
163170 }
164- if ( t . type === 'number ' ) {
165- t . type = 'double '
171+ if ( t . type === 'integer ' ) {
172+ t . type = 'int '
166173 }
167174 } )
168175 }
@@ -196,7 +203,10 @@ export const sanitizeUpdateForm = (form: Subscription): Subscription => {
196203
197204export const sanitizeType = ( type : string ) : string => {
198205 if ( type === 'double' ) {
199- type = 'Number'
206+ type = 'Float'
207+ }
208+ if ( type === 'int' ) {
209+ type = 'Integer'
200210 }
201211 return type . charAt ( 0 ) . toUpperCase ( ) + type . slice ( 1 )
202212}
0 commit comments