Closed (fixed)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Oct 2018 at 13:12 UTC
Updated:
1 Nov 2018 at 11:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jrockowitz commentedThe only approach to never installing the default templates is removing them via a patch which adds a webform_templates_install() hook that deletes the template.
@see #2888250: Remove default contact webform.
Comment #3
jrockowitz commentedThe attached will delete the webform_templates.module during the module's installation.
Comment #4
jrockowitz commentedUsing a patch is simplest solution.
The other solutions I can think of are…
Comment #5
dakku commented@jrockowitz
I like the idea of:
Add 'Delete' button/link to Template overview
If you are open to getting this feature added, I can rustle up a patch that would provide a "delete" button next to each template. So it would be:
Select | Preview | Delete
Comment #6
dakku commentedHi @ jrockowitz
Here is a quick patch that implements template deletion button.
See screenshots below:
Comment #7
dakku commentedComment #8
jrockowitz commented@dakku I kind of suspected that adding a delete button the main Templates display would be awkward looking.
The other approach would be to add dedicated 'Manage' tab to the 'Templates' section.
When I searched other Form Builder applications, no one offers the ability to delete templates.
The attached patch changes the 'Delete' button to a red link and it is only visible to users with 'administer webform' permission.
Comment #9
jrockowitz commentedI still think the Delete link looks awkward and we should explore creating a Manage tab which would include an Edit, View, and Delete operation dropdown.
Comment #10
dakku commentedPersonally, from a user experience perspective, I think it makes sense to have the template related operations on a single page. This is the same behaviour for core Content view for example.
Not to mention the duplication of code to move it to a new tab just to add a delete button?
Comment #11
jrockowitz commentedMy thinking is once a websites templates are set up no one needs to delete them,
Only when an site administrator is managing the template will they need to delete them.
Comment #12
jrockowitz commentedThe attached patch adds a 'Manage' tab to 'Templates' and a 'administer webform templates' permission.
Comment #14
jrockowitz commentedMinor tweaks.
Comment #16
jrockowitz commentedHere is the change record.
Comment #17
dakku commented@jrockowitz thank you - this is awesome :D