Apply bootstrap theme to searchKit dashlets
authorColeman Watts <coleman@civicrm.org>
Wed, 10 Feb 2021 15:09:31 +0000 (10:09 -0500)
committerColeman Watts <coleman@civicrm.org>
Wed, 10 Feb 2021 15:09:31 +0000 (10:09 -0500)
CRM/Contact/Page/DashBoard.php
ext/search/ang/crmSearchDisplayList.ang.php
ext/search/ang/crmSearchDisplayTable.ang.php

index 07f6c78ea3f1177b03ff1ffecd626e8b72acb8d3..55d48127df4e22893194136b4234d7522fa70fc1 100644 (file)
@@ -79,7 +79,9 @@ class CRM_Contact_Page_DashBoard extends CRM_Core_Page {
     $partials = [];
     foreach (CRM_Core_BAO_Dashboard::getContactDashlets() as $dashlet) {
       if (!empty($dashlet['directive'])) {
-        $partials["~/$moduleName/directives/{$dashlet['directive']}.html"] = "<{$dashlet['directive']}></{$dashlet['directive']}>";
+        // FIXME: Wrapping each directive in <div id='bootstrap-theme'> produces invalid html (duplicate ids in the dom)
+        // but it's the only practical way to selectively apply boostrap3 theming to specific dashlets
+        $partials["~/$moduleName/directives/{$dashlet['directive']}.html"] = "<div id='bootstrap-theme'><{$dashlet['directive']}></{$dashlet['directive']}></div>";
       }
     }
     return $partials;
index 0538ee815ddb922c3ef3bb8514560c92b7fa4f69..62c961dee4fe933d9dbeccb0af29920b427a8bc4 100644 (file)
@@ -10,6 +10,7 @@ return [
   ],
   'basePages' => ['civicrm/search', 'civicrm/admin/search'],
   'requires' => ['crmSearchDisplay', 'crmUi', 'ui.bootstrap'],
+  'bundles' => ['bootstrap3'],
   'exports' => [
     'crm-search-display-list' => 'E',
   ],
index ea24b14ccc8ac18c58d8b151b5f0c7a177a9e869..b1c65325e147c1e6691eef01418645722edf1d03 100644 (file)
@@ -10,6 +10,7 @@ return [
   ],
   'basePages' => ['civicrm/search', 'civicrm/admin/search'],
   'requires' => ['crmSearchDisplay', 'crmUi', 'crmSearchActions', 'ui.bootstrap'],
+  'bundles' => ['bootstrap3'],
   'exports' => [
     'crm-search-display-table' => 'E',
   ],