SearchKit - Add UI for multiple function arguments
[civicrm-core.git] / ext / search_kit / ang / crmSearchAdmin / compose.html
index 6bcf443b9148e60baf06b4b84bd4ff792bc354aa..6437a92b5782c63aa050f2db07e8ec6d20b69a01 100644 (file)
                crm-ui-select="{placeholder: ts('Group By'), data: fieldsForGroupBy, dropdownCss: {width: '300px'}}"
                on-crm-ui-select="$ctrl.addParam('groupBy', selection)" >
       </div>
-      <fieldset id="crm-search-build-functions">
-        <legend ng-click="controls.showFunctions = !controls.showFunctions">
-          <i class="crm-i fa-caret-{{ !controls.showFunctions ? 'right' : 'down' }}"></i>
-          {{:: ts('Field Transformations') }}
-        </legend>
-        <div ng-if="!!controls.showFunctions">
-          <fieldset ng-repeat="col in $ctrl.savedSearch.api_params.select" ng-if="!$ctrl.isPseudoField(col)">
-            <crm-search-function expr="$ctrl.savedSearch.api_params.select[$index]"></crm-search-function>
-          </fieldset>
-        </div>
-      </fieldset>
     </fieldset>
   </div>
   <div class="crm-search-criteria-column">
     </fieldset>
   </div>
 </div>
+<fieldset id="crm-search-build-functions">
+  <legend ng-click="controls.showFunctions = !controls.showFunctions">
+    <i class="crm-i fa-caret-{{ !controls.showFunctions ? 'right' : 'down' }}"></i>
+    {{:: ts('Field Transformations') }}
+  </legend>
+  <div ng-if="!!controls.showFunctions">
+    <!-- Must use track by $index with an array of primitives, and manually refresh this loop when indexes change -->
+    <fieldset ng-repeat="col in $ctrl.savedSearch.api_params.select track by $index" ng-if="!$ctrl.isPseudoField(col)">
+      <crm-search-function expr="$ctrl.savedSearch.api_params.select[$index]"></crm-search-function>
+    </fieldset>
+  </div>
+</fieldset>