Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #397 from communitiesuk/FLS-870-service-desk-urls
Browse files Browse the repository at this point in the history
Service desk urls
  • Loading branch information
hamzabinkhalid authored Dec 17, 2024
2 parents b380cf3 + f64ef5a commit 3bc4473
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 24 deletions.
3 changes: 2 additions & 1 deletion config/envs/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class DefaultConfig(object):

FLASK_ROOT = str(Path(__file__).parent.parent.parent)
FLASK_ENV = environ.get("FLASK_ENV")
SUPPORT_MAILBOX_EMAIL = "[email protected]"
SUPPORT_DESK_APPLY = "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/5/group/68"
SUPPORT_DESK_ASSESS = "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/5/group/70"

# Logging
FSD_LOG_LEVEL = logging.WARNING
Expand Down
8 changes: 7 additions & 1 deletion frontend/default/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from flask import Blueprint, current_app, render_template

from config import Config

default_bp = Blueprint("default_bp", __name__, template_folder="templates")


Expand All @@ -12,7 +14,11 @@ def index():

@default_bp.errorhandler(404)
def not_found(error):
return render_template("404.html", is_error=True), 404
return render_template(
"404.html",
is_error=True,
support_desk_apply=Config.SUPPORT_DESK_APPLY,
), 404


@default_bp.errorhandler(500)
Expand Down
1 change: 1 addition & 0 deletions frontend/magic_links/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def landing(link_id):
application_guidance=app_guidance,
round_prospectus=round_prospectus,
migration_banner_enabled=Config.MIGRATION_BANNER_ENABLED,
support_desk_apply=Config.SUPPORT_DESK_APPLY,
link_to_contact_us_page=round_data.reference_contact_page_over_email,
)
return redirect(
Expand Down
6 changes: 3 additions & 3 deletions frontend/magic_links/templates/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ <h2 class="govuk-heading-m">
{% trans %}If you have questions about the form or the fund,{% endtrans %}
<a class="govuk-link" href="{{ contact_us_url }}">{% trans %}contact us.{% endtrans %}</a>
{% else %}
{% trans %}If you have any questions about the form or the fund, email us at{% endtrans %}
<a class="govuk-link" href="mailto:{{ contact_us_email_address }}">{{ contact_us_email_address }}</a>.
{% trans %}If you have any questions about the form or the fund, contact us through our {% endtrans %}
<a class="govuk-link" href="{{ support_desk_apply }}" target="_blank">{% trans %}support desk{% endtrans %}</a>.
{% endif %}
</p>
<p>{% trans %}Do not send any applications or attachments by email. We'll only accept applications through this service.{% endtrans %}</p>
<p>{% trans %}Do not send any applications or attachments from the service desk portal. We'll only accept applications through this service.{% endtrans %}</p>

<h2 class="govuk-heading-m">
{% trans %}How we'll use your information{% endtrans %}
Expand Down
6 changes: 3 additions & 3 deletions frontend/magic_links/templates/landing_eoi.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ <h2 class="govuk-heading-m">
{% trans %}If you have questions about the form or the fund,{% endtrans %}
<a class="govuk-link" href="{{ contact_us_url }}">{% trans %}contact us.{% endtrans %}</a>
{% else %}
{% trans %}If you have any questions about the form or the fund, email us at{% endtrans %}
<a class="govuk-link" href="mailto:{{ contact_us_email_address }}">{{ contact_us_email_address }}</a>.
{% trans %}If you have any questions about the form or the fund, contact us through our {% endtrans %}
<a class="govuk-link" href="{{ support_desk_apply }}" target="_blank">{% trans %}support desk{% endtrans %}</a>.
{% endif %}
</p>
<p>{% trans %}Do not send any applications or attachments by email. We'll only accept applications through this service.{% endtrans %}</p>
<p>{% trans %}Do not send any applications or attachments from the service desk portal. We'll only accept applications through this service.{% endtrans %}</p>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1 class="govuk-heading-xl">Page not found</h1>
us to speak to an adviser.</p>

{{ contact_details(
"[email protected]",
support_desk_apply,
"",
"",
"9am to 5pm",
Expand Down
17 changes: 7 additions & 10 deletions frontend/templates/partials/contact_details.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
{% macro contact_details(contact_us_email_address, contact_us_phone, contact_us_text_phone, opening_days, opening_time) %}
{% if contact_us_email_address %}
<h3 class="govuk-heading-s">{% trans %}Email{% endtrans %}</h3>
{% macro contact_details(service_desk_url, contact_us_phone, contact_us_text_phone, opening_days, opening_time) %}

{% if service_desk_url %}
<h3 class="govuk-heading-s">{% trans %}Please contact us through our {% endtrans %}<a class="govuk-link" href="{{ service_desk_url }}" target="_blank">
{% trans %}support desk{% endtrans %}
</a>.</h3>
<ul class="govuk-list">
<li>
<a class="govuk-link" href="mailto:{{ contact_us_email_address }}">
{{ contact_us_email_address }}
</a>
</li>
<li>
{{ opening_days }}: {{ opening_times }} ({% trans %}except public holidays{% endtrans %})
</li>
</ul>

<div class="govuk-inset-text">
{% trans %}Do not send any applications or attachments by email. We'll only accept applications
through this service.{% endtrans %}
{% trans %}Do not send any applications or attachments from the service desk portal. We'll only accept applications through this service.{% endtrans %}
</div>
{% endif %}
{% if contact_us_phone %}
Expand Down
2 changes: 1 addition & 1 deletion frontend/user/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def user():
logged_in_user=logged_in_user,
login_url=url_for("api_sso.login"),
logout_url=url_for("api_sso.logout"),
support_mailbox=Config.SUPPORT_MAILBOX_EMAIL,
support_desk_assess=Config.SUPPORT_DESK_ASSESS,
),
status_code,
)
2 changes: 1 addition & 1 deletion frontend/user/templates/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1 class="govuk-heading-xl">Apply for Funding</h1>

{% if roles_required %}
<p class="govuk-body">You do not have access as your account does not have the right permissions set up.
<p class="govuk-body">Please email the support mailbox ({{ support_mailbox }}) to request access or get help if you think this is a mistake.</p>
<p class="govuk-body">Please contact us through our support desk portal <a href="{{ support_desk_assess }}" target="_blank">here</a> to request access or get help if you think this is a mistake.</p>
</p>
{% else %}

Expand Down
10 changes: 9 additions & 1 deletion tests/test_errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from bs4 import BeautifulSoup

from config import Config


def test_404(flask_test_client):
response = flask_test_client.get("not_found")
Expand All @@ -8,7 +10,13 @@ def test_404(flask_test_client):

soup = BeautifulSoup(response.data, "html.parser")

assert "[email protected]" in soup.find("li").text
# Find all links in the HTML
links = soup.find_all("a", href=True)

# Check if the portal link is present
assert any(
link["href"] == Config.SUPPORT_DESK_APPLY for link in links
), f"Expected URL {Config.SUPPORT_DESK_APPLY} not found in the links"


def test_500(flask_test_client):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_magic_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import frontend
from api.session.auth_session import AuthSessionBase
from app import app
from config import Config
from frontend.magic_links.forms import EmailForm
from models.account import AccountMethods
from security.utils import validate_token
Expand Down Expand Up @@ -152,7 +153,7 @@ def test_reused_magic_link_with_active_session_shows_landing(self, flask_test_cl
soup.find_all(
"a",
class_="govuk-link",
string=lambda text: "[email protected]" in text,
href=Config.SUPPORT_DESK_APPLY,
)
)
== 1
Expand Down
4 changes: 3 additions & 1 deletion tests/test_signout.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ def test_user_page_with_missing_roles(self, flask_test_client):
"""<p class="govuk-body">You do not have access as your account does not have the right permissions set up.""" # noqa
in response.get_data(as_text=True)
)
assert """<p class="govuk-body">Please email the support mailbox""" in response.get_data(as_text=True) # noqa
assert """<p class="govuk-body">Please contact us through our support desk portal""" in response.get_data(
as_text=True
) # noqa
assert (
"""<a href="/sso/login" role="button" draggable="false" class="govuk-button" data-module="govuk-button">\n Sign in\n</a>""" # noqa
not in response.get_data(as_text=True)
Expand Down

0 comments on commit 3bc4473

Please sign in to comment.