Closed chriswhong closed 2 years ago
I pushed a commit which:
fetchDsPreview
in DatasetPreviewPage
API_PREVIEW_XXX
reducers in dsPreviewState
loadDataset
from DatasetWrapper
This way, we have everything only fetching data when it needs to:
DatasetWrapper
gets the header, workflow, and runlog. These are what is needed for all dataset routes. (ideally we would be able to determine in the call to header whether there is a workflow and run activity so these calls can be moved down to their respective route components, but we can do that later)DatasetPreviewPage
fetches the previewDatasetComponents
fetches whatever dataset version is specified.I think #3 you mentioned above is a separate issue, we should make sure preview is updated after a commit.
Closes #266
We had api calls spread across
DatasetRoutes
,DatasetWrapper
, andDatasetPreviewPage
, resulting in 3 separate calls to the same endpoint (/ds/get
) when a preview route was loaded.dataset
andpreview
but they are both populated by the same data, so this refactors the reducers for both to listen for the same action.DatasetRoutes
are moved down intoDatasetWrapper
so they are all happening in the same place, leavingDatasetRoutes
to just be a router, not a router and a data-getter.