From d1225e51335cc602a5644844e297f11ddef11823 Mon Sep 17 00:00:00 2001 From: Sam Dudley Date: Thu, 11 Apr 2024 15:07:50 +0100 Subject: [PATCH] DWPF-1528 Fix high frequency SyntaxError in Sentry (#576) --- Makefile | 13 ++++++++ .../peoplefinder/components/team-card.html | 33 ++++++++----------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 1a915ef77..b92c6d7e4 100644 --- a/Makefile +++ b/Makefile @@ -214,6 +214,9 @@ wagtail-groups: # Create the wagtail groups pf-groups: # Create the pf groups $(wagtail) python manage.py create_people_finder_groups +pf-test-teams: # Add test data for peoplefinder teams (suitable for local dev) + $(wagtail) python manage.py create_test_teams + create-section-homepages: # Create the section homepages $(wagtail) python manage.py create_section_homepages @@ -223,5 +226,15 @@ data-countries: # Import the countries data ingest-uk-staff-locations: # Create the list of the department's offices $(wagtail) python manage.py ingest_uk_staff_locations +local-test-data: # Add all test data for local development + make data-countries + make menus + make create-section-homepages + make wagtail-groups + make pf-groups + make pf-test-teams + make ingest-uk-staff-locations + make index + serve-docs: # Serve mkdocs on port 8002 poetry run mkdocs serve -a localhost:8002 diff --git a/src/peoplefinder/templates/peoplefinder/components/team-card.html b/src/peoplefinder/templates/peoplefinder/components/team-card.html index 4aa8596eb..4837a4127 100644 --- a/src/peoplefinder/templates/peoplefinder/components/team-card.html +++ b/src/peoplefinder/templates/peoplefinder/components/team-card.html @@ -1,33 +1,28 @@ {% load markdown %}

- {% if number_overall %} + {{ team.name }} - {% else %} - {{ team.name }} - {% endif %} + {% if number_overall %} + onclick="dataLayer.push({ 'event': 'search_result', 'search_result_selected_url': '{% url 'team-view' team.slug %}', 'search_result_selected_type': 'team', 'search_result_selected_section': 'teams', 'search_result_selected_number_overall': {{ number_overall }}, 'search_result_selected_number_section': {{ number_section }}, 'search_ui': 'team-breadcrumb' })" + {% endif %} + >{{ team.name }}

{% if team.all_parents %}
    {% for parent_team in team.all_parents %}
  1. - - {% if number_overall %} + {{ parent_team.short_name }} - {% else %} - {{ parent_team.short_name }} - {% endif %} + {% if number_overall %} + onclick="dataLayer.push({ 'event': 'search_result', 'search_result_selected_url': '{% url 'team-view' parent_team.slug %}', 'search_result_selected_type': 'parent_team', 'search_result_selected_section': 'teams', 'search_result_selected_number_overall': {{ number_overall }}, 'search_result_selected_number_section': {{ number_section }}, 'search_ui': 'team-breadcrumb' })" + {% endif %} + >{{ parent_team.short_name }}
  2. {% endfor %}