Add feature to mark a template as redacted

Works similarly to the delete template flow, because it’s a destructive,
one-way action.

Not on the edit template page, because it’s not something you want to be
considering every time you’re editing a template. And we saw that people
couldn’t find the delete button when it was on this page.

Adds a bit more CSS for the `dangerous` banner type, because the content
here is quite complicated. Breaking it into a list helps, but the
spacing didn’t look right, so needed some tweaking.

Can ship independently of the code that shows the redaction, but needs
the API first.
This commit is contained in:
Chris Hill-Scott
2017-06-26 14:41:00 +01:00
parent 1dbd6a122d
commit 9569521142
8 changed files with 143 additions and 18 deletions

View File

@@ -168,6 +168,12 @@ class ServiceAPIClient(NotifyAdminAPIClient):
endpoint = "/service/{0}/template/{1}".format(service_id, id_)
return self.post(endpoint, data)
def redact_service_template(self, service_id, id_):
return self.post(
"/service/{}/template/{}".format(service_id, id_),
{'redact_personalisation': True}
)
def get_service_template(self, service_id, template_id, version=None, *params):
"""
Retrieve a service template.