Open emclaren opened 5 years ago
Hi @misslivirose, If the button is as a thumbnail dropdown, we don't have much context about the project ( e.g current editor screen in-state). So, can we keep that inside the project? Looking forward to your comments on this.
@tharun208 Actually I think we can do this in the ProjectsPage in addition to the Save As option that you added to the editor menu.
Take a look at the createProject
function in Api.js
https://github.com/mozilla/Spoke/blob/master/src/api/Api.js#L418
We can load the project file using the url returned from the projects API: https://dev.reticulum.io/api/v1/projects
and then create a new project using that JSON and whatever new name we want to give it.
sure @robertlong Will Add these changes and raise a PR
But @robertlong, If we use the above API means we need to have the thumbnail image of the scene because it is required by the createProject
API
@tharun208 yeah that is also returned by the https://dev.reticulum.io/api/v1/projects
API. Rather than reusing the same thumbnail, I'd make a copy by downloading the file and reuploading. We should probably just have a server endpoint that does this, but until then we could implement it this way.
Here's an example response from that API endpoint:
{
"projects": [
{
"name": "Tutorial",
"project_id": "example",
"project_url": "https://hubs-upload-cdn.com/files/example.json",
"thumbnail_url": "https://hubs-upload-cdn.com/files/example.jpg"
}
]
}
So right now we will be copying the same project_url
and thumbnail_url
and reusing it? @robertlong
It would be nice to be able to take a scene I already have, save a new version and modify it so the original stays untouched. Currently, users can export and import a spoke file, but it would be nice if there was an easier way.
Either a "Save as" button inside the project, or maybe a "Duplicate" button in the project thumbnail dropdown (see screenshot).