diff --git a/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php b/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php
index f6957086d079..b41452d6e55a 100644
--- a/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php
+++ b/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php
@@ -306,10 +306,8 @@ protected function getCssStyles(array $styleRules, array $data) {
*/
protected function getCssRuleCondition($clause) {
$fieldKey = $clause[1] ?? NULL;
- // For fields used in group by, add aggregation and change operator from = to CONTAINS
- // FIXME: This assumes the operator is always set to '=', which so far is all the admin UI supports.
- // That's only a safe assumption as long as the admin UI doesn't have an operator selector.
- // @see ang/crmSearchAdmin/displays/common/searchAdminCssRules.html
+ // For fields used in group by, add aggregation and change operator to CONTAINS
+ // NOTE: This doesn't support any other operators for aggregated fields.
if ($fieldKey && $this->canAggregate($fieldKey)) {
$clause[2] = 'CONTAINS';
$fieldKey = 'GROUP_CONCAT_' . str_replace(['.', ':'], '_', $clause[1]);
diff --git a/ext/search_kit/ang/crmSearchAdmin.module.js b/ext/search_kit/ang/crmSearchAdmin.module.js
index 7edab31d64fa..c0e2f53c56d9 100644
--- a/ext/search_kit/ang/crmSearchAdmin.module.js
+++ b/ext/search_kit/ang/crmSearchAdmin.module.js
@@ -184,7 +184,7 @@
}
// Might be a pseudoField
if (!field) {
- field = _.cloneDeep(_.find(CRM.crmSearchAdmin.pseudoFields, {name: name}));
+ field = _.find(CRM.crmSearchAdmin.pseudoFields, {name: name});
}
if (field) {
field.baseEntity = entityName;
diff --git a/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminCssRules.component.js b/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminCssRules.component.js
index b19ade12fd40..40163abb7d8e 100644
--- a/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminCssRules.component.js
+++ b/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminCssRules.component.js
@@ -28,7 +28,10 @@
this.styles.strikethrough = ts('Strikethrough');
this.fields = function() {
- return {results: ctrl.crmSearchAdmin.getAllFields(':name', ['Field', 'Custom', 'Extra'])};
+ var allFields = ctrl.crmSearchAdmin.getAllFields(':name', ['Field', 'Custom', 'Extra', 'Pseudo']);
+ return {
+ results: ctrl.crmSearchAdmin.getSelectFields().concat(allFields)
+ };
};
this.$onInit = function() {
@@ -61,8 +64,7 @@
return !this.item.cssRules || !this.item.cssRules.length || _.last(this.item.cssRules)[1];
};
-
-
+ this.operators = CRM.crmSearchAdmin.operators;
}
});
diff --git a/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminCssRules.html b/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminCssRules.html
index cf9e7db74559..6b6d573bbe8d 100644
--- a/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminCssRules.html
+++ b/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminCssRules.html
@@ -22,9 +22,9 @@
-
-
-
+
+