Change checkbox confirmation behaviour

This commit is contained in:
Matt-Yorkley
2018-02-23 14:05:08 +00:00
parent 58e9f0266a
commit c5b7cec19f
2 changed files with 4 additions and 5 deletions

View File

@@ -27,12 +27,11 @@ angular.module("admin.productImport").controller "ImportOptionsFormCtrl", ($scop
$scope.toggleResetAbsent = (id) ->
checked = $scope.settings[id]['reset_all_absent']
confirmed = confirm t('js.product_import.confirmation') if resetAbsent
confirmed = confirm t('js.product_import.confirmation') if checked
if confirmed or !checked
ProductImportService.updateResetAbsent($scope.supplierId, $scope.reset_counts[$scope.supplierId], resetAbsent)
if !confirmed and checked
ProductImportService.updateResetAbsent($scope.supplierId, $scope.reset_counts[$scope.supplierId], checked)
else
$scope.settings[id]['reset_all_absent'] = false
$scope.resetTotal = ProductImportService.resetTotal

View File

@@ -5,7 +5,7 @@ module Admin
before_filter :validate_upload_presence, except: %i[index guide validate_data]
def guide
@product_categories = Spree::Taxon.order('name ASC').pluck(:name)
@product_categories = Spree::Taxon.order('name ASC').pluck(:name).uniq
@tax_categories = Spree::TaxCategory.order('name ASC').pluck(:name)
@shipping_categories = Spree::ShippingCategory.order('name ASC').pluck(:name)
end