From 6f0c7312d730d011cf93d03cd6174e6d3f6e0db8 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 1 Nov 2021 20:43:01 -0400 Subject: [PATCH] SearchKit - Default label when adding a display --- ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js b/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js index 235e3d6304..8cbc617780 100644 --- a/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js +++ b/ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js @@ -140,9 +140,10 @@ }; this.addDisplay = function(type) { + var count = _.filter(ctrl.savedSearch.displays, {type: type}).length; ctrl.savedSearch.displays.push({ type: type, - label: '' + label: ctrl.displayTypes[type].label + (count ? ' ' + (++count) : '') }); $scope.selectTab('display_' + (ctrl.savedSearch.displays.length - 1)); }; -- 2.25.1