mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Merge pull request #4024 from alphagov/new-zendesk-form
Use Zendesk form for go live requests
This commit is contained in:
@@ -14,6 +14,9 @@ from flask import (
|
||||
)
|
||||
from flask_login import current_user
|
||||
from notifications_python_client.errors import HTTPError
|
||||
from notifications_utils.clients.zendesk.zendesk_client import (
|
||||
NotifySupportTicket,
|
||||
)
|
||||
from notifications_utils.timezones import utc_string_to_aware_gmt_datetime
|
||||
|
||||
from app import (
|
||||
@@ -207,10 +210,7 @@ def request_to_go_live(service_id):
|
||||
@user_has_permissions('manage_service')
|
||||
@user_is_gov_user
|
||||
def submit_request_to_go_live(service_id):
|
||||
|
||||
zendesk_client.create_ticket(
|
||||
subject='Request to go live - {}'.format(current_service.name),
|
||||
message=(
|
||||
ticket_message = (
|
||||
'Service: {service_name}\n'
|
||||
'{service_dashboard}\n'
|
||||
'\n---'
|
||||
@@ -243,13 +243,20 @@ def submit_request_to_go_live(service_id):
|
||||
existing_live='Yes' if current_user.live_services else 'No',
|
||||
email_address=current_user.email_address,
|
||||
email_reply_to=current_service.default_email_reply_to_address or 'not set',
|
||||
),
|
||||
ticket_type=zendesk_client.TYPE_QUESTION,
|
||||
user_email=current_user.email_address,
|
||||
)
|
||||
|
||||
ticket = NotifySupportTicket(
|
||||
subject=f'Request to go live - {current_service.name}',
|
||||
message=ticket_message,
|
||||
ticket_type=NotifySupportTicket.TYPE_QUESTION,
|
||||
user_name=current_user.name,
|
||||
tags=current_service.request_to_go_live_tags,
|
||||
user_email=current_user.email_address,
|
||||
requester_sees_message_content=False,
|
||||
org_id=current_service.organisation_id,
|
||||
org_type=current_service.organisation_type,
|
||||
service_id=current_service.id,
|
||||
)
|
||||
zendesk_client.send_ticket_to_zendesk(ticket)
|
||||
|
||||
current_service.update(go_live_user=current_user.id)
|
||||
|
||||
|
||||
@@ -684,33 +684,6 @@ class Service(JSONModel):
|
||||
}
|
||||
)
|
||||
|
||||
@property
|
||||
def request_to_go_live_tags(self):
|
||||
return list(self._get_request_to_go_live_tags())
|
||||
|
||||
def _get_request_to_go_live_tags(self):
|
||||
|
||||
BASE = 'notify_go_live'
|
||||
|
||||
yield 'notify_action'
|
||||
yield BASE
|
||||
|
||||
if self.go_live_checklist_completed and self.organisation.agreement_signed:
|
||||
yield BASE + '_complete'
|
||||
return
|
||||
|
||||
for test, tag in (
|
||||
(not self.volumes, '_volumes'),
|
||||
(not self.go_live_checklist_completed, '_checklist'),
|
||||
(not self.organisation.agreement_signed, '_mou'),
|
||||
(self.needs_to_add_email_reply_to_address, '_email_reply_to'),
|
||||
(not self.has_team_members, '_team_member'),
|
||||
(not self.has_templates, '_template_content'),
|
||||
(self.needs_to_change_sms_sender, '_sms_sender'),
|
||||
):
|
||||
if test:
|
||||
yield BASE + '_incomplete' + tag
|
||||
|
||||
@cached_property
|
||||
def returned_letter_statistics(self):
|
||||
return service_api_client.get_returned_letter_statistics(self.id)
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Delete service
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
|
||||
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-three-quarters">
|
||||
|
||||
<h1 class="heading-large">Delete this service from GOV.UK Notify</h1>
|
||||
|
||||
<p class="govuk-body">
|
||||
This cannot be undone. You will lose:
|
||||
</p>
|
||||
|
||||
<ul class="list list-bullet">
|
||||
<li>
|
||||
any data you’ve uploaded messages
|
||||
</li>
|
||||
<li>
|
||||
any templates you’ve created
|
||||
</li>
|
||||
<li>
|
||||
the history of notifications you’ve sent
|
||||
</li>
|
||||
<li>
|
||||
API keys
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% call form_wrapper() %}
|
||||
{{ page_footer(
|
||||
'Yes, delete ‘{}’'.format(current_service.name),
|
||||
destructive=True,
|
||||
back_link=url_for('.service_settings', service_id=current_service.id)
|
||||
) }}
|
||||
{% endcall %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user