From 7534a33b2c49b78e7089aeb6dd2f0418a4f7985c Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Thu, 15 Feb 2024 18:07:13 +0100 Subject: [PATCH] Drop disable from order checkbox in Extended --- CHANGELOG.md | 1 + .../components/extended/standard_extended.js | 18 +++++------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a1a3a413..58095609b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Changed - The "in order" option is inverted, so it is now "in free order" and unchecked by default (but still `in_order` in the URL query param and in the API) +- The checkbox of said option no longer gets disabled in Extended mode ## [9.5.1] - 2024-02-12 diff --git a/app/scripts/components/extended/standard_extended.js b/app/scripts/components/extended/standard_extended.js index a7a3721c1..5caa70254 100644 --- a/app/scripts/components/extended/standard_extended.js +++ b/app/scripts/components/extended/standard_extended.js @@ -27,7 +27,7 @@ export const extendedStandardComponent = { on-search-save="$ctrl.onSearchSave(name)" disabled="$ctrl.repeatError || $ctrl.orderError" > - + {{'and' | loc:$root.lang}} {{'within' | loc:$root.lang}} @@ -49,15 +49,13 @@ export const extendedStandardComponent = { ctrl.lang = $rootScope.lang $scope.freeOrder = $location.search().in_order != null - /** Whether the "free order" option is applicable. */ - ctrl.freeOrderEnabled = true ctrl.orderError = false // TODO this is *too* weird function triggerSearch() { $location.search("search", null) $location.search("page", null) - $location.search("in_order", $scope.freeOrder && ctrl.freeOrderEnabled ? false : null) + $location.search("in_order", $scope.freeOrder ? false : null) $timeout(function () { $location.search("search", "cqp") if (!_.keys(settings["default_within"]).includes(ctrl.within)) { @@ -107,15 +105,9 @@ export const extendedStandardComponent = { /** Trigger error if the "free order" option is incompatible with the query */ ctrl.validateFreeOrder = () => { const cqpObjs = CQP.parse(ctrl.cqp) - if (!CQP.supportsInOrder(cqpObjs)) { - // If query doesn't support free word order, and the "free order" checkbox is checked, - // then disable search, show explanation and let user resolve the conflict - ctrl.orderError = $scope.freeOrder - ctrl.freeOrderEnabled = $scope.freeOrder - } else { - ctrl.orderError = false - ctrl.freeOrderEnabled = true - } + // If query doesn't support free word order, and the "free order" checkbox is checked, + // then show explanation and let user resolve the conflict + ctrl.orderError = !CQP.supportsInOrder(cqpObjs) && $scope.freeOrder } ctrl.cqp = $location.search().cqp