diff --git a/LICENSE.md b/LICENSE.md index e03bc2187b..45d140df16 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -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 diff --git a/docs/source/conf.py b/docs/source/conf.py index 5c77244de8..ac5d5c046f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 diff --git a/seed/static/seed/js/controllers/inventory_list_controller.js b/seed/static/seed/js/controllers/inventory_list_controller.js index 89557faf79..02382d338a 100644 --- a/seed/static/seed/js/controllers/inventory_list_controller.js +++ b/seed/static/seed/js/controllers/inventory_list_controller.js @@ -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', @@ -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, @@ -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, @@ -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, @@ -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(); diff --git a/seed/static/seed/scss/style.scss b/seed/static/seed/scss/style.scss index e866693c99..e4fcbb0a11 100755 --- a/seed/static/seed/scss/style.scss +++ b/seed/static/seed/scss/style.scss @@ -3745,7 +3745,7 @@ $pairedCellWidth: 60px; div { position: relative; text-align: right; - top: -2px; + top: -6px; width: 20px; } } diff --git a/seed/utils/sensors.py b/seed/utils/sensors.py index 1ef0afddcd..0ffa6f4df7 100644 --- a/seed/utils/sensors.py +++ b/seed/utils/sensors.py @@ -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) @@ -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) diff --git a/vendors/package-lock.json b/vendors/package-lock.json index 70c26d79d7..e522dafae2 100644 --- a/vendors/package-lock.json +++ b/vendors/package-lock.json @@ -24,7 +24,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", @@ -1985,9 +1985,9 @@ "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==" }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "funding": [ { "type": "individual", diff --git a/vendors/package.json b/vendors/package.json index 22c18dc050..1924f0ee7d 100644 --- a/vendors/package.json +++ b/vendors/package.json @@ -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",