From 4585f2a7f78311a3df4c6d6861334229094076b3 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 11 Dec 2019 09:38:50 -0500 Subject: [PATCH] Merge afField module into af module --- ext/afform/core/ang/af.ang.php | 3 ++- .../ang/{afField/afField.js => af/Field.js} | 6 ++--- .../core/ang/{afField => af}/afField.html | 2 +- .../widgets => af/fields}/CheckBox.html | 0 .../{afField/widgets => af/fields}/Date.html | 0 .../widgets => af/fields}/Number.html | 0 .../{afField/widgets => af/fields}/Radio.html | 0 .../widgets => af/fields}/RichTextEditor.html | 0 .../widgets => af/fields}/Select.html | 0 .../{afField/widgets => af/fields}/Text.html | 0 .../widgets => af/fields}/TextArea.html | 0 ext/afform/core/ang/afField.ang.php | 23 ------------------- ext/afform/core/ang/afField.css | 1 - ext/afform/core/ang/afField.js | 4 ---- ext/afform/mock/ang/afex.aff.json | 2 +- 15 files changed, 7 insertions(+), 34 deletions(-) rename ext/afform/core/ang/{afField/afField.js => af/Field.js} (88%) rename ext/afform/core/ang/{afField => af}/afField.html (73%) rename ext/afform/core/ang/{afField/widgets => af/fields}/CheckBox.html (100%) rename ext/afform/core/ang/{afField/widgets => af/fields}/Date.html (100%) rename ext/afform/core/ang/{afField/widgets => af/fields}/Number.html (100%) rename ext/afform/core/ang/{afField/widgets => af/fields}/Radio.html (100%) rename ext/afform/core/ang/{afField/widgets => af/fields}/RichTextEditor.html (100%) rename ext/afform/core/ang/{afField/widgets => af/fields}/Select.html (100%) rename ext/afform/core/ang/{afField/widgets => af/fields}/Text.html (100%) rename ext/afform/core/ang/{afField/widgets => af/fields}/TextArea.html (100%) delete mode 100644 ext/afform/core/ang/afField.ang.php delete mode 100644 ext/afform/core/ang/afField.css delete mode 100644 ext/afform/core/ang/afField.js diff --git a/ext/afform/core/ang/af.ang.php b/ext/afform/core/ang/af.ang.php index 249a7a6e39..d4230409da 100644 --- a/ext/afform/core/ang/af.ang.php +++ b/ext/afform/core/ang/af.ang.php @@ -10,7 +10,7 @@ return [ 'ang/af/*/*.js', ], // 'css' => ['ang/af.css'], - // 'partials' => ['ang/af'], + 'partials' => ['ang/af'], 'requires' => ['crmUtil'], 'settings' => [], 'basePages' => [], @@ -18,5 +18,6 @@ return [ 'af-entity' => 'E', 'af-fieldset' => 'A', 'af-form' => 'E', + 'af-field' => 'E', ], ]; diff --git a/ext/afform/core/ang/afField/afField.js b/ext/afform/core/ang/af/Field.js similarity index 88% rename from ext/afform/core/ang/afField/afField.js rename to ext/afform/core/ang/af/Field.js index f600417323..08b637734f 100644 --- a/ext/afform/core/ang/afField/afField.js +++ b/ext/afform/core/ang/af/Field.js @@ -1,12 +1,12 @@ (function(angular, $, _) { // Example usage:
- angular.module('afField').directive('afField', function() { + angular.module('af').directive('afField', function() { return { restrict: 'E', require: ['^afFieldset', '^afForm'], - templateUrl: '~/afField/afField.html', + templateUrl: '~/af/afField.html', scope: { - fieldName: '@name', // TEST ME + fieldName: '@name', defn: '=' }, link: function($scope, $el, $attr, ctrls) { diff --git a/ext/afform/core/ang/afField/afField.html b/ext/afform/core/ang/af/afField.html similarity index 73% rename from ext/afform/core/ang/afField/afField.html rename to ext/afform/core/ang/af/afField.html index 79a0703b93..709a7cbefb 100644 --- a/ext/afform/core/ang/afField/afField.html +++ b/ext/afform/core/ang/af/afField.html @@ -2,5 +2,5 @@ {{ defn.title }}

{{ defn.help_pre }}

-
+

{{ defn.help_post }}

diff --git a/ext/afform/core/ang/afField/widgets/CheckBox.html b/ext/afform/core/ang/af/fields/CheckBox.html similarity index 100% rename from ext/afform/core/ang/afField/widgets/CheckBox.html rename to ext/afform/core/ang/af/fields/CheckBox.html diff --git a/ext/afform/core/ang/afField/widgets/Date.html b/ext/afform/core/ang/af/fields/Date.html similarity index 100% rename from ext/afform/core/ang/afField/widgets/Date.html rename to ext/afform/core/ang/af/fields/Date.html diff --git a/ext/afform/core/ang/afField/widgets/Number.html b/ext/afform/core/ang/af/fields/Number.html similarity index 100% rename from ext/afform/core/ang/afField/widgets/Number.html rename to ext/afform/core/ang/af/fields/Number.html diff --git a/ext/afform/core/ang/afField/widgets/Radio.html b/ext/afform/core/ang/af/fields/Radio.html similarity index 100% rename from ext/afform/core/ang/afField/widgets/Radio.html rename to ext/afform/core/ang/af/fields/Radio.html diff --git a/ext/afform/core/ang/afField/widgets/RichTextEditor.html b/ext/afform/core/ang/af/fields/RichTextEditor.html similarity index 100% rename from ext/afform/core/ang/afField/widgets/RichTextEditor.html rename to ext/afform/core/ang/af/fields/RichTextEditor.html diff --git a/ext/afform/core/ang/afField/widgets/Select.html b/ext/afform/core/ang/af/fields/Select.html similarity index 100% rename from ext/afform/core/ang/afField/widgets/Select.html rename to ext/afform/core/ang/af/fields/Select.html diff --git a/ext/afform/core/ang/afField/widgets/Text.html b/ext/afform/core/ang/af/fields/Text.html similarity index 100% rename from ext/afform/core/ang/afField/widgets/Text.html rename to ext/afform/core/ang/af/fields/Text.html diff --git a/ext/afform/core/ang/afField/widgets/TextArea.html b/ext/afform/core/ang/af/fields/TextArea.html similarity index 100% rename from ext/afform/core/ang/afField/widgets/TextArea.html rename to ext/afform/core/ang/af/fields/TextArea.html diff --git a/ext/afform/core/ang/afField.ang.php b/ext/afform/core/ang/afField.ang.php deleted file mode 100644 index 6f42674372..0000000000 --- a/ext/afform/core/ang/afField.ang.php +++ /dev/null @@ -1,23 +0,0 @@ - [ - 'ang/afField.js', - 'ang/afField/*.js', - 'ang/afField/*/*.js', - ], - 'css' => ['ang/afField.css'], - 'partials' => ['ang/afField'], - 'requires' => [ - 'crmUi', - 'crmUtil', - ], - 'settings' => [], - 'basePages' => [], - 'exports' => [ - 'af-field' => 'E', - ], -]; diff --git a/ext/afform/core/ang/afField.css b/ext/afform/core/ang/afField.css deleted file mode 100644 index f7242cc0b7..0000000000 --- a/ext/afform/core/ang/afField.css +++ /dev/null @@ -1 +0,0 @@ -/* Add any CSS rules for Angular module "afField" */ diff --git a/ext/afform/core/ang/afField.js b/ext/afform/core/ang/afField.js deleted file mode 100644 index 617a10b090..0000000000 --- a/ext/afform/core/ang/afField.js +++ /dev/null @@ -1,4 +0,0 @@ -(function(angular, $, _) { - // Declare a list of dependencies. - angular.module('afField', CRM.angRequires('afField')); -})(angular, CRM.$, CRM._); diff --git a/ext/afform/mock/ang/afex.aff.json b/ext/afform/mock/ang/afex.aff.json index 7cb07054e8..57a6679e72 100644 --- a/ext/afform/mock/ang/afex.aff.json +++ b/ext/afform/mock/ang/afex.aff.json @@ -1,4 +1,4 @@ { "server_route": "civicrm/afex", - "requires":["mockFoo", "mockBareFile", "af", "afBlock", "afField"] + "requires":["mockFoo", "mockBareFile", "af", "afBlock"] } -- 2.25.1