From e81468882340bc0c7a239a1f35fabda903a08cc2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 13 Sep 2019 12:27:00 -0400 Subject: [PATCH] Rename `` to its real name, `` --- ext/afform/auditor/backlog.md | 4 ++-- ext/afform/core/CRM/Afform/ArrayHtml.php | 4 ++-- ext/afform/core/Civi/Afform/Utils.php | 4 ++-- ext/afform/core/afform.php | 2 +- ext/afform/core/ang/af/{WillBeModel.js => Model.js} | 8 ++++---- ext/afform/docs/sandbox/planning-v0.3.md | 10 +++++----- ext/afform/docs/style.md | 6 +++--- ext/afform/mock/ang/afex.aff.html | 6 +++--- 8 files changed, 22 insertions(+), 22 deletions(-) rename ext/afform/core/ang/af/{WillBeModel.js => Model.js} (70%) diff --git a/ext/afform/auditor/backlog.md b/ext/afform/auditor/backlog.md index 19a6d1a7f3..bdd7a71f56 100644 --- a/ext/afform/auditor/backlog.md +++ b/ext/afform/auditor/backlog.md @@ -7,8 +7,8 @@ validator to catch. Loosely/informally: * HTML partials should be well-formed/parseable XML * Warnings about any unrecognized tags/attributes/classes. -* ``, ``, ``, `` should have suitable relationships. -* `` should reference legit entities. +* ``, ``, ``, `` should have suitable relationships. +* `` should reference legit entities. * `` should reference legit fields. * Future consideration: how to validate when it's part of a subform? * `` should reference a declared model. diff --git a/ext/afform/core/CRM/Afform/ArrayHtml.php b/ext/afform/core/CRM/Afform/ArrayHtml.php index 9d11d35df9..e957e5cba0 100644 --- a/ext/afform/core/CRM/Afform/ArrayHtml.php +++ b/ext/afform/core/CRM/Afform/ArrayHtml.php @@ -21,7 +21,7 @@ class CRM_Afform_ArrayHtml { '*' => [ '*' => 'text', ], - 'af-will-be-model' => [ + 'af-model' => [ 'af-name' => 'text', 'af-entity' => 'text', 'af-data' => 'js', @@ -158,7 +158,7 @@ class CRM_Afform_ArrayHtml { * Determine the type of data that is stored in an attribute. * * @param string $tag - * Ex: 'af-will-be-model' + * Ex: 'af-model' * @param string $attrName * Ex: 'af-name' * @return string diff --git a/ext/afform/core/Civi/Afform/Utils.php b/ext/afform/core/Civi/Afform/Utils.php index 6c04167695..9095ed0208 100644 --- a/ext/afform/core/Civi/Afform/Utils.php +++ b/ext/afform/core/Civi/Afform/Utils.php @@ -11,13 +11,13 @@ class Utils { * @return array */ public static function getEntities($layout) { - $entities = array_column(self::getTags($layout, 'af-will-be-model'), NULL, 'af-name'); + $entities = array_column(self::getTags($layout, 'af-model'), NULL, 'af-name'); self::getFields($layout, $entities); return $entities; } /** - * Returns all tags with a certain tag name, e.g. 'af-will-be-model' + * Returns all tags with a certain tag name, e.g. 'af-model' * * @param array $collection * @param string $tagName diff --git a/ext/afform/core/afform.php b/ext/afform/core/afform.php index 03316a5c3d..cf1189520d 100644 --- a/ext/afform/core/afform.php +++ b/ext/afform/core/afform.php @@ -214,7 +214,7 @@ function afform_civicrm_alterAngular($angular) { function _afform_getMetadata(phpQueryObject $doc) { $entities = []; - foreach ($doc->find('af-will-be-model') as $afmModelProp) { + foreach ($doc->find('af-model') as $afmModelProp) { $entities[$afmModelProp->getAttribute('af-name')] = [ 'type' => $afmModelProp->getAttribute('type'), ]; diff --git a/ext/afform/core/ang/af/WillBeModel.js b/ext/afform/core/ang/af/Model.js similarity index 70% rename from ext/afform/core/ang/af/WillBeModel.js rename to ext/afform/core/ang/af/Model.js index 6dbda8c701..6d94908c70 100644 --- a/ext/afform/core/ang/af/WillBeModel.js +++ b/ext/afform/core/ang/af/Model.js @@ -1,7 +1,7 @@ (function(angular, $, _) { - // "afWillBeModel" is a basic skeletal directive. - // Example usage: ... ... - angular.module('af').directive('afWillBeModel', function() { + // "afModel" is a basic skeletal directive. + // Example usage: ... ... + angular.module('af').directive('afModel', function() { // Whitelist of all allowed properties of an af-fieldset // (at least the ones we care about client-side - other's can be added for server-side processing and we'll just ignore them) var modelProps = { @@ -21,7 +21,7 @@ entity.id = null; entity.fields = []; afFormCtrl.registerEntity(entity); - // $scope.$watch('afWillBeModel', function(newValue){$scope.myOptions = newValue;}); + // $scope.$watch('afModel', function(newValue){$scope.myOptions = newValue;}); } }; }); diff --git a/ext/afform/docs/sandbox/planning-v0.3.md b/ext/afform/docs/sandbox/planning-v0.3.md index 6c4b66b87f..ea72e2ae0d 100644 --- a/ext/afform/docs/sandbox/planning-v0.3.md +++ b/ext/afform/docs/sandbox/planning-v0.3.md @@ -86,13 +86,13 @@ ```html - - - + @@ -148,13 +148,13 @@ ```html - - ` + * Example: `` * Mix-in directives (e.g. `afMonaco` or `afApi4Action`) * The directive name must begin with the `af` prefix. @@ -18,7 +18,7 @@ __Discussion__: These differ in two ways: * Namespacing * Standalone directives form an implicit namespace. - (*Anything passed to `` is implicitly about `af-will-be-model`.) + (*Anything passed to `` is implicitly about `af-model`.) * Mix-in directives must share a namespace with other potential mix-ins. (*The *) * Directive arguments diff --git a/ext/afform/mock/ang/afex.aff.html b/ext/afform/mock/ang/afex.aff.html index c0689336a8..81e94a6bb1 100644 --- a/ext/afform/mock/ang/afex.aff.html +++ b/ext/afform/mock/ang/afex.aff.html @@ -1,8 +1,8 @@ - - - + + + -- 2.25.1