Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

client: Provide a very easy way to import a project #46

Open
elisee opened this issue Jan 13, 2016 · 14 comments
Open

client: Provide a very easy way to import a project #46

elisee opened this issue Jan 13, 2016 · 14 comments

Comments

@elisee
Copy link
Contributor

elisee commented Jan 13, 2016

One should be able to upload a project ZIP file to a server from the server hub and have it be unzipped and loaded automatically. Also an option to import from URL.

@made-by-chris
Copy link

I'd be interested in helping with this. Perhaps this feature could be introduced alongside a delete button in the UI.

@elisee
Copy link
Contributor Author

elisee commented Feb 1, 2016

Cool, sounds great! I created a separate issue for project deletion: #99.

The way I see it, for project upload:

  1. We could add an import project button at the top of the project hub. The ZIP should be uploaded as-is to the server through socket.io.
  2. The server would unpack it in a temporary place (and check that it has the proper structure probably?)
  3. fs.rename the temporary folder into the user data projects folder
  4. Load it through ProjectHub.loadProject
  5. Notify users subscribed to the project hub of the new project's existence and call back to the uploading user to let them know the result.

And we'll need to figure out which package to use for unzipping (I don't believe we already do any unzipping in Superpowers currently, but it's worth a quick check to see if we already have a useful dependency).

Is that enough info to get you started?

@bilou84
Copy link
Contributor

bilou84 commented Feb 1, 2016

We do some unzipping in server/index when installing/updating systems or plugins.
See https://github.com/superpowers/superpowers/blob/0840b1f95a9ade091892aba6b55522fd8af581a7/server/index.ts#L227.

@elisee
Copy link
Contributor Author

elisee commented Feb 1, 2016

Ah right, somehow didn't think of that. Well then that's one less decision to make!

@Ilphrin
Copy link

Ilphrin commented Aug 8, 2016

Hi! Is there any new stuff about this issue? :) Importing a project is a very interesting feature

@Ilphrin
Copy link

Ilphrin commented Sep 8, 2016

Hi! I would like to try this issue :3
I don't know yet enough Electron, nodeJS, Jade, etc.. But I'd love to learn!
I don't know how much time I will need to finish it :/

@made-by-chris
Copy link

sorry for dropping this back then, have been moving country / job etc.

@bilou84
Copy link
Contributor

bilou84 commented Sep 9, 2016

Hi guys! Sure feel free to give it a shot @Ilphrin! We haven't worked on it at all so what @elisee specified above should still be pretty much valid.

You can open a pull request when you have some basics going on even if it's not finished and we can then help you if needed.

And no problem @basiclaser ;)

@Ilphrin
Copy link

Ilphrin commented Sep 9, 2016

Hi @bilou84 , thanks :) I am on Discord so I will probably ask for help.
By the way, the format inside the Zip content of the project should it be exactly like a project inside the superpowers' folder or like what we have when we do "Build Project"?

@bilou84
Copy link
Contributor

bilou84 commented Sep 9, 2016

The discord chat is more about helping each other on how to use Superpowers.
This chat is the more suited one to talk about Superpowers development: https://gitter.im/superpowers/dev

As for your question, we should use the source project. So the data inside the Superpowers folder indeed. The exported project could be very different from the source (although it's not at the moment on the game system, but that is not a requirement). We can't provide a general way to convert it back into the source data.

@Ilphrin
Copy link

Ilphrin commented Sep 9, 2016

Thanks, I am registered now on gitter, if there is some question I will post it on there :)

OK, that's what I thought but wasn't sure. By the way, shouldn't there be a button in "Build Project" to export in a ZIP file, that can be imported back later?

@bilou84
Copy link
Contributor

bilou84 commented Sep 9, 2016

I don't know if it should be a part of the build project interface or in the server hub where you can see all projects and where you should be able to import them. But we definitly need something to export the project as well.

@Ilphrin
Copy link

Ilphrin commented Sep 9, 2016

IMHO, the "Build Project" button should be entirely in the server hub, as the project interface has already a lot of stuff printed and maybe later will need to show more things, but the server hub has a lot of free space to show something like this.

@Ilphrin
Copy link

Ilphrin commented Sep 30, 2016

I have the core of the code to fix this, but I have some troubles with the last point

Notify users subscribed to the project hub of the new project's existence and call back to the uploading user to let them know the result.

I don't understand exactly what are these variables (manifest and actualIndex).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants