diff --git a/seed/static/seed/js/controllers/menu_controller.js b/seed/static/seed/js/controllers/menu_controller.js index fafe714fb2..4764984966 100644 --- a/seed/static/seed/js/controllers/menu_controller.js +++ b/seed/static/seed/js/controllers/menu_controller.js @@ -50,10 +50,12 @@ angular.module('BE.seed.controller.menu', []) $scope.menu.create_project_error = false; $scope.menu.create_project_error_message = ""; $scope.saving_indicator = false; + $scope.menu.loading = false; $scope.menu.route_load_error = false; $scope.menu.user = {}; $scope.$on("$routeChangeError", function(event, current, previous, rejection) { + $scope.menu.loading = false; $scope.menu.route_load_error = true; if (rejection === "not authorized" || rejection === "Your page could not be located!") { $scope.menu.error_message = rejection; @@ -63,6 +65,7 @@ angular.module('BE.seed.controller.menu', []) $scope.menu.loading = next.controller === "mapping_controller"; }); $scope.$on("$routeChangeSuccess", function() { + $scope.menu.loading = false; $scope.menu.route_load_error = false; }); $scope.$on('app_error', function(event, data){ diff --git a/seed/templates/seed/index.html b/seed/templates/seed/index.html index 128f9cd83d..31dd015c03 100644 --- a/seed/templates/seed/index.html +++ b/seed/templates/seed/index.html @@ -20,7 +20,8 @@ {$ menu.error_message || 'There was an error loading the page' $} -
+

Please wait while your data is loaded...

+
{% include "seed/_footer.html" %} diff --git a/seed/views/main.py b/seed/views/main.py index 7395ace12b..0c6221fd6f 100644 --- a/seed/views/main.py +++ b/seed/views/main.py @@ -1152,15 +1152,25 @@ def get_column_mapping_suggestions(request): field_mappings = get_mappable_types() field_names = field_mappings.keys() column_types = {} - for c in Column.objects.filter( - Q(mapped_mappings__super_organization=org_id) | - Q(organization__isnull=True) - ).exclude( - # mappings get created to mappable types - # but we deal with them manually so don't - # include them here - column_name__in=field_names - ): + + # for c in Column.objects.filter( + # Q(mapped_mappings__super_organization=org_id) | + # Q(organization__isnull=True) + # ).exclude( + # # mappings get created to mappable types + # # but we deal with them manually so don't + # # include them here + # column_name__in=field_names + # ): + + # Note on exclude: + # mappings get created to mappable types but we deal with them manually + # so don't include them here + columns = Column.objects.select_related('unit').prefetch_related('schemas') \ + .filter(Q(mapped_mappings__super_organization=org_id) | Q(organization__isnull=True)) \ + .exclude(column_name__in=field_names) + + for c in columns: if c.unit: unit = c.unit.get_unit_type_display() else: