Skip to content

Commit

Permalink
Merge pull request #3005 from SEED-platform/fix-3001/taxlot-link
Browse files Browse the repository at this point in the history
fix: load taxlot instead of property for analyses
  • Loading branch information
macintoshpie committed Nov 10, 2021
2 parents d52620a + a53b91c commit 8292fe9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 9 additions & 7 deletions seed/static/seed/js/controllers/inventory_detail_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ angular.module('BE.seed.controller.inventory_detail', [])
$scope.profiles = profiles;
$scope.currentProfile = current_profile;

$scope.analysis = analyses_payload.analyses.sort(function(a, b) {
let key_a = new Date(a.end_time);
let key_b = new Date(b.end_time);
if (key_a > key_b) return -1;
if (key_a < key_b) return 1;
return 0;
})[0];
if (analyses_payload.analyses) {
$scope.analysis = analyses_payload.analyses.sort(function(a, b) {
let key_a = new Date(a.end_time);
let key_b = new Date(b.end_time);
if (key_a > key_b) return -1;
if (key_a < key_b) return 1;
return 0;
})[0];
}
$scope.users = users_payload.users;

// Flag columns whose values have changed between imports and edits.
Expand Down
1 change: 1 addition & 0 deletions seed/static/seed/js/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@ SEED_app.config(['stateHelperProvider', '$urlRouterProvider', '$locationProvider
return promise;
}],
analyses_payload: ['inventory_service', 'analyses_service', '$stateParams', 'inventory_payload', function (inventory_service, analyses_service, $stateParams, inventory_payload) {
if ($stateParams.inventory_type !== 'properties') return [];
return analyses_service.get_analyses_for_canonical_property(inventory_payload.property.id);
}],
columns: ['$stateParams', 'inventory_service', function ($stateParams, inventory_service) {
Expand Down

0 comments on commit 8292fe9

Please sign in to comment.