Closed jswatsch closed 3 weeks ago
@sriram04 will make meeting with @dkudeki to discuss blocker
@sriram04 I think the structure that makes the most sense for this is to extend the functionality of the existing get_workset_metadata()
call in /htrc/torchlite/routers/worksets.py
in torchlite-backend
. You can add an optional parameter to that route called filtered
that defaults to "false", but when it is set to "true" you call apply_filters()
on the list of volumes that are generated in that function.
On torchlite-frontend
to get it to call this new route on the backend, you would have to setup a function in /src/services/index.tsx
that calls /api/worksets/{worksetId}/metadata
. Then you would have to build that api call in a new file called /src/pages/api/worksets/[id]/metadata.tsx
. You can look here for an example of how to call the backend function you want (without the filter flag) from within that file.
@sriram04 Here's the clarifications based on our last discussion. You're going to need to create a new route in /htrc/torchlite/routers/dashboards.py
in torchlite-backend
. The route should be /{dashboard_id}/{data_type}
where data_type
could be either "data" or "metadata". This should also support an optional parameter called filtered
that defaults to false. The logic for this route will be like a simpler version of get_widget_data()
. You'll get the dashboard, get the workset id from that, use that to get the volumes which will be either metadata or full text based on the data_type
value, then you'll feed that list of volumes plus the dashboard filters into apply_filters()
and return the result.
On torchlite-frontend
you'll need to modify the api to call torchlite-backend
. Add a route in /src/services/index.tsx
that calls /api/dashboards/[id]/[data_type]
and then create a file /src/pages/api/dashboards/[id]/[data_type].tsx
that holds the logic for calling torchlite-backend
. This api call should service all three download types: full, full filtered, and metadata filtered.
Sriram: backend is working. Deren has reviewed the work. Front-end: looks good but needs to link to the backend. New backend API calls have been created.
Implement the download the data functionality. Currently, only the unfiltered download is functional.