From adf6210134549a0a31c7c6a3d907a7663d37e8b3 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 7 Apr 2021 22:11:03 -0400 Subject: [PATCH] Afform - Fix endless spinner on "New Search Display" dropdown when there are none --- ext/afform/admin/ang/afAdmin/afAdminList.controller.js | 5 +++-- ext/afform/admin/ang/afAdmin/afAdminList.html | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ext/afform/admin/ang/afAdmin/afAdminList.controller.js b/ext/afform/admin/ang/afAdmin/afAdminList.controller.js index e163984260..f966af1746 100644 --- a/ext/afform/admin/ang/afAdmin/afAdminList.controller.js +++ b/ext/afform/admin/ang/afAdmin/afAdminList.controller.js @@ -13,12 +13,12 @@ $scope.types = _.indexBy(ctrl.tabs, 'name'); _.each(['form', 'block', 'search'], function(type) { if ($scope.types[type]) { - $scope.types[type].options = []; if (type === 'form') { $scope.types.form.default = '#create/form/Individual'; } } }); + $scope.types.system.options = false; this.afforms = _.transform(afforms, function(afforms, afform) { afform.type = afform.type || 'system'; @@ -35,7 +35,7 @@ this.createLinks = function() { ctrl.searchCreateLinks = ''; - if ($scope.types[ctrl.tab].options.length) { + if ($scope.types[ctrl.tab].options) { return; } var links = []; @@ -66,6 +66,7 @@ $scope.types.block.options = _.sortBy(links, function(item) { return item.url === '#create/block/*' ? '0' : item.label; }); + // Add divider after the * entity (content block) $scope.types.block.options.splice(1, 0, {'class': 'divider', label: ''}); } diff --git a/ext/afform/admin/ang/afAdmin/afAdminList.html b/ext/afform/admin/ang/afAdmin/afAdminList.html index c6ff0b7f86..276e4d0538 100644 --- a/ext/afform/admin/ang/afAdmin/afAdminList.html +++ b/ext/afform/admin/ang/afAdmin/afAdminList.html @@ -10,7 +10,7 @@
-