File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed
Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1+ ## [ 0.0.11] - 2025-04-08
2+
3+ - Print out stringified errors for unexpected errors
4+ - Cast e.target.value with parseInt/parseFloat when appropriate
5+
16## [ 0.0.10] - 2025-04-08
27
38- Do not double up hashes on Outcome import
Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- foobara-typescript-react-command-form-generator (0.0.10 )
4+ foobara-typescript-react-command-form-generator (0.0.11 )
55 foobara-typescript-remote-command-generator (~> 0.0.1 )
66
77GEM
1414 diff-lcs (1.6.1 )
1515 docile (1.4.1 )
1616 ffi (1.17.1-x86_64-linux-gnu )
17- foobara (0.0.95 )
17+ foobara (0.0.96 )
1818 bigdecimal
1919 foobara-lru-cache (~> 0.0.2 )
2020 foobara-util (~> 0.0.11 )
Original file line number Diff line number Diff line change @@ -242,10 +242,23 @@ def html_input
242242 #{ one_of . map { |value | "<option value=\" #{ value } \" >#{ value } </option>" } . join }
243243 </select>"
244244 else
245+ type = type_declaration . to_type
246+
247+ cast_value = if type . name . to_s == "integer" || type . extends_symbol? ( :integer )
248+ "parseInt(e.target.value)"
249+ elsif type . name . to_s == "float" || type . extends_symbol? ( :float )
250+ # TODO: test this path
251+ # :nocov:
252+ "parseFloat(e.target.value)"
253+ # :nocov:
254+ else
255+ "e.target.value"
256+ end
257+
245258 "<input
246259 #{ "type=\" password\" " if sensitive? }
247260 value={#{ name } ?? \" \" }
248- onChange={(e) => { set#{ name_upcase } (e.target.value ) }}
261+ onChange={(e) => { set#{ name_upcase } (#{ cast_value } ) }}
249262 placeholder=\" #{ name_english } \"
250263 />"
251264 end
Original file line number Diff line number Diff line change 11module Foobara
22 module Generators
33 module TypescriptReactCommandFormGenerator
4- VERSION = "0.0.10 " . freeze
4+ VERSION = "0.0.11 " . freeze
55
66 local_ruby_version = File . read ( "#{ __dir__ } /.ruby-version" ) . chomp
77 local_ruby_version_minor = local_ruby_version [ /\A (\d +\. \d +)\. \d +\z / , 1 ]
You can’t perform that action at this time.
0 commit comments