Skip to content

Commit

Permalink
Merge branch 'develop' into map-get-all-properties-at-once
Browse files Browse the repository at this point in the history
  • Loading branch information
kflemin committed Jan 11, 2024
2 parents bf48635 + 036122d commit d2b34d2
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SEED Platform™, Copyright (c) 2017, 2023 Alliance for Sustainable Energy, LLC, and other contributors.
SEED Platform™, Copyright (c) 2017, 2024 Alliance for Sustainable Energy, LLC, and other contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

# General information about the project.
project = 'SEED Platform'
copyright = '2017, 2023, Alliance for Sustainable Energy, LLC, and other contributors.'
copyright = '2017, 2024, Alliance for Sustainable Energy, LLC, and other contributors.'
author = 'Alliance for Sustainable Energy, LLC, and other contributors.'

# The version info for the project you're documenting, acts as replacement for
Expand Down
24 changes: 22 additions & 2 deletions seed/static/seed/js/controllers/inventory_list_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ angular.module('BE.seed.controller.inventory_list', []).controller('inventory_li
'$state',
'$stateParams',
'$q',
'$timeout',
'inventory_service',
'label_service',
'data_quality_service',
Expand Down Expand Up @@ -45,6 +46,7 @@ angular.module('BE.seed.controller.inventory_list', []).controller('inventory_li
$state,
$stateParams,
$q,
$timeout,
inventory_service,
label_service,
data_quality_service,
Expand Down Expand Up @@ -1829,7 +1831,7 @@ angular.module('BE.seed.controller.inventory_list', []).controller('inventory_li
fastWatch: true,
flatEntityAccess: true,
gridMenuShowHideColumns: false,
showTreeExpandNoChildren: false,
hidePinRight: true,
saveFocus: false,
saveGrouping: false,
saveGroupingExpandedStates: false,
Expand All @@ -1840,6 +1842,7 @@ angular.module('BE.seed.controller.inventory_list', []).controller('inventory_li
saveTreeView: false,
saveVisible: false,
saveWidths: false,
showTreeExpandNoChildren: false,
useExternalFiltering: true,
useExternalSorting: true,
columnDefs: $scope.columns,
Expand Down Expand Up @@ -1903,7 +1906,24 @@ angular.module('BE.seed.controller.inventory_list', []).controller('inventory_li
}
}, 1000)
);
gridApi.pinning.on.columnPinned($scope, saveSettings);
gridApi.pinning.on.columnPinned($scope, (colDef, container) => {
if (container) {
saveSettings();
} else {
// Hack to fix disappearing filter after unpinning a column
const gridCol = gridApi.grid.columns.find(({ colDef: { name } }) => name === colDef.name);
if (gridCol) {
gridCol.colDef.visible = false;
gridApi.grid.refresh();

$timeout(() => {
gridCol.colDef.visible = true;
gridApi.grid.refresh();
saveSettings();
}, 0);
}
}
});

const selectionChanged = () => {
const selected = gridApi.selection.getSelectedRows();
Expand Down
2 changes: 1 addition & 1 deletion seed/static/seed/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3745,7 +3745,7 @@ $pairedCellWidth: 60px;
div {
position: relative;
text-align: right;
top: -2px;
top: -6px;
width: 20px;
}
}
Expand Down
7 changes: 2 additions & 5 deletions seed/utils/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def _usages_by_exact_times(self, page, per_page):
if self.showOnlyOccupiedReadings:
sensor_readings = sensor_readings.filter(is_occupied=True)

# order by id **greatly** speeds this up (cause of indexing, I think
timestamps = sensor_readings.distinct('timestamp').order_by("timestamp", "id").values_list("timestamp", flat=True)
timestamps = list(sensor_readings.distinct('timestamp').order_by('timestamp').values_list("timestamp", flat=True))
paginator = Paginator(timestamps, per_page)
timestamps_in_page = paginator.page(page)

Expand All @@ -78,9 +77,7 @@ def _usages_by_exact_times(self, page, per_page):
for sensor in self.sensors
}

sensor_readings = SensorReading.objects.filter(timestamp__range=[earliest_time, latest_time], sensor__in=self.sensors)
if self.showOnlyOccupiedReadings:
sensor_readings = sensor_readings.filter(is_occupied=True)
sensor_readings = sensor_readings.filter(timestamp__range=[earliest_time, latest_time])

for sensor_reading in sensor_readings.all():
timestamp = sensor_reading.timestamp.astimezone(tz=self.tz).strftime(time_format)
Expand Down
8 changes: 4 additions & 4 deletions vendors/package-lock.json

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

2 changes: 1 addition & 1 deletion vendors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"angular-translate-interpolation-messageformat": "^2.19.0",
"angular-translate-loader-static-files": "^2.19.0",
"angular-ui-bootstrap": "^2.5.6",
"angular-ui-grid": "^4.12.2",
"angular-ui-grid": "^4.12.4",
"angular-ui-notification": "^0.3.6",
"angular-ui-router": "^1.0.30",
"angular-ui-router.statehelper": "^1.3.1",
Expand Down

0 comments on commit d2b34d2

Please sign in to comment.