mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Re-add changes to variant bulk show to fix 'I'm a teapot' fails
This commit is contained in:
@@ -259,11 +259,11 @@ productEditModule.controller "AdminProductEditCtrl", [
|
||||
$scope.addVariant = (product) ->
|
||||
product.variants.push
|
||||
id: $scope.nextVariantId()
|
||||
price: null
|
||||
unit_value: null
|
||||
unit_description: null
|
||||
on_demand: false
|
||||
on_hand: null
|
||||
price: null
|
||||
$scope.displayProperties[product.id].showVariants = true
|
||||
|
||||
|
||||
@@ -358,7 +358,6 @@ productEditModule.controller "AdminProductEditCtrl", [
|
||||
# conflicted with some changes I made before merging my work, so for now I've reverted to the old way of
|
||||
# doing things. TODO: Review together and decide on strategy here. -- Rohan, 14-1-2014
|
||||
#if subset($scope.productsWithoutDerivedAttributes(), data)
|
||||
|
||||
if $scope.productListsMatch $scope.products, data
|
||||
$scope.resetProducts data
|
||||
$timeout -> $scope.displaySuccess()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
object @variant
|
||||
|
||||
attributes :id, :price, :options_text, :unit_value, :unit_description, :on_demand
|
||||
attributes :id, :options_text, :unit_value, :unit_description, :on_demand
|
||||
|
||||
# Infinity is not a valid JSON object, but Rails encodes it anyway
|
||||
node( :on_hand ) { |v| v.on_hand.to_f.finite? ? v.on_hand : "On demand" }
|
||||
node( :on_hand ) { |v| v.on_hand.nil? ? 0 : ( v.on_hand.to_f.finite? ? v.on_hand : "On demand" ) }
|
||||
node( :price ) { |v| v.price.nil? ? 0.to_f : v.price }
|
||||
Reference in New Issue
Block a user