Allow reset of "on demand" for variant overrides

Change the UI control for "on demand" in the Inventory page from a
checkbox to a SELECT field with three options: nil, true, and false.

This resolves the following issues:
* There is no way to tell between nil and false - both are represented
by an unticked checkbox.
* There is no way to go back to nil.
This commit is contained in:
Kristina Lim
2018-11-21 23:28:34 +08:00
parent 3b56212290
commit 4b3198a2b4
4 changed files with 39 additions and 5 deletions

View File

@@ -13,6 +13,10 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl",
$scope.RequestMonitor = RequestMonitor
$scope.selectView = Views.selectView
$scope.currentView = -> Views.currentView
$scope.onDemandOptions = [
{ description: t('js.yes'), value: true },
{ description: t('js.no'), value: false }
]
$scope.views = Views.setViews
inventory: { name: t('js.variant_overrides.inventory_products'), visible: true }