SEED-platform / seed

Standard Energy Efficiency Data (SEED) Platform™ is a web-based application that helps organizations easily manage data on the energy performance of large groups of buildings.
Other
106 stars 55 forks source link

Inventory List / Map: UBIDs not displaying #4606

Open RDmitchell opened 3 months ago

RDmitchell commented 3 months ago

instance: dev1 SHA: 77b9e4afa

When importing data with valid UBIDs, the UBIDs are not being displayed on the Inventory List / Map view.

However, they are displaying on the Inventory Detail view

Here is an example where the UBID is valid as shown in the PNNL UBID tool image

But it is not being displayed in the Inventory List Map view image

But is is displaying in the Inventory Detail view for the same property image

perryr16 commented 3 months ago

The issue appears to be related to cycle selection on the /inventory_map_controller.js

The map calls the inventory_service.get_properties function, which hits the backend /properties/filter endpoint. If no cycle is specified in the request, then the first cycle for the org is assigned.

The map controller calls the get_properties function with undefined as the cycle argument, leading to incorrect cycle data being displayed. The following is a possible solution

// /inventory_map_controller.js
-       const pagination = await fn(1, chunk, undefined, undefined).then((data) => data.pagination);
+       const pagination = await fn(1, chunk, $scope.cycle.selected)cycle, undefined).then((data) => data.pagination);

-       const page_promises = page_numbers.map((page) => fn(page, chunk, undefined, undefined).then((data) => {
+       const page_promises = page_numbers.map((page) => fn(page, chunk, $scope.cycle.selected_cycle, undefined).then((data) => {
perryr16 commented 3 months ago

@RDmitchell -- I'm hoping you can test something for me. My assumption is that the map is displaying the properties from the alphabetically first cycle in the org. Can you confirm that your alphabetically first cycle does not have properties with ubids? If it doesn't could you either add a few ubids to that cycle, or change the name of a cycle with ubids to appear first alphabetically.