SonarSoftwareInc / customer_portal

A prebuilt customer portal for Sonar.
https://sonar.software
25 stars 51 forks source link

AB#3212 Don't break the page if there is no historical data usage. #128

Closed Godron629 closed 3 years ago

Godron629 commented 3 years ago

https://dev.azure.com/sonarsoftware/Sonar/_workitems/edit/3212

In sonar (v2), whenever an account transitions from some status to 'Active', a HistoricalDataUsage is created for it. This didn't always happen, though - so there are accounts with no HistoricalDataUsage, which will break the Data Usage and Billing pages of the Customer Portal.

Here, we add some conditions to provide default values if the history doesn't exist.

There is another PR in sonar to create DataUsageHistories for all active accounts, which is this: https://github.com/SonarSoftwareInc/sonar/pull/3305. Which should prevent these conditions from ever being needed.

Screenshot from 2021-07-07 14-59-12

Screenshot from 2021-07-07 14-59-24

Instead of

Screenshot from 2021-07-07 15-00-33 Screenshot from 2021-07-07 15-00-19