Skip to content

Commit

Permalink
Merge pull request #220 from SEED-platform/revert-219-9-loading-indic…
Browse files Browse the repository at this point in the history
…ator

Revert "Issue #9 - Mapping page loading indicator "
  • Loading branch information
mmclark committed Apr 28, 2015
2 parents ed5fc3b + 453f9a4 commit a96f2f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
6 changes: 0 additions & 6 deletions seed/static/seed/js/controllers/menu_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,16 @@ 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;
}
});
$scope.$on("$routeChangeStart", function($event, next, current) {
$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){
Expand Down
3 changes: 1 addition & 2 deletions seed/templates/seed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
{$ menu.error_message || 'There was an error loading the page' $}
</div>
</div>
<div class="section_tab_container" ng-show="menu.loading"><p>Please wait while your data is loaded...</p></div>
<div ng-hide="menu.loading" data-ng-view="" id="ng-view"></div>
<div data-ng-view="" id="ng-view"></div>
</div>

{% include "seed/_footer.html" %}
Expand Down
18 changes: 9 additions & 9 deletions seed/views/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,15 +1147,15 @@ def get_column_mapping_suggestions(request):
field_mappings = get_mappable_types()
field_names = field_mappings.keys()
column_types = {}

# 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:
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
):
if c.unit:
unit = c.unit.get_unit_type_display()
else:
Expand Down

0 comments on commit a96f2f9

Please sign in to comment.