Rename product_stock_display to product_low_stock_display

Rename product_stock_display to product_low_stock_display in enterprise_serializer and shop_variant_controller
This commit is contained in:
Nihal Mohammed
2022-04-12 12:46:52 +05:30
committed by Maikel Linke
parent 66386683b6
commit 15e7a5a4df
7 changed files with 10 additions and 10 deletions

View File

@@ -71,4 +71,4 @@ angular.module('Darkswarm').controller "ShopVariantCtrl", ($scope, $modal, Cart,
$modal.open(templateUrl: "bulk_buy_modal.html", scope: $scope, windowClass: "product-bulk-modal")
$scope.displayRemainingInStock = ->
Shopfront.shopfront.preferred_product_stock_display && $scope.available() <= 3 && !$scope.variant.line_item.quantity
Shopfront.shopfront.preferred_product_low_stock_display && $scope.available() <= 3 && !$scope.variant.line_item.quantity

View File

@@ -20,7 +20,7 @@ class Enterprise < ApplicationRecord
preference :shopfront_order_cycle_order, :string, default: "orders_close_at"
preference :shopfront_product_sorting_method, :string, default: "by_category"
preference :invoice_order_by_supplier, :boolean, default: false
preference :product_stock_display, :boolean, default: false
preference :product_low_stock_display, :boolean, default: false
# Allow hubs to restrict visible variants to only those in their inventory
preference :product_selection_from_inventory_only, :boolean, default: false

View File

@@ -14,7 +14,7 @@ module Api
:logo, :promo_image, :terms_and_conditions,
:terms_and_conditions_file_name, :terms_and_conditions_updated_at,
:preferred_invoice_order_by_supplier,
:preferred_product_stock_display
:preferred_product_low_stock_display
has_one :owner, serializer: Api::Admin::UserSerializer
has_many :users, serializer: Api::Admin::UserSerializer

View File

@@ -9,7 +9,7 @@ module Api
:instagram, :linkedin, :twitter, :facebook, :is_primary_producer, :is_distributor,
:phone, :visible, :email_address, :hash, :logo, :promo_image, :path, :category,
:active, :producers, :orders_close_at, :hubs, :taxons, :supplied_taxons, :pickup,
:delivery, :preferred_product_stock_display
:delivery, :preferred_product_low_stock_display
has_one :address, serializer: Api::AddressSerializer
has_many :supplied_properties, serializer: Api::PropertySerializer

View File

@@ -34,7 +34,7 @@ module PermittedAttributes
:preferred_shopfront_producer_order, :preferred_shopfront_order_cycle_order,
:show_customer_names_to_suppliers, :preferred_shopfront_product_sorting_method,
:preferred_invoice_order_by_supplier,
:preferred_product_stock_display
:preferred_product_low_stock_display
]
end
end

View File

@@ -78,11 +78,11 @@
%div{'ofn-with-tip' => t('.display_remaining_stock_tip')}
%a= t 'admin.whats_this'
.three.columns
= f.radio_button :preferred_product_stock_display, true, 'ng-model' => 'Enterprise.preferred_product_stock_display', 'ng-value' => 'true'
= f.label :preferred_product_stock_display, t('.enabled'), value: :true
= f.radio_button :preferred_product_low_stock_display, true, 'ng-model' => 'Enterprise.preferred_product_low_stock_display', 'ng-value' => 'true'
= f.label :preferred_product_low_stock_display, t('.enabled'), value: :true
.five.columns.omega
= f.radio_button :preferred_product_stock_display, false, 'ng-model' => 'Enterprise.preferred_product_stock_display', 'ng-value' => 'false'
= f.label :preferred_product_stock_display, t('.disabled'), value: :false
= f.radio_button :preferred_product_low_stock_display, false, 'ng-model' => 'Enterprise.preferred_product_low_stock_display', 'ng-value' => 'false'
= f.label :preferred_product_low_stock_display, t('.disabled'), value: :false
.row
.three.columns.alpha

View File

@@ -377,7 +377,7 @@ describe "As a consumer I want to shop with a distributor", js: true do
end
it "shows quantity of remaining stock for products with quantity less < 3 when product_stock_display is true" do
distributor.set_preference(:product_stock_display, true)
distributor.set_preference(:product_low_stock_display, true)
variant.update on_hand: 2
visit shop_path