From: colemanw Date: Tue, 7 Nov 2023 20:51:22 +0000 (-0500) Subject: Angular - cleanup core angular module declarations X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f81706e5a96909a6ccc8726ba9e966bb323e9edd;p=civicrm-core.git Angular - cleanup core angular module declarations --- diff --git a/CRM/Case/Info.php b/CRM/Case/Info.php index bd4037ceff..7f1e548c48 100644 --- a/CRM/Case/Info.php +++ b/CRM/Case/Info.php @@ -40,17 +40,6 @@ class CRM_Case_Info extends CRM_Core_Component_Info { ]; } - /** - * @inheritDoc - */ - public function getAngularModules() { - global $civicrm_root; - - $result = []; - $result['crmCaseType'] = include "$civicrm_root/ang/crmCaseType.ang.php"; - return $result; - } - /** * @inheritDoc * @param bool $getAllUnconditionally diff --git a/CRM/Core/Component/Info.php b/CRM/Core/Component/Info.php index 037b3cea0e..328f62d28a 100644 --- a/CRM/Core/Component/Info.php +++ b/CRM/Core/Component/Info.php @@ -110,17 +110,6 @@ abstract class CRM_Core_Component_Info { $this->info['url'] = $this->getKeyword(); } - /** - * EXPERIMENTAL: Get a list of AngularJS modules - * - * @return array - * list of modules; same format as CRM_Utils_Hook::angularModules(&$angularModules) - * @see CRM_Utils_Hook::angularModules - */ - public function getAngularModules() { - return []; - } - /** * Name of the module-extension coupled with this component * @return string diff --git a/CRM/Mailing/Info.php b/CRM/Mailing/Info.php index 2eec29a438..b3f0c3371c 100644 --- a/CRM/Mailing/Info.php +++ b/CRM/Mailing/Info.php @@ -129,23 +129,6 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info { ]; } - /** - * Get AngularJS modules and their dependencies. - * - * @return array - * list of modules; same format as CRM_Utils_Hook::angularModules(&$angularModules) - * @see CRM_Utils_Hook::angularModules - */ - public function getAngularModules() { - global $civicrm_root; - - $result = []; - $result['crmMailing'] = include "$civicrm_root/ang/crmMailing.ang.php"; - $result['crmMailingAB'] = include "$civicrm_root/ang/crmMailingAB.ang.php"; - - return $result; - } - /** * @return bool */ diff --git a/Civi/Angular/Manager.php b/Civi/Angular/Manager.php index f2ea6b514f..ac02fd054b 100644 --- a/Civi/Angular/Manager.php +++ b/Civi/Angular/Manager.php @@ -81,42 +81,18 @@ class Manager { $angularModules = []; // Cache not set, fetch fresh list of modules and store in cache if (!$moduleNames) { - $config = \CRM_Core_Config::singleton(); - global $civicrm_root; - - // Note: It would be nice to just glob("$civicrm_root/ang/*.ang.php"), but at time - // of writing CiviMail and CiviCase have special conditionals. - $angularModules['angularFileUpload'] = include "$civicrm_root/ang/angularFileUpload.ang.php"; - $angularModules['checklist-model'] = include "$civicrm_root/ang/checklist-model.ang.php"; - $angularModules['crmApp'] = include "$civicrm_root/ang/crmApp.ang.php"; - $angularModules['crmAttachment'] = include "$civicrm_root/ang/crmAttachment.ang.php"; - $angularModules['crmAutosave'] = include "$civicrm_root/ang/crmAutosave.ang.php"; - $angularModules['crmCxn'] = include "$civicrm_root/ang/crmCxn.ang.php"; - $angularModules['crmDialog'] = include "$civicrm_root/ang/crmDialog.ang.php"; - $angularModules['crmMonaco'] = include "$civicrm_root/ang/crmMonaco.ang.php"; - $angularModules['crmResource'] = include "$civicrm_root/ang/crmResource.ang.php"; - $angularModules['crmRouteBinder'] = include "$civicrm_root/ang/crmRouteBinder.ang.php"; - $angularModules['crmUi'] = include "$civicrm_root/ang/crmUi.ang.php"; - $angularModules['crmUtil'] = include "$civicrm_root/ang/crmUtil.ang.php"; - $angularModules['dialogService'] = include "$civicrm_root/ang/dialogService.ang.php"; - $angularModules['jsonFormatter'] = include "$civicrm_root/ang/jsonFormatter.ang.php"; - $angularModules['ngRoute'] = include "$civicrm_root/ang/ngRoute.ang.php"; - $angularModules['ngSanitize'] = include "$civicrm_root/ang/ngSanitize.ang.php"; - $angularModules['ui.bootstrap'] = include "$civicrm_root/ang/ui.bootstrap.ang.php"; - $angularModules['ui.sortable'] = include "$civicrm_root/ang/ui.sortable.ang.php"; - $angularModules['unsavedChanges'] = include "$civicrm_root/ang/unsavedChanges.ang.php"; - $angularModules['crmQueueMonitor'] = include "$civicrm_root/ang/crmQueueMonitor.ang.php"; - $angularModules['crmStatusPage'] = include "$civicrm_root/ang/crmStatusPage.ang.php"; - $angularModules['exportui'] = include "$civicrm_root/ang/exportui.ang.php"; - $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()); + // Load all modules from CiviCRM core + $files = (array) glob(\Civi::paths()->getPath('[civicrm.root]/ang/*.ang.php')); + foreach ($files as $file) { + $name = basename($file, '.ang.php'); + $module = include $file; + $module['ext'] = 'civicrm'; + $angularModules[$name] = $module; } + + // Load all modules from extensions \CRM_Utils_Hook::angularModules($angularModules); + foreach ($angularModules as $module => $info) { // Merge in defaults $angularModules[$module] += ['basePages' => ['civicrm/a']]; diff --git a/ang/crmCaseType.ang.php b/ext/civi_case/ang/crmCaseType.ang.php similarity index 60% rename from ang/crmCaseType.ang.php rename to ext/civi_case/ang/crmCaseType.ang.php index 62ba2a55c3..3cb411ac77 100644 --- a/ang/crmCaseType.ang.php +++ b/ext/civi_case/ang/crmCaseType.ang.php @@ -1,9 +1,7 @@ 'civicrm', 'js' => ['ang/crmCaseType.js'], 'css' => ['ang/crmCaseType.css'], 'partials' => ['ang/crmCaseType'], diff --git a/ang/crmCaseType.css b/ext/civi_case/ang/crmCaseType.css similarity index 100% rename from ang/crmCaseType.css rename to ext/civi_case/ang/crmCaseType.css diff --git a/ang/crmCaseType.js b/ext/civi_case/ang/crmCaseType.js similarity index 100% rename from ang/crmCaseType.js rename to ext/civi_case/ang/crmCaseType.js diff --git a/ang/crmCaseType/activityTypesTable.html b/ext/civi_case/ang/crmCaseType/activityTypesTable.html similarity index 100% rename from ang/crmCaseType/activityTypesTable.html rename to ext/civi_case/ang/crmCaseType/activityTypesTable.html diff --git a/ang/crmCaseType/caseTypeDetails.html b/ext/civi_case/ang/crmCaseType/caseTypeDetails.html similarity index 100% rename from ang/crmCaseType/caseTypeDetails.html rename to ext/civi_case/ang/crmCaseType/caseTypeDetails.html diff --git a/ang/crmCaseType/edit.html b/ext/civi_case/ang/crmCaseType/edit.html similarity index 100% rename from ang/crmCaseType/edit.html rename to ext/civi_case/ang/crmCaseType/edit.html diff --git a/ang/crmCaseType/list.html b/ext/civi_case/ang/crmCaseType/list.html similarity index 100% rename from ang/crmCaseType/list.html rename to ext/civi_case/ang/crmCaseType/list.html diff --git a/ang/crmCaseType/rolesTable.html b/ext/civi_case/ang/crmCaseType/rolesTable.html similarity index 100% rename from ang/crmCaseType/rolesTable.html rename to ext/civi_case/ang/crmCaseType/rolesTable.html diff --git a/ang/crmCaseType/sequenceTable.html b/ext/civi_case/ang/crmCaseType/sequenceTable.html similarity index 100% rename from ang/crmCaseType/sequenceTable.html rename to ext/civi_case/ang/crmCaseType/sequenceTable.html diff --git a/ang/crmCaseType/statusTable.html b/ext/civi_case/ang/crmCaseType/statusTable.html similarity index 100% rename from ang/crmCaseType/statusTable.html rename to ext/civi_case/ang/crmCaseType/statusTable.html diff --git a/ang/crmCaseType/timelineTable.html b/ext/civi_case/ang/crmCaseType/timelineTable.html similarity index 100% rename from ang/crmCaseType/timelineTable.html rename to ext/civi_case/ang/crmCaseType/timelineTable.html diff --git a/ext/civi_case/info.xml b/ext/civi_case/info.xml index a3296ab988..165d49ffe4 100644 --- a/ext/civi_case/info.xml +++ b/ext/civi_case/info.xml @@ -28,6 +28,7 @@ + ang-php@1.0.0 scan-classes@1.0.0 diff --git a/ang/crmMailing.ang.php b/ext/civi_mail/ang/crmMailing.ang.php similarity index 80% rename from ang/crmMailing.ang.php rename to ext/civi_mail/ang/crmMailing.ang.php index e93dca1272..b4f93c346f 100644 --- a/ang/crmMailing.ang.php +++ b/ext/civi_mail/ang/crmMailing.ang.php @@ -1,9 +1,7 @@ 'civicrm', 'js' => [ 'ang/crmMailing.js', 'ang/crmMailing/*.js', diff --git a/ang/crmMailing.css b/ext/civi_mail/ang/crmMailing.css similarity index 100% rename from ang/crmMailing.css rename to ext/civi_mail/ang/crmMailing.css diff --git a/ang/crmMailing.js b/ext/civi_mail/ang/crmMailing.js similarity index 100% rename from ang/crmMailing.js rename to ext/civi_mail/ang/crmMailing.js diff --git a/ang/crmMailing/BlockApprove.html b/ext/civi_mail/ang/crmMailing/BlockApprove.html similarity index 100% rename from ang/crmMailing/BlockApprove.html rename to ext/civi_mail/ang/crmMailing/BlockApprove.html diff --git a/ang/crmMailing/BlockApprove.js b/ext/civi_mail/ang/crmMailing/BlockApprove.js similarity index 100% rename from ang/crmMailing/BlockApprove.js rename to ext/civi_mail/ang/crmMailing/BlockApprove.js diff --git a/ang/crmMailing/BlockHeaderFooter.html b/ext/civi_mail/ang/crmMailing/BlockHeaderFooter.html similarity index 100% rename from ang/crmMailing/BlockHeaderFooter.html rename to ext/civi_mail/ang/crmMailing/BlockHeaderFooter.html diff --git a/ang/crmMailing/BlockHeaderFooter.js b/ext/civi_mail/ang/crmMailing/BlockHeaderFooter.js similarity index 100% rename from ang/crmMailing/BlockHeaderFooter.js rename to ext/civi_mail/ang/crmMailing/BlockHeaderFooter.js diff --git a/ang/crmMailing/BlockMailing.html b/ext/civi_mail/ang/crmMailing/BlockMailing.html similarity index 100% rename from ang/crmMailing/BlockMailing.html rename to ext/civi_mail/ang/crmMailing/BlockMailing.html diff --git a/ang/crmMailing/BlockMailing.js b/ext/civi_mail/ang/crmMailing/BlockMailing.js similarity index 100% rename from ang/crmMailing/BlockMailing.js rename to ext/civi_mail/ang/crmMailing/BlockMailing.js diff --git a/ang/crmMailing/BlockPreview.html b/ext/civi_mail/ang/crmMailing/BlockPreview.html similarity index 100% rename from ang/crmMailing/BlockPreview.html rename to ext/civi_mail/ang/crmMailing/BlockPreview.html diff --git a/ang/crmMailing/BlockPreview.js b/ext/civi_mail/ang/crmMailing/BlockPreview.js similarity index 100% rename from ang/crmMailing/BlockPreview.js rename to ext/civi_mail/ang/crmMailing/BlockPreview.js diff --git a/ang/crmMailing/BlockPublication.html b/ext/civi_mail/ang/crmMailing/BlockPublication.html similarity index 100% rename from ang/crmMailing/BlockPublication.html rename to ext/civi_mail/ang/crmMailing/BlockPublication.html diff --git a/ang/crmMailing/BlockPublication.js b/ext/civi_mail/ang/crmMailing/BlockPublication.js similarity index 100% rename from ang/crmMailing/BlockPublication.js rename to ext/civi_mail/ang/crmMailing/BlockPublication.js diff --git a/ang/crmMailing/BlockRecipients.html b/ext/civi_mail/ang/crmMailing/BlockRecipients.html similarity index 100% rename from ang/crmMailing/BlockRecipients.html rename to ext/civi_mail/ang/crmMailing/BlockRecipients.html diff --git a/ang/crmMailing/BlockRecipients.js b/ext/civi_mail/ang/crmMailing/BlockRecipients.js similarity index 100% rename from ang/crmMailing/BlockRecipients.js rename to ext/civi_mail/ang/crmMailing/BlockRecipients.js diff --git a/ang/crmMailing/BlockRecipientsMultiline.html b/ext/civi_mail/ang/crmMailing/BlockRecipientsMultiline.html similarity index 100% rename from ang/crmMailing/BlockRecipientsMultiline.html rename to ext/civi_mail/ang/crmMailing/BlockRecipientsMultiline.html diff --git a/ang/crmMailing/BlockRecipientsMultiline.js b/ext/civi_mail/ang/crmMailing/BlockRecipientsMultiline.js similarity index 100% rename from ang/crmMailing/BlockRecipientsMultiline.js rename to ext/civi_mail/ang/crmMailing/BlockRecipientsMultiline.js diff --git a/ang/crmMailing/BlockResponses.html b/ext/civi_mail/ang/crmMailing/BlockResponses.html similarity index 100% rename from ang/crmMailing/BlockResponses.html rename to ext/civi_mail/ang/crmMailing/BlockResponses.html diff --git a/ang/crmMailing/BlockResponses.js b/ext/civi_mail/ang/crmMailing/BlockResponses.js similarity index 100% rename from ang/crmMailing/BlockResponses.js rename to ext/civi_mail/ang/crmMailing/BlockResponses.js diff --git a/ang/crmMailing/BlockReview.html b/ext/civi_mail/ang/crmMailing/BlockReview.html similarity index 100% rename from ang/crmMailing/BlockReview.html rename to ext/civi_mail/ang/crmMailing/BlockReview.html diff --git a/ang/crmMailing/BlockReview.js b/ext/civi_mail/ang/crmMailing/BlockReview.js similarity index 100% rename from ang/crmMailing/BlockReview.js rename to ext/civi_mail/ang/crmMailing/BlockReview.js diff --git a/ang/crmMailing/BlockSchedule.html b/ext/civi_mail/ang/crmMailing/BlockSchedule.html similarity index 100% rename from ang/crmMailing/BlockSchedule.html rename to ext/civi_mail/ang/crmMailing/BlockSchedule.html diff --git a/ang/crmMailing/BlockSchedule.js b/ext/civi_mail/ang/crmMailing/BlockSchedule.js similarity index 100% rename from ang/crmMailing/BlockSchedule.js rename to ext/civi_mail/ang/crmMailing/BlockSchedule.js diff --git a/ang/crmMailing/BlockSummary.html b/ext/civi_mail/ang/crmMailing/BlockSummary.html similarity index 100% rename from ang/crmMailing/BlockSummary.html rename to ext/civi_mail/ang/crmMailing/BlockSummary.html diff --git a/ang/crmMailing/BlockSummary.js b/ext/civi_mail/ang/crmMailing/BlockSummary.js similarity index 100% rename from ang/crmMailing/BlockSummary.js rename to ext/civi_mail/ang/crmMailing/BlockSummary.js diff --git a/ang/crmMailing/BlockTemplates.html b/ext/civi_mail/ang/crmMailing/BlockTemplates.html similarity index 100% rename from ang/crmMailing/BlockTemplates.html rename to ext/civi_mail/ang/crmMailing/BlockTemplates.html diff --git a/ang/crmMailing/BlockTemplates.js b/ext/civi_mail/ang/crmMailing/BlockTemplates.js similarity index 100% rename from ang/crmMailing/BlockTemplates.js rename to ext/civi_mail/ang/crmMailing/BlockTemplates.js diff --git a/ang/crmMailing/BlockTracking.html b/ext/civi_mail/ang/crmMailing/BlockTracking.html similarity index 100% rename from ang/crmMailing/BlockTracking.html rename to ext/civi_mail/ang/crmMailing/BlockTracking.html diff --git a/ang/crmMailing/BlockTracking.js b/ext/civi_mail/ang/crmMailing/BlockTracking.js similarity index 100% rename from ang/crmMailing/BlockTracking.js rename to ext/civi_mail/ang/crmMailing/BlockTracking.js diff --git a/ang/crmMailing/BodyHtml.html b/ext/civi_mail/ang/crmMailing/BodyHtml.html similarity index 100% rename from ang/crmMailing/BodyHtml.html rename to ext/civi_mail/ang/crmMailing/BodyHtml.html diff --git a/ang/crmMailing/BodyHtml.js b/ext/civi_mail/ang/crmMailing/BodyHtml.js similarity index 100% rename from ang/crmMailing/BodyHtml.js rename to ext/civi_mail/ang/crmMailing/BodyHtml.js diff --git a/ang/crmMailing/BodyText.html b/ext/civi_mail/ang/crmMailing/BodyText.html similarity index 100% rename from ang/crmMailing/BodyText.html rename to ext/civi_mail/ang/crmMailing/BodyText.html diff --git a/ang/crmMailing/BodyText.js b/ext/civi_mail/ang/crmMailing/BodyText.js similarity index 100% rename from ang/crmMailing/BodyText.js rename to ext/civi_mail/ang/crmMailing/BodyText.js diff --git a/ang/crmMailing/CreateMailingCtrl.js b/ext/civi_mail/ang/crmMailing/CreateMailingCtrl.js similarity index 100% rename from ang/crmMailing/CreateMailingCtrl.js rename to ext/civi_mail/ang/crmMailing/CreateMailingCtrl.js diff --git a/ang/crmMailing/EditMailingCtrl.js b/ext/civi_mail/ang/crmMailing/EditMailingCtrl.js similarity index 100% rename from ang/crmMailing/EditMailingCtrl.js rename to ext/civi_mail/ang/crmMailing/EditMailingCtrl.js diff --git a/ang/crmMailing/EditMailingCtrl/2step.html b/ext/civi_mail/ang/crmMailing/EditMailingCtrl/2step.html similarity index 100% rename from ang/crmMailing/EditMailingCtrl/2step.html rename to ext/civi_mail/ang/crmMailing/EditMailingCtrl/2step.html diff --git a/ang/crmMailing/EditMailingCtrl/base.html b/ext/civi_mail/ang/crmMailing/EditMailingCtrl/base.html similarity index 100% rename from ang/crmMailing/EditMailingCtrl/base.html rename to ext/civi_mail/ang/crmMailing/EditMailingCtrl/base.html diff --git a/ang/crmMailing/EditMailingCtrl/unified.html b/ext/civi_mail/ang/crmMailing/EditMailingCtrl/unified.html similarity index 100% rename from ang/crmMailing/EditMailingCtrl/unified.html rename to ext/civi_mail/ang/crmMailing/EditMailingCtrl/unified.html diff --git a/ang/crmMailing/EditMailingCtrl/unified2.html b/ext/civi_mail/ang/crmMailing/EditMailingCtrl/unified2.html similarity index 100% rename from ang/crmMailing/EditMailingCtrl/unified2.html rename to ext/civi_mail/ang/crmMailing/EditMailingCtrl/unified2.html diff --git a/ang/crmMailing/EditMailingCtrl/wizard.html b/ext/civi_mail/ang/crmMailing/EditMailingCtrl/wizard.html similarity index 100% rename from ang/crmMailing/EditMailingCtrl/wizard.html rename to ext/civi_mail/ang/crmMailing/EditMailingCtrl/wizard.html diff --git a/ang/crmMailing/EditMailingCtrl/workflow.html b/ext/civi_mail/ang/crmMailing/EditMailingCtrl/workflow.html similarity index 100% rename from ang/crmMailing/EditMailingCtrl/workflow.html rename to ext/civi_mail/ang/crmMailing/EditMailingCtrl/workflow.html diff --git a/ang/crmMailing/EditRecipCtrl.js b/ext/civi_mail/ang/crmMailing/EditRecipCtrl.js similarity index 100% rename from ang/crmMailing/EditRecipCtrl.js rename to ext/civi_mail/ang/crmMailing/EditRecipCtrl.js diff --git a/ang/crmMailing/EditRecipOptionsDialogCtrl.html b/ext/civi_mail/ang/crmMailing/EditRecipOptionsDialogCtrl.html similarity index 100% rename from ang/crmMailing/EditRecipOptionsDialogCtrl.html rename to ext/civi_mail/ang/crmMailing/EditRecipOptionsDialogCtrl.html diff --git a/ang/crmMailing/EditRecipOptionsDialogCtrl.js b/ext/civi_mail/ang/crmMailing/EditRecipOptionsDialogCtrl.js similarity index 100% rename from ang/crmMailing/EditRecipOptionsDialogCtrl.js rename to ext/civi_mail/ang/crmMailing/EditRecipOptionsDialogCtrl.js diff --git a/ang/crmMailing/EditUnsubGroupCtrl.js b/ext/civi_mail/ang/crmMailing/EditUnsubGroupCtrl.js similarity index 100% rename from ang/crmMailing/EditUnsubGroupCtrl.js rename to ext/civi_mail/ang/crmMailing/EditUnsubGroupCtrl.js diff --git a/ang/crmMailing/EmailAddrCtrl.js b/ext/civi_mail/ang/crmMailing/EmailAddrCtrl.js similarity index 100% rename from ang/crmMailing/EmailAddrCtrl.js rename to ext/civi_mail/ang/crmMailing/EmailAddrCtrl.js diff --git a/ang/crmMailing/EmailBodyCtrl.js b/ext/civi_mail/ang/crmMailing/EmailBodyCtrl.js similarity index 100% rename from ang/crmMailing/EmailBodyCtrl.js rename to ext/civi_mail/ang/crmMailing/EmailBodyCtrl.js diff --git a/ang/crmMailing/EmailBodyCtrl/tokenAlert.html b/ext/civi_mail/ang/crmMailing/EmailBodyCtrl/tokenAlert.html similarity index 100% rename from ang/crmMailing/EmailBodyCtrl/tokenAlert.html rename to ext/civi_mail/ang/crmMailing/EmailBodyCtrl/tokenAlert.html diff --git a/ang/crmMailing/FromAddress.js b/ext/civi_mail/ang/crmMailing/FromAddress.js similarity index 100% rename from ang/crmMailing/FromAddress.js rename to ext/civi_mail/ang/crmMailing/FromAddress.js diff --git a/ang/crmMailing/ListMailingsCtrl.js b/ext/civi_mail/ang/crmMailing/ListMailingsCtrl.js similarity index 100% rename from ang/crmMailing/ListMailingsCtrl.js rename to ext/civi_mail/ang/crmMailing/ListMailingsCtrl.js diff --git a/ang/crmMailing/MsgTemplateCtrl.js b/ext/civi_mail/ang/crmMailing/MsgTemplateCtrl.js similarity index 100% rename from ang/crmMailing/MsgTemplateCtrl.js rename to ext/civi_mail/ang/crmMailing/MsgTemplateCtrl.js diff --git a/ang/crmMailing/PreviewComponentCtrl.js b/ext/civi_mail/ang/crmMailing/PreviewComponentCtrl.js similarity index 100% rename from ang/crmMailing/PreviewComponentCtrl.js rename to ext/civi_mail/ang/crmMailing/PreviewComponentCtrl.js diff --git a/ang/crmMailing/PreviewComponentDialogCtrl.html b/ext/civi_mail/ang/crmMailing/PreviewComponentDialogCtrl.html similarity index 100% rename from ang/crmMailing/PreviewComponentDialogCtrl.html rename to ext/civi_mail/ang/crmMailing/PreviewComponentDialogCtrl.html diff --git a/ang/crmMailing/PreviewComponentDialogCtrl.js b/ext/civi_mail/ang/crmMailing/PreviewComponentDialogCtrl.js similarity index 100% rename from ang/crmMailing/PreviewComponentDialogCtrl.js rename to ext/civi_mail/ang/crmMailing/PreviewComponentDialogCtrl.js diff --git a/ang/crmMailing/PreviewMailingDialogCtrl.js b/ext/civi_mail/ang/crmMailing/PreviewMailingDialogCtrl.js similarity index 100% rename from ang/crmMailing/PreviewMailingDialogCtrl.js rename to ext/civi_mail/ang/crmMailing/PreviewMailingDialogCtrl.js diff --git a/ang/crmMailing/PreviewMgr/full.html b/ext/civi_mail/ang/crmMailing/PreviewMgr/full.html similarity index 100% rename from ang/crmMailing/PreviewMgr/full.html rename to ext/civi_mail/ang/crmMailing/PreviewMgr/full.html diff --git a/ang/crmMailing/PreviewMgr/html.html b/ext/civi_mail/ang/crmMailing/PreviewMgr/html.html similarity index 100% rename from ang/crmMailing/PreviewMgr/html.html rename to ext/civi_mail/ang/crmMailing/PreviewMgr/html.html diff --git a/ang/crmMailing/PreviewMgr/text.html b/ext/civi_mail/ang/crmMailing/PreviewMgr/text.html similarity index 100% rename from ang/crmMailing/PreviewMgr/text.html rename to ext/civi_mail/ang/crmMailing/PreviewMgr/text.html diff --git a/ang/crmMailing/PreviewRecipCtrl.html b/ext/civi_mail/ang/crmMailing/PreviewRecipCtrl.html similarity index 100% rename from ang/crmMailing/PreviewRecipCtrl.html rename to ext/civi_mail/ang/crmMailing/PreviewRecipCtrl.html diff --git a/ang/crmMailing/PreviewRecipCtrl.js b/ext/civi_mail/ang/crmMailing/PreviewRecipCtrl.js similarity index 100% rename from ang/crmMailing/PreviewRecipCtrl.js rename to ext/civi_mail/ang/crmMailing/PreviewRecipCtrl.js diff --git a/ang/crmMailing/RadioDate.js b/ext/civi_mail/ang/crmMailing/RadioDate.js similarity index 100% rename from ang/crmMailing/RadioDate.js rename to ext/civi_mail/ang/crmMailing/RadioDate.js diff --git a/ang/crmMailing/ReviewBool.js b/ext/civi_mail/ang/crmMailing/ReviewBool.js similarity index 100% rename from ang/crmMailing/ReviewBool.js rename to ext/civi_mail/ang/crmMailing/ReviewBool.js diff --git a/ang/crmMailing/SaveMsgTemplateDialogCtrl.html b/ext/civi_mail/ang/crmMailing/SaveMsgTemplateDialogCtrl.html similarity index 100% rename from ang/crmMailing/SaveMsgTemplateDialogCtrl.html rename to ext/civi_mail/ang/crmMailing/SaveMsgTemplateDialogCtrl.html diff --git a/ang/crmMailing/SaveMsgTemplateDialogCtrl.js b/ext/civi_mail/ang/crmMailing/SaveMsgTemplateDialogCtrl.js similarity index 100% rename from ang/crmMailing/SaveMsgTemplateDialogCtrl.js rename to ext/civi_mail/ang/crmMailing/SaveMsgTemplateDialogCtrl.js diff --git a/ang/crmMailing/Templates.js b/ext/civi_mail/ang/crmMailing/Templates.js similarity index 100% rename from ang/crmMailing/Templates.js rename to ext/civi_mail/ang/crmMailing/Templates.js diff --git a/ang/crmMailing/Token.js b/ext/civi_mail/ang/crmMailing/Token.js similarity index 100% rename from ang/crmMailing/Token.js rename to ext/civi_mail/ang/crmMailing/Token.js diff --git a/ang/crmMailing/ViewRecipCtrl.js b/ext/civi_mail/ang/crmMailing/ViewRecipCtrl.js similarity index 100% rename from ang/crmMailing/ViewRecipCtrl.js rename to ext/civi_mail/ang/crmMailing/ViewRecipCtrl.js diff --git a/ang/crmMailing/crmMailingRecipientsAutocomplete.component.js b/ext/civi_mail/ang/crmMailing/crmMailingRecipientsAutocomplete.component.js similarity index 100% rename from ang/crmMailing/crmMailingRecipientsAutocomplete.component.js rename to ext/civi_mail/ang/crmMailing/crmMailingRecipientsAutocomplete.component.js diff --git a/ang/crmMailing/services.js b/ext/civi_mail/ang/crmMailing/services.js similarity index 100% rename from ang/crmMailing/services.js rename to ext/civi_mail/ang/crmMailing/services.js diff --git a/ang/crmMailingAB.ang.php b/ext/civi_mail/ang/crmMailingAB.ang.php similarity index 67% rename from ang/crmMailingAB.ang.php rename to ext/civi_mail/ang/crmMailingAB.ang.php index 38fd42d2c5..cc26cd4345 100644 --- a/ang/crmMailingAB.ang.php +++ b/ext/civi_mail/ang/crmMailingAB.ang.php @@ -1,9 +1,7 @@ 'civicrm', 'js' => [ 'ang/crmMailingAB.js', 'ang/crmMailingAB/*.js', diff --git a/ang/crmMailingAB.css b/ext/civi_mail/ang/crmMailingAB.css similarity index 100% rename from ang/crmMailingAB.css rename to ext/civi_mail/ang/crmMailingAB.css diff --git a/ang/crmMailingAB.js b/ext/civi_mail/ang/crmMailingAB.js similarity index 100% rename from ang/crmMailingAB.js rename to ext/civi_mail/ang/crmMailingAB.js diff --git a/ang/crmMailingAB/BlockMailing.html b/ext/civi_mail/ang/crmMailingAB/BlockMailing.html similarity index 100% rename from ang/crmMailingAB/BlockMailing.html rename to ext/civi_mail/ang/crmMailingAB/BlockMailing.html diff --git a/ang/crmMailingAB/BlockMailing.js b/ext/civi_mail/ang/crmMailingAB/BlockMailing.js similarity index 100% rename from ang/crmMailingAB/BlockMailing.js rename to ext/civi_mail/ang/crmMailingAB/BlockMailing.js diff --git a/ang/crmMailingAB/BlockSetup.html b/ext/civi_mail/ang/crmMailingAB/BlockSetup.html similarity index 100% rename from ang/crmMailingAB/BlockSetup.html rename to ext/civi_mail/ang/crmMailingAB/BlockSetup.html diff --git a/ang/crmMailingAB/BlockSetup.js b/ext/civi_mail/ang/crmMailingAB/BlockSetup.js similarity index 100% rename from ang/crmMailingAB/BlockSetup.js rename to ext/civi_mail/ang/crmMailingAB/BlockSetup.js diff --git a/ang/crmMailingAB/EditCtrl.js b/ext/civi_mail/ang/crmMailingAB/EditCtrl.js similarity index 100% rename from ang/crmMailingAB/EditCtrl.js rename to ext/civi_mail/ang/crmMailingAB/EditCtrl.js diff --git a/ang/crmMailingAB/EditCtrl/edit.html b/ext/civi_mail/ang/crmMailingAB/EditCtrl/edit.html similarity index 100% rename from ang/crmMailingAB/EditCtrl/edit.html rename to ext/civi_mail/ang/crmMailingAB/EditCtrl/edit.html diff --git a/ang/crmMailingAB/EditCtrl/main.html b/ext/civi_mail/ang/crmMailingAB/EditCtrl/main.html similarity index 100% rename from ang/crmMailingAB/EditCtrl/main.html rename to ext/civi_mail/ang/crmMailingAB/EditCtrl/main.html diff --git a/ang/crmMailingAB/EditCtrl/report.html b/ext/civi_mail/ang/crmMailingAB/EditCtrl/report.html similarity index 100% rename from ang/crmMailingAB/EditCtrl/report.html rename to ext/civi_mail/ang/crmMailingAB/EditCtrl/report.html diff --git a/ang/crmMailingAB/ListCtrl.html b/ext/civi_mail/ang/crmMailingAB/ListCtrl.html similarity index 100% rename from ang/crmMailingAB/ListCtrl.html rename to ext/civi_mail/ang/crmMailingAB/ListCtrl.html diff --git a/ang/crmMailingAB/ListCtrl.js b/ext/civi_mail/ang/crmMailingAB/ListCtrl.js similarity index 100% rename from ang/crmMailingAB/ListCtrl.js rename to ext/civi_mail/ang/crmMailingAB/ListCtrl.js diff --git a/ang/crmMailingAB/NewCtrl.js b/ext/civi_mail/ang/crmMailingAB/NewCtrl.js similarity index 100% rename from ang/crmMailingAB/NewCtrl.js rename to ext/civi_mail/ang/crmMailingAB/NewCtrl.js diff --git a/ang/crmMailingAB/ReportCtrl.js b/ext/civi_mail/ang/crmMailingAB/ReportCtrl.js similarity index 100% rename from ang/crmMailingAB/ReportCtrl.js rename to ext/civi_mail/ang/crmMailingAB/ReportCtrl.js diff --git a/ang/crmMailingAB/Slider.html b/ext/civi_mail/ang/crmMailingAB/Slider.html similarity index 100% rename from ang/crmMailingAB/Slider.html rename to ext/civi_mail/ang/crmMailingAB/Slider.html diff --git a/ang/crmMailingAB/Slider.js b/ext/civi_mail/ang/crmMailingAB/Slider.js similarity index 100% rename from ang/crmMailingAB/Slider.js rename to ext/civi_mail/ang/crmMailingAB/Slider.js diff --git a/ang/crmMailingAB/Stats.js b/ext/civi_mail/ang/crmMailingAB/Stats.js similarity index 100% rename from ang/crmMailingAB/Stats.js rename to ext/civi_mail/ang/crmMailingAB/Stats.js diff --git a/ang/crmMailingAB/WinnerDialogCtrl.html b/ext/civi_mail/ang/crmMailingAB/WinnerDialogCtrl.html similarity index 100% rename from ang/crmMailingAB/WinnerDialogCtrl.html rename to ext/civi_mail/ang/crmMailingAB/WinnerDialogCtrl.html diff --git a/ang/crmMailingAB/WinnerDialogCtrl.js b/ext/civi_mail/ang/crmMailingAB/WinnerDialogCtrl.js similarity index 100% rename from ang/crmMailingAB/WinnerDialogCtrl.js rename to ext/civi_mail/ang/crmMailingAB/WinnerDialogCtrl.js diff --git a/ang/crmMailingAB/services.js b/ext/civi_mail/ang/crmMailingAB/services.js similarity index 100% rename from ang/crmMailingAB/services.js rename to ext/civi_mail/ang/crmMailingAB/services.js diff --git a/ext/civi_mail/info.xml b/ext/civi_mail/info.xml index 7a167bfbd5..a41bf719a6 100644 --- a/ext/civi_mail/info.xml +++ b/ext/civi_mail/info.xml @@ -28,6 +28,7 @@ + ang-php@1.0.0 scan-classes@1.0.0 mgd-php@1.0.0 diff --git a/karma.conf.js b/karma.conf.js index d34a6077cb..59bdee47f3 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -48,15 +48,23 @@ module.exports = function(config) { 'ang/**/*.js', 'tests/karma/lib/*.js', 'tests/karma/**/*.js', - 'ang/**/*.html' + 'ang/**/*.html', + 'ext/civi_mail/ang/*.js', + 'ext/civi_mail/ang/**/*.js', + 'ext/civi_mail/ang/**/*.html', + 'ext/civi_case/ang/*.js', + 'ext/civi_case/ang/**/*.js', + 'ext/civi_case/ang/**/*.html' ], preprocessors : { - 'ang/**/*.html' : ['ng-html2js'] + 'ang/**/*.html': ['ng-html2js'], + 'ext/*/ang/**/*.html': ['ng-html2js'], }, ngHtml2JsPreprocessor: { - stripPrefix: 'ang/', - prependPrefix: '~/', + cacheIdFromPath: function(filepath) { + return filepath.replace(/.*ang\//, '~/'); + }, moduleName: 'crmResource' }, frameworks: ['jasmine'],