whole-tale / ngx-dashboard

WholeTale Dashboard rewritten in Angular
MIT License
0 stars 3 forks source link

Add ability to create a new tale based on a version #267

Closed craig-willis closed 2 years ago

craig-willis commented 2 years ago

Feature request: Add the ability to open a version of a tale as a new tale.

Source:

From https://wholetale.slack.com/archives/C02FQLTR67P/p1648577005526759:

Out of curiosity: Saved versions of the Tale can be renamed/deleted/downloaded. Why is "open in a new tale" not an option? It would seem a natural step (emulating the export-to-zenodo-then-re-import-to-WT functionality). The functionality is there, just nobody asked for it and wanted a button Can I ask for it? That makes n=1...

Xarthisius commented 2 years ago

Streamline the following (given taleId and versionId):

  1. GET /version : taleId=taleId -> name
  2. POST /tale/{id}/copy : id=taleId -> new_taleId
  3. GET /version : taleId=new_taleId -> iterate over list to match name -> new_versionId
  4. PUT /tale/{id}/restore : id=new_taleId, versionId=new_versionId

? The tricky part is getting new_versionId, but I guess we can match by name. It's unique. Sounds like a lot of calls. Probably easier to do it on the backend.

craig-willis commented 2 years ago

At first glance it seems a little clearer to just do something like:

POST /tale/{id}/copy?versionId={version_id}

Where the resulting tale contains only the selected version.

Xarthisius commented 2 years ago

At first glance it seems a little clearer to just do something like:

POST /tale/{id}/copy?versionId={version_id}

Where the resulting tale contains only the selected version.

That's what I've decided to do.