AfformAdmin - use api-callback for loading metadata
authorColeman Watts <coleman@civicrm.org>
Mon, 25 Jan 2021 15:51:55 +0000 (10:51 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 30 Jan 2021 01:41:05 +0000 (20:41 -0500)
commit490565d08a13dbd2fd2a7887f29ff9c5fe2f187c
treea0985ca7de0f852d9c3755d896dc8670b3d35b80
parentecb9d1ebc9d6c6d2afba50eaaec5e94fae56b116
AfformAdmin - use api-callback for loading metadata

This switches from pre-loading all field data, to a more incremental approach of only loading the data needed by the form being edited,
then loading more metadata if additional entities or blocks are added to the form.

The Afform.loadAdminData api action is added to facilitate loading metadata for different types of afforms,
and incrementally loading metadata for new entities & blocks as they are added to an afform being edited.
18 files changed:
CRM/Utils/Array.php
ext/afform/admin/Civi/AfformAdmin/AfformAdminMeta.php [moved from ext/afform/admin/CRM/AfformAdmin/Utils.php with 51% similarity]
ext/afform/admin/Civi/Api4/Action/Afform/LoadAdminData.php [new file with mode: 0644]
ext/afform/admin/afformEntities/Activity.php
ext/afform/admin/afformEntities/Household.php
ext/afform/admin/afformEntities/Individual.php
ext/afform/admin/afformEntities/Organization.php
ext/afform/admin/ang/afAdmin.ang.php
ext/afform/admin/ang/afAdmin.js
ext/afform/admin/ang/afAdmin/afAdminGui.controller.js
ext/afform/admin/ang/afGuiEditor.ang.php
ext/afform/admin/ang/afGuiEditor.js
ext/afform/admin/ang/afGuiEditor/afGuiEditor.component.js
ext/afform/admin/ang/afGuiEditor/afGuiEditorPalette.html
ext/afform/admin/ang/afGuiEditor/afGuiEntity.html
ext/afform/admin/ang/afGuiEditor/elements/afGuiContainer.component.js
ext/afform/admin/ang/afGuiEditor/elements/afGuiContainer.html
ext/afform/admin/info.xml