From 77cdde52c11436cf0c86d6daa383e003c3d0a45b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 16 Mar 2022 11:11:21 -0400 Subject: [PATCH] SearchKit - Better default label for new displays --- .../ang/crmSearchAdmin/crmSearchAdmin.component.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js b/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js index 9feafb75ca..c368cfc3ac 100644 --- a/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js +++ b/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js @@ -135,10 +135,11 @@ }; this.addDisplay = function(type) { - var count = _.filter(ctrl.savedSearch.displays, {type: type}).length; + var count = _.filter(ctrl.savedSearch.displays, {type: type}).length, + searchLabel = ctrl.savedSearch.label || searchMeta.getEntity(ctrl.savedSearch.api_entity).title_plural; ctrl.savedSearch.displays.push({ type: type, - label: ctrl.displayTypes[type].label + (count ? ' ' + (++count) : '') + label: searchLabel + ' ' + ctrl.displayTypes[type].label + ' ' + (count + 1), }); $scope.selectTab('display_' + (ctrl.savedSearch.displays.length - 1)); }; -- 2.25.1