From 72f9da3ac4484ab5ad7ca8bb41630bed03fa5529 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 28 Mar 2020 15:44:27 +0100 Subject: [PATCH] Fix regex validation and HTML "type" settings not allowing decimals for final_weight_volume `final_weight_volume` can be a decimal, and often *is* in production data. Not regarding them as valid was breaking the form submission in various cases --- app/views/spree/admin/orders/bulk_management.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index f690e5c799..01d3c70216 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -175,7 +175,7 @@ %span.error{ ng: { bind: 'line_item.errors.quantity' } } %td.max{ 'ng-show' => 'columns.max.visible' } {{ line_item.max_quantity }} %td.final_weight_volume{ 'ng-show' => 'columns.final_weight_volume.visible' } - %input.show-dirty{ :type => 'number', :name => 'final_weight_volume', :id => 'final_weight_volume', ng: { model: "line_item.final_weight_volume", readonly: "unitValueLessThanZero(line_item)", change: "weightAdjustedPrice(line_item)", required: "true", class: '{"update-error": line_item.errors.final_weight_volume}' }, min: 0, 'ng-pattern' => '/[1-9]+/' } + %input.show-dirty{ type: 'number', step: 'any', :name => 'final_weight_volume', :id => 'final_weight_volume', ng: { model: "line_item.final_weight_volume", readonly: "unitValueLessThanZero(line_item)", change: "weightAdjustedPrice(line_item)", required: "true", class: '{"update-error": line_item.errors.final_weight_volume}' }, min: 0, 'ng-pattern' => '/[0-9]*[.]?[0-9]+/' } %span.error{ ng: { bind: 'line_item.errors.final_weight_volume' } } %td.price{ 'ng-show' => 'columns.price.visible' } %input.show-dirty{ :type => 'text', :name => 'price', :id => 'price', :ng => { value: 'line_item.price * line_item.quantity | currency:""', readonly: "true", class: '{"update-error": line_item.errors.price}' } }