Skip to content

Commit

Permalink
Merge pull request #1925 from SEED-platform/sticky-headers
Browse files Browse the repository at this point in the history
Sticky table headers
  • Loading branch information
nllong committed Jul 19, 2019
2 parents 7f5781e + 8974e13 commit 6535505
Show file tree
Hide file tree
Showing 21 changed files with 5,001 additions and 386 deletions.
4,442 changes: 4,442 additions & 0 deletions npm-shrinkwrap.json

Large diffs are not rendered by default.

57 changes: 21 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"eslint-plugin-angular": "~4.0.1",
"eslint-plugin-lodash": "~5.1.0",
"eslint-plugin-protractor": "~1.41.1",
"lodash": "~4.17.14",
"postcss-cli": "~6.1.2",
"protractor": "~5.4.2",
"webdriver-manager": "~12.1.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,10 @@ angular.module('BE.seed.controller.inventory_detail', [])

$scope.export_building_sync_xlsx = function () {
var filename = 'buildingsync_property_' + $stateParams.view_id + '.xlsx';
var profileId = null;
if ($scope.currentProfile) {
profileId = $scope.currentProfile.id;
}
// var profileId = null;
// if ($scope.currentProfile) {
// profileId = $scope.currentProfile.id;
// }

$http.post('/api/v2.1/tax_lot_properties/export/', {
ids: [$stateParams.view_id],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ angular.module('BE.seed.controller.inventory_detail_meters', [])
$scope.data = property_meter_usage.readings;
$scope.has_readings = $scope.data.length > 0;

$scope.meter_selections = _.map(meters, function(meter) {
$scope.meter_selections = _.map(meters, function (meter) {
return {
selected: true,
label: meter.type + ' - ' + meter.source + ' - ' + meter.source_id,
value: meter.id,
value: meter.id
};
});
$scope.has_meters = $scope.meter_selections.length > 0;

$scope.meter_selection_toggled = function(is_open) {
$scope.meter_selection_toggled = function (is_open) {
if (!is_open) {
var updated_selections = _.map(_.filter($scope.meter_selections, ['selected', false]), 'value');
if (!_.isEqual($scope.excluded_meter_ids, updated_selections)) {
Expand Down
4 changes: 2 additions & 2 deletions seed/static/seed/js/controllers/inventory_list_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ angular.module('BE.seed.controller.inventory_list', [])
inventory_type: function () {
return $scope.inventory_type;
},
has_meters: function() {
has_meters: function () {
if ($scope.inventory_type === 'properties') {
var inventory_ids = $scope.selectedOrder.slice().reverse();
return inventory_service.properties_meters_exist(inventory_ids).then(function (has_meters) {
Expand All @@ -335,7 +335,7 @@ angular.module('BE.seed.controller.inventory_list', [])
} else {
return false;
}
},
}
}
});
modalInstance.result.then(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ angular.module('BE.seed.controller.rename_column_modal', [])
} else {
return $scope.settings.user_acknowledgement;
}
}
};
}]);
7 changes: 3 additions & 4 deletions seed/static/seed/js/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ var SEED_app = angular.module('BE.seed', [
$interpolateProvider.startSymbol('{$');
$interpolateProvider.endSymbol('$}');
$qProvider.errorOnUnhandledRejections(false);
}]
);
}]);

/**
* Adds the Django CSRF token to all $http requests
Expand Down Expand Up @@ -1105,7 +1104,7 @@ SEED_app.config(['stateHelperProvider', '$urlRouterProvider', '$locationProvider
templateUrl: static_url + 'seed/partials/inventory_map.html',
controller: 'inventory_map_controller',
resolve: {
inventory: ['$stateParams', 'inventory_service', function ($stateParams, inventory_service ) {
inventory: ['$stateParams', 'inventory_service', function ($stateParams, inventory_service) {
// if ($stateParams.inventory_type === 'properties') {
return inventory_service.get_properties(1, undefined, undefined, undefined);
// } else if ($stateParams.inventory_type === 'taxlots') {
Expand Down Expand Up @@ -1178,7 +1177,7 @@ SEED_app.config(['stateHelperProvider', '$urlRouterProvider', '$locationProvider
if (currentProfile) inventory_service.save_last_detail_profile(currentProfile.id, $stateParams.inventory_type);
return currentProfile;
}],
labels_payload: ['$stateParams', 'label_service', 'inventory_payload', function ($stateParams, label_service, inventory_payload) {
labels_payload: ['$stateParams', 'inventory_payload', 'label_service', function ($stateParams, inventory_payload, label_service) {
return label_service.get_labels([$stateParams.view_id], {
inventory_type: $stateParams.inventory_type
});
Expand Down
14 changes: 7 additions & 7 deletions seed/static/seed/js/services/inventory_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ angular.module('BE.seed.service.inventory', []).factory('inventory_service', [
*
*/

inventory_service.properties_meters_exist = function (inventory_ids) {
return $http.post('/api/v2/properties/meters_exist/', {
inventory_ids: inventory_ids,
}).then(function (response) {
return response.data;
});
}
inventory_service.properties_meters_exist = function (inventory_ids) {
return $http.post('/api/v2/properties/meters_exist/', {
inventory_ids: inventory_ids
}).then(function (response) {
return response.data;
});
};

inventory_service.get_property = function (view_id) {
// Error checks
Expand Down
9 changes: 5 additions & 4 deletions seed/static/seed/js/services/meter_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ angular.module('BE.seed.service.meter', [])
function ($http) {
var meter_factory = {};

meter_factory.get_meters = function (property_view_id, organization_id, interval) {
meter_factory.get_meters = function (property_view_id) {
return $http.post('/api/v2/meters/property_meters/', {
property_view_id: property_view_id,
property_view_id: property_view_id
}).then(function (response) {
return response.data;
});
};

meter_factory.property_meter_usage = function (property_view_id, organization_id, interval, excluded_meter_ids = []) {
meter_factory.property_meter_usage = function (property_view_id, organization_id, interval, excluded_meter_ids) {
if (_.isUndefined(excluded_meter_ids)) excluded_meter_ids = [];
return $http.post('/api/v2/meters/property_meter_usage/', {
property_view_id: property_view_id,
organization_id: organization_id,
interval: interval,
excluded_meter_ids: excluded_meter_ids,
excluded_meter_ids: excluded_meter_ids
}).then(function (response) {
return response.data;
});
Expand Down
30 changes: 2 additions & 28 deletions seed/static/seed/partials/accounts.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,6 @@ <h1 translate>Organizations</h1>
</div>
</div>
<div class="section">
<!--<div class="section_header_container" ng-if="NEEDS_IMPLEMENTATION">
<div class="section_header">
<h2><i class="fa fa-users"></i> Pending Organization Invites</h2>
</div>
</div>
<div class="section_content_container" ng-if="NEEDS_IMPLEMENTATION">
<div class="section_content">
<div class="table_list_container">
<table class="table table-striped table_highlight_first">
<thead>
<tr>
<th class="account_pending left">Name of Pending Organization</th>
<th class="account_pending right"></th>
</tr>
</thead>
<tbody>
<tr>
<td class="account_pending left">Julie Daily (<strong>Owner</strong>) would like to add you in the role of <strong>Member</strong> to this organization.</td>
<td class="account_pending right" style="text-align:right;"><a class="btn btn-primary" href="">Accept</a> <a class="btn btn-default" href="">Reject</a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>-->
<div class="section_header_container" ng-if="orgs_I_own.length">
<div class="section_header">
<h2><i class="fa fa-users"></i> {$:: 'Organizations I Manage' | translate $}</h2>
Expand All @@ -43,11 +18,10 @@ <h2><i class="fa fa-users"></i> {$:: 'Organizations I Manage' | translate $}</h2
<div class="section_content_container" ng-if="orgs_I_own.length">
<div class="section_content">
<div id="org-owned-tables" class="table_list_container">
<table class="table table-striped table_highlight_first" ng-repeat="org in orgs_I_own">
<table id="organizations-table" class="table table-striped table_highlight_first" ng-repeat="org in orgs_I_own">
<thead>
<tr>
<th colspan="2" translate>Organization</th>
<!-- <th>Org Level</th> -->
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -99,7 +73,7 @@ <h2><i class="fa fa-users"></i> {$:: 'Organizations I Belong To' | translate $}<
<div class="section_content_container">
<div class="section_content">
<div class="table_list_container" id="org-member-tables">
<table class="table table-striped table_highlight_first">
<table id="my-organizations-table" class="table table-striped table_highlight_first">
<thead>
<tr>
<th translate>Organization Name</th>
Expand Down
2 changes: 1 addition & 1 deletion seed/static/seed/partials/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h2><i class="fa fa-trash-o"></i> {$:: 'Remove inventory and organizations' | tr
<div class="section_content_container org_user_admin container-fluid">
<div class="section_content row">
<div class="table_list_container remove_buildings_table col-sm-5">
<table class="table table-striped">
<table id="admin-organizations-table" class="table table-striped">
<thead>
<tr>
<th translate>Parent ID</th>
Expand Down

0 comments on commit 6535505

Please sign in to comment.