From c3ac9bff05767552a66198db68a5c7e45e7ec516 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 13 Sep 2019 12:38:38 -0400 Subject: [PATCH] (af-model) Rename "af-data" to "data" --- ext/afform/core/CRM/Afform/ArrayHtml.php | 2 +- ext/afform/core/ang/af/Form.js | 4 ++-- ext/afform/core/ang/af/Model.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/afform/core/CRM/Afform/ArrayHtml.php b/ext/afform/core/CRM/Afform/ArrayHtml.php index e957e5cba0..2039aa57ee 100644 --- a/ext/afform/core/CRM/Afform/ArrayHtml.php +++ b/ext/afform/core/CRM/Afform/ArrayHtml.php @@ -24,7 +24,7 @@ class CRM_Afform_ArrayHtml { 'af-model' => [ 'af-name' => 'text', 'af-entity' => 'text', - 'af-data' => 'js', + 'data' => 'js', ], 'af-field' => [ 'field-name' => 'text', diff --git a/ext/afform/core/ang/af/Form.js b/ext/afform/core/ang/af/Form.js index 0b3f5a0cff..2ebd7867fa 100644 --- a/ext/afform/core/ang/af/Form.js +++ b/ext/afform/core/ang/af/Form.js @@ -22,7 +22,7 @@ this.registerEntity = function registerEntity(entity) { schema[entity.afName] = entity; - data[entity.afName] = entity.afData || {}; + data[entity.afName] = entity.data || {}; }; this.registerField = function(entityName, fieldName) { schema[entityName].fields.push(fieldName); @@ -48,7 +48,7 @@ crmApi4('Afform', 'prefill', {name: CRM.afform.open, args: $routeParams}) .then(function(result) { _.each(result, function(item) { - data[item.name] = _.extend(item.values, schema[item.name].afData || {}); + data[item.name] = _.extend(item.values, schema[item.name].data || {}); }); }); } diff --git a/ext/afform/core/ang/af/Model.js b/ext/afform/core/ang/af/Model.js index 180f8784a0..21e442dfa2 100644 --- a/ext/afform/core/ang/af/Model.js +++ b/ext/afform/core/ang/af/Model.js @@ -6,7 +6,7 @@ // (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 = { type: '@', - afData: '=', + data: '=', afName: '@', label: '@', autofill: '@' -- 2.25.1