Fix api explorer module loading
authorColeman Watts <coleman@civicrm.org>
Mon, 16 Sep 2019 20:31:24 +0000 (16:31 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 17 Sep 2019 03:11:24 +0000 (23:11 -0400)
CRM/Api4/Page/Api4Explorer.php
Civi/Angular/Manager.php
ang/api4.ang.php
ang/api4Explorer.ang.php
composer.json
js/crm.ajax.js
js/load-bootstrap.js

index 5566acde9fd818b6818603f86277ac1032c5694f..83b88c633ccfa5b3da6e0533f1b6971f8c64f006 100644 (file)
@@ -12,6 +12,7 @@ class CRM_Api4_Page_Api4Explorer extends CRM_Core_Page {
     Civi::resources()
       ->addVars('api4', $vars)
       ->addScriptFile('civicrm', 'js/load-bootstrap.js')
+      ->addScriptFile('civicrm', 'bower_components/js-yaml/dist/js-yaml.min.js')
       ->addScriptFile('civicrm', 'bower_components/google-code-prettify/bin/prettify.min.js')
       ->addStyleFile('civicrm', 'bower_components/google-code-prettify/bin/prettify.min.css');
 
index c44b854aa694dd788ec7da294c21eab260d359ea..cb4c4c86d27fba7d3f8942fb6a938a911c6d2e8a 100644 (file)
@@ -98,6 +98,8 @@ class Manager {
       $angularModules['ui.sortable'] = include "$civicrm_root/ang/ui.sortable.ang.php";
       $angularModules['unsavedChanges'] = include "$civicrm_root/ang/unsavedChanges.ang.php";
       $angularModules['statuspage'] = include "$civicrm_root/ang/crmStatusPage.ang.php";
+      $angularModules['api4Explorer'] = include "$civicrm_root/ang/api4Explorer.ang.php";
+      $angularModules['api4'] = include "$civicrm_root/ang/api4.ang.php";
 
       foreach (\CRM_Core_Component::getEnabledComponents() as $component) {
         $angularModules = array_merge($angularModules, $component->getAngularModules());
index f7d69b39a3cadfc91550e82d1e78f5afc7cd788f..2c8a85b753be8f298fd370a91c965adfac055101 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 // Autoloader data for Api4 angular module.
 return [
+  'ext' => 'civicrm',
   'js' => [
     'ang/api4.js',
     'ang/api4/*.js',
index 176d740d89255a34bcc7adaf7a9a6df71813b1b7..9b974d53bf8d46c2a8816181c62453dea5f0ea26 100644 (file)
@@ -1,11 +1,10 @@
 <?php
 // Autoloader data for Api4 explorer.
 return [
+  'ext' => 'civicrm',
   'js' => [
     'ang/api4Explorer.js',
-    'ang/api4Explorer/*.js',
-    'ang/api4Explorer/*/*.js',
-    'lib/*.js',
+    'ang/api4Explorer/Explorer.js',
   ],
   'css' => [
     'css/api4-explorer.css',
index b298a5c9baebd2f2c26493abea016c50179dc766..ddbebd438ca11af7f7793c1212e81157c900f516 100644 (file)
       "select2": {
         "url": "https://github.com/colemanw/select2/archive/v3.5-civicrm-1.0.zip"
       },
+      "js-yaml": {
+        "url": "https://github.com/nodeca/js-yaml/archive/3.13.1.zip"
+      },
       "smartmenus": {
         "url": "https://github.com/vadikom/smartmenus/archive/1.1.0.zip",
         "ignore": [".gitignore", "Gruntfile.js"]
index e3ff56d1a6383acbd5bcbfb7f310048918a9cfc3..bfff407843dc2e02e4723c866e431ecc48d8854d 100644 (file)
@@ -3,7 +3,7 @@
  * @see https://wiki.civicrm.org/confluence/display/CRMDOC/AJAX+Interface
  * @see https://wiki.civicrm.org/confluence/display/CRMDOC/Ajax+Pages+and+Forms
  */
-(function($, CRM, undefined) {
+(function($, CRM, _, undefined) {
   /**
    * @param string path
    * @param string|object query
       });
   });
 
-}(jQuery, CRM));
+}(jQuery, CRM, _));
index aff280a07be8df1c468352e5b43d9f673fdc0b97..e528805a181d832eaf3cc339fd3897401f58228b 100644 (file)
@@ -1,7 +1,7 @@
 // Loads a copy of shoreditch's bootstrap if bootstrap is missing
 CRM.$(function($) {
   if (!$.isFunction($.fn.dropdown)) {
-    CRM.loadScript(CRM.vars.api4.basePath + 'lib/shoreditch/dropdown.js');
-    $('head').append('<link type="text/css" rel="stylesheet" href="' + CRM.vars.api4.basePath + 'lib/shoreditch/bootstrap.css" />');
+    //CRM.loadScript(CRM.vars.api4.basePath + 'lib/shoreditch/dropdown.js');
+    //$('head').append('<link type="text/css" rel="stylesheet" href="' + CRM.vars.api4.basePath + 'lib/shoreditch/bootstrap.css" />');
   }
-});
\ No newline at end of file
+});