Previously in AnalysisTable, we called the API backendClient.systemOutputsGetById() to collect systemOutputs. And we used these to display the examples in our ExampleTable.
However, the examples we need already exist in the cases argument which are passed in while creating the AnalysisTable component, so the use of API can actually be removed. On top of that, the examples we show in the table should be derived from the cases in each bucket instead of the systemOutputs.
Changes
In this PR, I added a function convertCasesToSystemOutput() in .../AnalysisTable/utils.tsx which converts the cases format to systemOutput format. By using this function, we can replace the need to call the API.
Next steps
It also seems that all variables using the struct SystemOutput used in AnalysisTable could be changed to AnalysisCase after this PR. Since there are quite a few functions using SystemOutput structs, I will make these changes in a different PR.
Background
Previously in AnalysisTable, we called the API
backendClient.systemOutputsGetById()
to collect systemOutputs. And we used these to display the examples in our ExampleTable. However, the examples we need already exist in thecases
argument which are passed in while creating theAnalysisTable
component, so the use of API can actually be removed. On top of that, the examples we show in the table should be derived from the cases in each bucket instead of the systemOutputs.Changes
In this PR, I added a function
convertCasesToSystemOutput()
in.../AnalysisTable/utils.tsx
which converts the cases format to systemOutput format. By using this function, we can replace the need to call the API.Next steps
It also seems that all variables using the struct
SystemOutput
used in AnalysisTable could be changed toAnalysisCase
after this PR. Since there are quite a few functions usingSystemOutput
structs, I will make these changes in a different PR.