Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: default new project template #564

Closed
sag1v opened this issue Feb 17, 2018 · 12 comments
Closed

[Feature]: default new project template #564

sag1v opened this issue Feb 17, 2018 · 12 comments

Comments

@sag1v
Copy link

sag1v commented Feb 17, 2018

Hi, Thanks for this great tool.

Is there a way we can configure or create a default project snippet instead of the built in one?
For example, i often find myself editing the default react App component from a stateless component to a class component with a state etc.

I would love to configure my own starting template or maybe even have some snippets of code.

@lbogdan
Copy link
Contributor

lbogdan commented Feb 18, 2018

A workaround I use is to have "template" sandboxes from which you then fork. The only drawback is that sometimes I open a "template" sandbox and forget to fork it, so I end up overwriting the template - it needs some getting used to, but overall it works.

As an example, this is my simple Vue template.

@CompuIves
Copy link
Member

CompuIves commented Feb 18, 2018 via email

@lbogdan
Copy link
Contributor

lbogdan commented Feb 18, 2018

So that when you open it, make changes and save, it should automatically fork it?

@sag1v
Copy link
Author

sag1v commented Feb 18, 2018

@lbogdan This is exactly what I'm doing and exactly the problems i face with this approach.
I end up overriding the "template". 😞

@sag1v
Copy link
Author

sag1v commented Feb 18, 2018

@CompuIves Sounds great, you will need a special "Edit Template mode" though.

@CompuIves
Copy link
Member

CompuIves commented Feb 18, 2018

So that when you open it, make changes and save, it should automatically fork it?

Yep, and we could also show all 'marked' as templates sandboxes when you open 'Create New Sandbox' modal 😄.

@CompuIves Sounds great, you will need a special "Edit Template mode" though.

I think we could make a switch in the left bar, if it's on you can't edit, and if it's off you can. So if you want to make changes you'll need to turn the switch on and off.

@sag1v
Copy link
Author

sag1v commented Apr 24, 2018

Is anyone working on this feature yet?
Is there something i can help with? 🙂

@CompuIves
Copy link
Member

I think this is the perfect time to start building this feature!

No one started yet, so feel free to start @sag1v!

I think what we need is a new switch in the Project sidebar, called 'Mark as template'. When you change the switch we should do a POST call to

/api/v1/sandboxes/:id/template with body { "template": true/false }. I can write the backend for it in the meantime.

The next step would be to add them to the new sandboxes list, but let's do the first step first 😄

@sag1v
Copy link
Author

sag1v commented Apr 27, 2018

@CompuIves Ok, i just started the process you can take a look.
I hope it will go as expected as i never used mobx nor Cerebral 🤔

@sag1v
Copy link
Author

sag1v commented May 1, 2018

@CompuIves Did you take a look? let me know if this is going in the right direction...

@lbogdan
Copy link
Contributor

lbogdan commented May 9, 2018

@sag1v Can you please create a PR for this, as it would be easier to follow?

@sag1v
Copy link
Author

sag1v commented May 9, 2018

@lbogdan oops i was sure i created it already. anyway PR created #816

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

No branches or pull requests

3 participants