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.
Within the inventory_list_controller there are 10 code blocks that call the load_inventory function, and only 4 that are called outside of a modal close.
filterUsingLabels
update_cycle
gridApi.core.on.filterChanged
gridApi.core.on.sortChanged
filterUsingLabels is responsible for the initial page load. If the ui-grid table has existing filters or sorts, their respective functions gridApi.core.on.filterChanged and gridApi.core.on.sortChanged will each be called leading to 3 possible table loads.
What's this PR do?
Combines the .filterChanged and sortChanged into a single call filterOrSortChanged as they use the same code.
On initial load, check for filters or sorts. If they exist, ignore the first call to filterOrSortChanged
How should this be manually tested?
Place a console.log('load_inventory') statement in the function load_inventory.
Add a few sorts and filters. Refresh and track the number of logs.
Try to further adjust the table (pinned columns, hidden columns, label filters...) and make sure it still loads only once
Any background context you want to provide?
Within the
inventory_list_controller
there are 10 code blocks that call theload_inventory
function, and only 4 that are called outside of a modal close.filterUsingLabels
update_cycle
gridApi.core.on.filterChanged
gridApi.core.on.sortChanged
filterUsingLabels
is responsible for the initial page load. If the ui-grid table has existing filters or sorts, their respective functionsgridApi.core.on.filterChanged
andgridApi.core.on.sortChanged
will each be called leading to 3 possible table loads.What's this PR do?
.filterChanged
andsortChanged
into a single callfilterOrSortChanged
as they use the same code.filterOrSortChanged
How should this be manually tested?
console.log('load_inventory')
statement in the functionload_inventory
.Try to further adjust the table (pinned columns, hidden columns, label filters...) and make sure it still loads only once
What are the relevant tickets?
4308
Screenshots (if appropriate)