From 28a2891a5112f6ba250139016109f33d116e933f Mon Sep 17 00:00:00 2001 From: colemanw Date: Fri, 17 Nov 2023 09:04:37 -0500 Subject: [PATCH] SearchKit - Fix wrong flags shown when switching field functions --- .../ang/crmSearchAdmin/crmSearchFunctionFlag.component.js | 8 ++++---- .../ang/crmSearchAdmin/crmSearchFunctionFlag.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/search_kit/ang/crmSearchAdmin/crmSearchFunctionFlag.component.js b/ext/search_kit/ang/crmSearchAdmin/crmSearchFunctionFlag.component.js index ee6948ada5..24db599dd3 100644 --- a/ext/search_kit/ang/crmSearchAdmin/crmSearchFunctionFlag.component.js +++ b/ext/search_kit/ang/crmSearchAdmin/crmSearchFunctionFlag.component.js @@ -13,13 +13,13 @@ var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'), ctrl = this; - this.$onInit = function() { + this.getWidget = function() { if (!ctrl.param || !ctrl.param[ctrl.flag]) { - this.widget = null; + return null; } else if (_.keys(ctrl.param[ctrl.flag]).length === 2 && '' in ctrl.param[ctrl.flag]) { - this.widget = 'checkbox'; + return 'checkbox'; } else { - this.widget = 'select'; + return 'select'; } }; } diff --git a/ext/search_kit/ang/crmSearchAdmin/crmSearchFunctionFlag.html b/ext/search_kit/ang/crmSearchAdmin/crmSearchFunctionFlag.html index f2227e5eed..32a126b0fd 100644 --- a/ext/search_kit/ang/crmSearchAdmin/crmSearchFunctionFlag.html +++ b/ext/search_kit/ang/crmSearchAdmin/crmSearchFunctionFlag.html @@ -1,4 +1,4 @@ - +