From bca4106f6e22869309078f80fed5ce4eb4f9c967 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 25 Nov 2020 10:13:32 -0500 Subject: [PATCH] Decouple crmD3 angular module from CiviMail The crmD3 module was being conditionally loaded based on whether CiviMail was enabled. This changes it to always exist but only loaded as required. --- CRM/Mailing/Info.php | 1 - Civi/Angular/Manager.php | 1 + ang/crmD3.ang.php | 8 ++------ ang/crmMailing.ang.php | 1 - ang/crmMailingAB.ang.php | 1 - 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CRM/Mailing/Info.php b/CRM/Mailing/Info.php index fa647e4679cd..d26c57dc9930 100644 --- a/CRM/Mailing/Info.php +++ b/CRM/Mailing/Info.php @@ -157,7 +157,6 @@ public function getAngularModules() { $result = []; $result['crmMailing'] = include "$civicrm_root/ang/crmMailing.ang.php"; $result['crmMailingAB'] = include "$civicrm_root/ang/crmMailingAB.ang.php"; - $result['crmD3'] = include "$civicrm_root/ang/crmD3.ang.php"; return $result; } diff --git a/Civi/Angular/Manager.php b/Civi/Angular/Manager.php index d19c8c328ee5..5f64eed33653 100644 --- a/Civi/Angular/Manager.php +++ b/Civi/Angular/Manager.php @@ -123,6 +123,7 @@ public function getModules() { $angularModules['api4Explorer'] = include "$civicrm_root/ang/api4Explorer.ang.php"; $angularModules['api4'] = include "$civicrm_root/ang/api4.ang.php"; $angularModules['crmDashboard'] = include "$civicrm_root/ang/crmDashboard.ang.php"; + $angularModules['crmD3'] = include "$civicrm_root/ang/crmD3.ang.php"; foreach (\CRM_Core_Component::getEnabledComponents() as $component) { $angularModules = array_merge($angularModules, $component->getAngularModules()); diff --git a/ang/crmD3.ang.php b/ang/crmD3.ang.php index 0a737341ae81..c95c53fd106f 100644 --- a/ang/crmD3.ang.php +++ b/ang/crmD3.ang.php @@ -1,13 +1,9 @@ 'civicrm', + 'basePages' => [], 'js' => [ 'ang/crmD3.js', 'bower_components/d3/d3.min.js', diff --git a/ang/crmMailing.ang.php b/ang/crmMailing.ang.php index a91d49522114..091ecfda87b9 100644 --- a/ang/crmMailing.ang.php +++ b/ang/crmMailing.ang.php @@ -4,7 +4,6 @@ // http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_angularModules // ODDITY: Only loads if you have CiviMail permissions. -// ODDITY: Extra resources loaded via CRM_Mailing_Info::getAngularModules. return [ 'ext' => 'civicrm', diff --git a/ang/crmMailingAB.ang.php b/ang/crmMailingAB.ang.php index 6741399ebc9a..b8db8b6cb86e 100644 --- a/ang/crmMailingAB.ang.php +++ b/ang/crmMailingAB.ang.php @@ -4,7 +4,6 @@ // http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_angularModules // ODDITY: Only loads if you have CiviMail permissions. -// ODDITY: Extra resources loaded via CRM_Mailing_Info::getAngularModules. return [ 'ext' => 'civicrm',