From: colemanw Date: Fri, 17 Nov 2023 14:04:37 +0000 (-0500) Subject: SearchKit - Fix wrong flags shown when switching field functions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=28a2891a5112f6ba250139016109f33d116e933f;p=civicrm-core.git SearchKit - Fix wrong flags shown when switching field functions --- 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 @@ - +