mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Add a ‘general’ ticket type
This is for tickets coming from non-logged-in users. It’s effectively the same as reporting a problem, but doesn’t have the banner about the status page (because we can’t tell if they’re actually reporting a problem now we’re not asking). It also gives a more generic page title.
This commit is contained in:
@@ -13,7 +13,11 @@ from app.main.forms import (
|
||||
SupportType,
|
||||
Triage,
|
||||
)
|
||||
from app.models.feedback import PROBLEM_TICKET_TYPE
|
||||
from app.models.feedback import (
|
||||
GENERAL_TICKET_TYPE,
|
||||
PROBLEM_TICKET_TYPE,
|
||||
QUESTION_TICKET_TYPE,
|
||||
)
|
||||
|
||||
|
||||
def get_prefilled_message():
|
||||
@@ -50,7 +54,7 @@ def support():
|
||||
else:
|
||||
return redirect(url_for(
|
||||
'.feedback',
|
||||
ticket_type=PROBLEM_TICKET_TYPE,
|
||||
ticket_type=GENERAL_TICKET_TYPE,
|
||||
))
|
||||
|
||||
return render_template('views/support/index.html', form=form)
|
||||
@@ -62,17 +66,22 @@ def support_public():
|
||||
|
||||
|
||||
@main.route('/support/triage', methods=['GET', 'POST'])
|
||||
def triage():
|
||||
@main.route('/support/triage/<ticket_type:ticket_type>', methods=['GET', 'POST'])
|
||||
def triage(ticket_type=PROBLEM_TICKET_TYPE):
|
||||
form = Triage()
|
||||
if form.validate_on_submit():
|
||||
return redirect(url_for(
|
||||
'.feedback',
|
||||
ticket_type=PROBLEM_TICKET_TYPE,
|
||||
ticket_type=ticket_type,
|
||||
severe=form.severe.data
|
||||
))
|
||||
return render_template(
|
||||
'views/support/triage.html',
|
||||
form=form
|
||||
form=form,
|
||||
page_title={
|
||||
PROBLEM_TICKET_TYPE: 'Report a problem',
|
||||
GENERAL_TICKET_TYPE: 'Contact GOV.UK Notify support',
|
||||
}.get(ticket_type)
|
||||
)
|
||||
|
||||
|
||||
@@ -89,14 +98,14 @@ def feedback(ticket_type):
|
||||
severe = None
|
||||
|
||||
out_of_hours_emergency = all((
|
||||
ticket_type == PROBLEM_TICKET_TYPE,
|
||||
ticket_type != QUESTION_TICKET_TYPE,
|
||||
not in_business_hours(),
|
||||
severe,
|
||||
))
|
||||
|
||||
if needs_triage(ticket_type, severe):
|
||||
session['feedback_message'] = form.feedback.data
|
||||
return redirect(url_for('.triage'))
|
||||
return redirect(url_for('.triage', ticket_type=ticket_type))
|
||||
|
||||
if needs_escalation(ticket_type, severe):
|
||||
return redirect(url_for('.bat_phone'))
|
||||
@@ -144,7 +153,12 @@ def feedback(ticket_type):
|
||||
return render_template(
|
||||
'views/support/form.html',
|
||||
form=form,
|
||||
is_problem=(ticket_type == PROBLEM_TICKET_TYPE),
|
||||
show_status_page_banner=(ticket_type == PROBLEM_TICKET_TYPE),
|
||||
page_title={
|
||||
GENERAL_TICKET_TYPE: 'Contact GOV.UK Notify support',
|
||||
PROBLEM_TICKET_TYPE: 'Report a problem',
|
||||
QUESTION_TICKET_TYPE: 'Ask a question or give feedback',
|
||||
}.get(ticket_type),
|
||||
)
|
||||
|
||||
|
||||
@@ -254,7 +268,7 @@ def has_live_services(user_id):
|
||||
|
||||
def needs_triage(ticket_type, severe):
|
||||
return all((
|
||||
ticket_type == PROBLEM_TICKET_TYPE,
|
||||
ticket_type != QUESTION_TICKET_TYPE,
|
||||
severe is None,
|
||||
(
|
||||
not current_user.is_authenticated or has_live_services(current_user.id)
|
||||
@@ -265,7 +279,7 @@ def needs_triage(ticket_type, severe):
|
||||
|
||||
def needs_escalation(ticket_type, severe):
|
||||
return all((
|
||||
ticket_type == PROBLEM_TICKET_TYPE,
|
||||
ticket_type != QUESTION_TICKET_TYPE,
|
||||
severe,
|
||||
not current_user.is_authenticated,
|
||||
not in_business_hours(),
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
QUESTION_TICKET_TYPE = 'ask-question-give-feedback'
|
||||
PROBLEM_TICKET_TYPE = 'report-problem'
|
||||
GENERAL_TICKET_TYPE = 'general'
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
|
||||
{% set page_title = 'Report a problem' if is_problem else 'Ask a question or give feedback' %}
|
||||
|
||||
{% block per_page_title %}
|
||||
{{ page_title }}
|
||||
{% endblock %}
|
||||
@@ -19,7 +17,7 @@
|
||||
) }}
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
{% if is_problem %}
|
||||
{% if show_status_page_banner %}
|
||||
<div class="panel panel-border-wide">
|
||||
<p>
|
||||
Check our <a class="govuk-link govuk-link--no-visited-state" href="https://status.notifications.service.gov.uk">system status</a>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Feedback
|
||||
{{ page_title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
{{ page_header(
|
||||
'Report a problem',
|
||||
page_title,
|
||||
back_link=url_for('.support')
|
||||
) }}
|
||||
{% call form_wrapper() %}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
from werkzeug.routing import BaseConverter
|
||||
|
||||
from app.models.feedback import PROBLEM_TICKET_TYPE, QUESTION_TICKET_TYPE
|
||||
from app.models.feedback import (
|
||||
GENERAL_TICKET_TYPE,
|
||||
PROBLEM_TICKET_TYPE,
|
||||
QUESTION_TICKET_TYPE,
|
||||
)
|
||||
|
||||
|
||||
class TemplateTypeConverter(BaseConverter):
|
||||
@@ -10,7 +14,7 @@ class TemplateTypeConverter(BaseConverter):
|
||||
|
||||
class TicketTypeConverter(BaseConverter):
|
||||
|
||||
regex = f'(?:{PROBLEM_TICKET_TYPE}|{QUESTION_TICKET_TYPE})'
|
||||
regex = f'(?:{PROBLEM_TICKET_TYPE}|{QUESTION_TICKET_TYPE}|{GENERAL_TICKET_TYPE})'
|
||||
|
||||
|
||||
class LetterFileExtensionConverter(BaseConverter):
|
||||
|
||||
Reference in New Issue
Block a user