(af-model) Rename af-label to label
authorTim Otten <totten@civicrm.org>
Fri, 13 Sep 2019 16:35:01 +0000 (12:35 -0400)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
ext/afform/core/ang/af/Model.js
ext/afform/docs/sandbox/planning-v0.3.md
ext/afform/mock/ang/afex.aff.html

index 6d94908c70689edb55e2a6a02143c17e9a293fa5..545ebf7f2ff267c60979d6f55f5856760a382285 100644 (file)
@@ -8,7 +8,7 @@
       type: '@',
       afData: '=',
       afName: '@',
-      afLabel: '@',
+      label: '@',
       afAutofill: '@'
     };
     return {
index dcc455b7d8af7ea3ea3dde9a8a083404932dbd7b..00751898758e42c7deb747d9e1a76cb74e33ce59 100644 (file)
@@ -16,9 +16,9 @@
 </script>
   
 <div afform-entity-ctrl="afform-meta-1234abcd">
-  <af-address contact-id="entities.parent.id" af-label="Address" ng-if="" ng-classes="{foo: name == 'Frank'}" />
-  <af-field entity="entities.parent" entity-type="contact" field="first_name" af-label="First Name"/>
-  <af-field entity="entities.parent" entity-type="contact" field="last_name" af-label="Last Name"/>
+  <af-address contact-id="entities.parent.id" label="Address" ng-if="" ng-classes="{foo: name == 'Frank'}" />
+  <af-field entity="entities.parent" entity-type="contact" field="first_name" label="First Name"/>
+  <af-field entity="entities.parent" entity-type="contact" field="last_name" label="Last Name"/>
 </div>
 ```
 
   <afform-entity type="Individual" name="parent" title="Parent" />
   <afform-entity type="Individual" name="spouse" title="Spouse" />
   
-  <af-name entity="myEntities.parent" af-label="Address" />
-  <af-address entity="myEntities.parent" af-label="Address" />
-  <af-field entity="myEntities.parent" entity-type="contact" field="first_name" af-label="First Name"/>
-  <af-field entity="myEntities.parent" entity-type="contact" field="last_name" af-label="Last Name"/>
+  <af-name entity="myEntities.parent" label="Address" />
+  <af-address entity="myEntities.parent" label="Address" />
+  <af-field entity="myEntities.parent" entity-type="contact" field="first_name" label="First Name"/>
+  <af-field entity="myEntities.parent" entity-type="contact" field="last_name" label="Last Name"/>
 </div>
 ```
 
 ```html
 <div afform-entity-ctrl="myEntities">
 
-  <af-entity type="Individual" af-name="parent" af-label="Parent">
-    <af-name af-label="Name" />
-    <af-email af-label="Email" />
+  <af-entity type="Individual" af-name="parent" label="Parent">
+    <af-name label="Name" />
+    <af-email label="Email" />
   </af-entity>
   
   <af-entity type="Individual" af-name="spouse" af-title="Spouse">
-    <af-name af-label="Spouse Name" />
-    <af-email af-label="Spouse Email" />
+    <af-name label="Spouse Name" />
+    <af-email label="Spouse Email" />
   </af-entity>
 
   <af-entity type="Individual" af-name="parent" af-title="Parent">
-    <af-address af-label="Address" />
+    <af-address label="Address" />
   </af-entity>
 
 </div>
 <!-- 1. s/entity/model-->
 <af-form>
 
-  <af-fieldset type="Individual" af-name="parent" af-label="Parent">
-    <af-name af-label="Name" />
-    <af-email af-label="Email" />
+  <af-fieldset type="Individual" af-name="parent" label="Parent">
+    <af-name label="Name" />
+    <af-email label="Email" />
   </af-fieldset>
 
   <af-fieldset type="Individual" af-name="spouse" af-title="Spouse">
-    <af-name af-label="Spouse Name" />
-    <af-email af-label="Spouse Email" />
+    <af-name label="Spouse Name" />
+    <af-email label="Spouse Email" />
   </af-fieldset>
 
   <af-fieldset type="Individual" af-name="parent" af-title="Parent">
-    <af-address af-label="Address" />
+    <af-address label="Address" />
   </af-fieldset>
 
 </af-form>
   <af-model
     type="Individual"
     af-name="parent"
-    af-label="Parent"
+    label="Parent"
     af-api4-params="{where: ['id','=', routeParams.cid]}"
   />
   <af-model
     type="Individual"
     af-name="spouse"
-    af-label="Spouse"
+    label="Spouse"
     af-contact-relationship="['Spouse of', 'parent']"
   />
   <!-- "parent" and "spouse" should be exported as variables in this scope -->
 
   <af-fieldset af-name="parent">
-    <af-name af-label="Name" />
-    <af-email af-label="Email" />
+    <af-name label="Name" />
+    <af-email label="Email" />
   </af-fieldset>
 
   <af-fieldset af-name="spouse">
-    <af-name af-label="Spouse Name" />
-    <af-email af-label="Spouse Email" only-primary="true" />
+    <af-name label="Spouse Name" />
+    <af-email label="Spouse Email" only-primary="true" />
   </af-fieldset>
 
   <p ng-if="spouse.display_name.contains('Thor')">
   </p>
 
   <af-fieldset af-name="parent">
-    <af-address af-label="Address" />
+    <af-address label="Address" />
   </af-fieldset>
 
   <!-- General elements: FIELDSET, UL, BUTTON, P, H1 should work anywhere -->
   <!--<af-model -->
     <!--type="Email"-->
     <!--af-name="email"-->
-    <!--af-label="Emails"-->
+    <!--label="Emails"-->
     <!--af-api4-params="{where: ['contact_id', '=', options.parent.id]}"-->
   <!--/>-->
   <!--<af-fieldset af-name="email">-->
   <af-model
     type="Individual"
     af-name="parent"
-    af-label="Parent"
+    label="Parent"
     af-api4-params="{where: ['id','=', routeParams.cid]}"
   />
   <af-model
     type="Individual"
     af-name="spouse"
-    af-label="Spouse"
+    label="Spouse"
     af-contact-relationship="['Spouse of', 'parent']"
   />
   <!-- "parent" and "spouse" should be exported as variables in this scope -->
   <crm-ui-tab-set>
     <crm-ui-tab title="About You">
       <af-fieldset af-name="parent">
-        <af-std-contact-name af-label="Name" />
-        <af-std-contact-email af-label="Email" />
+        <af-std-contact-name label="Name" />
+        <af-std-contact-email label="Email" />
         <af-field field-name="do_not_email" field-type="checkbox" field-default="1" />
       </af-fieldset>
     </crm-ui-tab>
     <crm-ui-tab title="Spouse">
       <af-fieldset af-name="spouse">
-        <af-std-contact-name af-label="Spouse Name" />
-        <af-std-contact-email af-label="Spouse Email" only-primary="true" />
+        <af-std-contact-name label="Spouse Name" />
+        <af-std-contact-email label="Spouse Email" only-primary="true" />
         <af-field field-name="do_not_email" field-type="checkbox" field-default="1" />
       </af-fieldset>
     </crm-ui-tab>
   </p>
 
   <af-fieldset af-name="parent">
-    <af-block-contact-address af-label="Address" />
+    <af-block-contact-address label="Address" />
   </af-fieldset>
 
   <!-- General elements: FIELDSET, UL, BUTTON, P, H1 should work anywhere -->
index 81e94a6bb12c8314e5614fded87017db84d9ecb2..4550e83047ec8d768e344c6a1a298d92c49c3645 100644 (file)
@@ -1,29 +1,29 @@
 <af-form ctrl="modelListCtrl">
   <!-- FIXME: Distinguish "Individual"s from "Household"s -->
-  <af-model type="Contact" af-name="parent" af-label="Parent" af-api4-params="{where: ['id','=', routeParams.cid]}"></af-model>
-  <af-model type="Contact" af-name="spouse" af-label="Spouse" af-contact-relationship="['Spouse of', 'parent']"></af-model>
-  <af-model type="Contact" af-name="home" af-label="Home"></af-model>
+  <af-model type="Contact" af-name="parent" label="Parent" af-api4-params="{where: ['id','=', routeParams.cid]}"></af-model>
+  <af-model type="Contact" af-name="spouse" label="Spouse" af-contact-relationship="['Spouse of', 'parent']"></af-model>
+  <af-model type="Contact" af-name="home" label="Home"></af-model>
 
   <!-- "parent" and "spouse" should be exported as variables in this scope -->
 
   <af-fieldset af-name="parent">
-    <af-block-contact-name af-label="My Name" />
-    <af-block-contact-email af-label="My Email" />
+    <af-block-contact-name label="My Name" />
+    <af-block-contact-email label="My Email" />
     <af-field field-name="do_not_email" />
   </af-fieldset>
 
   <af-fieldset af-name="spouse">
-    <af-block-contact-name af-label="Spouse Name" />
-    <af-block-contact-email af-label="Spouse Email" only-primary="true" />
+    <af-block-contact-name label="Spouse Name" />
+    <af-block-contact-email label="Spouse Email" only-primary="true" />
     <af-field field-name="do_not_email" field-type="checkbox" field-default="1" />
   </af-fieldset>
 
   <af-fieldset af-name="home">
-    <af-block-contact-name af-label="Home Name" />
+    <af-block-contact-name label="Home Name" />
   </af-fieldset>
 
   <af-fieldset af-name="parent">
-    <af-block-contact-address af-label="My Address" />
+    <af-block-contact-address label="My Address" />
   </af-fieldset>
 
   <!-- General elements: FIELDSET, UL, BUTTON, P, H1 should work anywhere -->