From e73f06cd2c8df557522c9eb30c38f4062b1e4bb5 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 2 Aug 2021 14:29:10 -0400 Subject: [PATCH] Afform - Use correct contact type when loading field options Fixes dev/core#2702 --- ext/afform/admin/ang/afGuiEditor/afGuiEntity.component.js | 8 ++++---- ext/afform/admin/ang/afGuiEditor/afGuiEntity.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/afform/admin/ang/afGuiEditor/afGuiEntity.component.js b/ext/afform/admin/ang/afGuiEditor/afGuiEntity.component.js index 8a806cfd44..6786029542 100644 --- a/ext/afform/admin/ang/afGuiEditor/afGuiEntity.component.js +++ b/ext/afform/admin/ang/afGuiEditor/afGuiEntity.component.js @@ -18,12 +18,12 @@ $scope.elementList = []; $scope.elementTitles = []; - function getEntityType() { + this.getEntityType = function() { return (ctrl.entity.type === 'Contact' && ctrl.entity.data) ? ctrl.entity.data.contact_type || 'Contact' : ctrl.entity.type; - } + }; $scope.getMeta = function() { - return afGui.meta.entities[getEntityType()]; + return afGui.meta.entities[ctrl.getEntityType()]; }; $scope.getAdminTpl = function() { @@ -54,7 +54,7 @@ $scope.fieldList.length = 0; $scope.fieldList.push({ entityName: ctrl.entity.name, - entityType: getEntityType(), + entityType: ctrl.getEntityType(), label: ts('%1 Fields', {1: $scope.getMeta().label}), fields: filterFields($scope.getMeta().fields) }); diff --git a/ext/afform/admin/ang/afGuiEditor/afGuiEntity.html b/ext/afform/admin/ang/afGuiEditor/afGuiEntity.html index 57f26202cf..a92c376322 100644 --- a/ext/afform/admin/ang/afGuiEditor/afGuiEntity.html +++ b/ext/afform/admin/ang/afGuiEditor/afGuiEntity.html @@ -3,7 +3,7 @@ {{:: ts('Values:') }}

- + -- 2.25.1