SearchKit - Default label when adding a display
authorColeman Watts <coleman@civicrm.org>
Tue, 2 Nov 2021 00:43:01 +0000 (20:43 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 2 Nov 2021 02:22:10 +0000 (22:22 -0400)
ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js

index 235e3d63046b81e56b79407793dfdc2dc7d461a6..8cbc6177805a6fadd6c728c10ad06f324fcd1ca3 100644 (file)
       };
 
       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));
       };