openwisp / django-netjsonconfig

Configuration manager for embedded devices, implemented as a reusable django-app
http://openwisp.org
Other
194 stars 60 forks source link

[feature] Implement copy/clone templates in admin #131

Closed joaohcca closed 4 years ago

joaohcca commented 4 years ago

Admins should be able to create templates based on existing templates.

Additionally, multi-organization admins should be able to import/clone templates between orgs.

atb00ker commented 4 years ago

An easy non-GUI approach to this would be copies the json from advanced-json mode and pasting it! :smile:

nemesifier commented 4 years ago

Here's a solution that should work.

We need to add a new admin action in the template admin, that allows to clone selected templates.

We need an intermediate page in which the user selects the organization (if they have access to more than one organization). The intermediate page should show a message asking the user in which organization they want to clone the templates, making sure only organizations to which user has access to are shown.

When the templates are cloned, the template name should be changed to (COPY) <name>, where ` is the original template name.

pawelplsi commented 4 years ago

In my opinion it would be better to implement this feature in openwisp-controller repository instead of this one, because it would violate the modularity of project if we implemented organization selection intermediate page in django-netjsonconfig repository which has nothing to do with oranizations/multitenancy. Am I right?

atb00ker commented 4 years ago

@pawelplsi Multitenancy will not be moved to django-netjsonconfig instead the template clone part would be done in django-netjsonconfig and multi-org part would be done seperately. For that I think we need to make 2 different pull requests. I think it'll be best if you first do the part related to django-netjsonconfig.Add a template cloning feature based on we will move ahead with the openwisp-controller part, what do you think?

nemesifier commented 4 years ago

Implemented in #140.