openflighthpc / flight-control

0 stars 0 forks source link

Fix chart breaking if showing part of a cycle with future over budget switch offs #40

Closed timalces closed 2 years ago

timalces commented 2 years ago

Currently if a user tries to show a costs chart that includes part of a billing cycle and that cycle has over budget switch offs later than the chart displays, the chart breaks. This prevents interacting with the chart (hover effects and toggling datasets) and leads to incorrect compute unit totals being shown.

This is due to the backend giving all over budget switch offs for that cycle, and no checks in the front end that the switch offs it tries to render are within the chart's date range.

This PR therefore changes the backend logic to only provide over budget switch offs within the chart's actual date range, and adds some front end checks to prevent trying to render a switch off out of range.

Peek 2022-05-31 15-36