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
107 stars 55 forks source link

Fix inventory list timing console errors #4478

Closed perryr16 closed 6 months ago

perryr16 commented 6 months ago

Any background context you want to provide?

There were two console errors that were raised when a user navigated away from the inventory list before if finished loading.

  1. inventory_list_controller.js:381 Uncaught TypeError: Cannot read properties of null (reading 'getElementsByTagName')
  2. inventory_list_controller.js:1636 Asked to addToGridMenu, but gridMenuScope not present. Timing issue? Please log issue with ui-grid

What's this PR do?

  1. Assigns document.getElementById(elementId) to a new variable (element) on page load prior to executing the interval, allowing the delayed code to access the values and functions of element
  2. Checks for the presence of the gridMenuScope before attempting to add to it.

How should this be manually tested?

Navigate to the inventory list, and just as the spinner appears navigate away. Monitor the console

What are the relevant tickets?

4478

4333

Screenshots (if appropriate)

Screenshot 2024-01-10 at 4 46 18 PM