Skip to content

Commit

Permalink
DWPF-1528 Fix high frequency SyntaxError in Sentry (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamDudley authored Apr 11, 2024
1 parent 9b2b22c commit d1225e5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
33 changes: 14 additions & 19 deletions src/peoplefinder/templates/peoplefinder/components/team-card.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
{% load markdown %}
<div class="pf-team-card">
<p class="pf-team-card__name mb-10">
{% if number_overall %}
<a
class="govuk-link"
href="{% url 'team-view' team.slug %}"
{# only search has this context var #}
<a class="govuk-link"
href="{% url 'team-view' team.slug %}"
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 }} })">{{ team.name }}</a>
{% else %}
<a class="govuk-link"
href="{% url 'team-view' team.slug %}"
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' })">{{ team.name }}</a>
{% 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 }}</a>
</p>
{% if team.all_parents %}
<div class="govuk-breadcrumbs p-0">
<ol class="govuk-breadcrumbs__list">
{% for parent_team in team.all_parents %}
<li class="govuk-breadcrumbs__list-item">

{% if number_overall %}
<a
class="govuk-link"
href="{% url 'team-view' parent_team.slug %}"
{# only search has this context var #}
<a class="govuk-link"
href="{% url 'team-view' parent_team.slug %}"
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' })">{{ parent_team.short_name }}</a>
{% else %}
<a class="govuk-link"
href="{% url 'team-view' parent_team.slug %}"
onclick="dataLayer.push({ 'event': 'search_result', 'search_result_selected_url': '{% url 'team-view' parent_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' })">{{ parent_team.short_name }}</a>
{% 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 }}</a>
</li>
{% endfor %}
</ol>
Expand Down

0 comments on commit d1225e5

Please sign in to comment.