Skip to content

Commit

Permalink
MAN-256: Updated Personal Info links for analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcphee77 committed Jan 15, 2025
1 parent f897dd4 commit 358f268
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions server/views/pages/caseload/minimal-cases.njk
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

{% set rows = (rows.push(
[
{ html: "<a class='govuk-!-font-weight-bold' href='./case/" + case.crn + "'>" + fullName + "</a></br><span class='govuk-!-font-weight-bold secondary-text'>" + crn + "</span>",
{ html: "<a data-ai-id = 'myCasesPersonNameLink' class='govuk-!-font-weight-bold' href='./case/" + case.crn + "'>" + fullName + "</a></br><span class='govuk-!-font-weight-bold secondary-text'>" + crn + "</span>",
attributes: { 'data-qa': 'nameOrCrnValue' + loop.index} },
{ html: case.dob | dateWithYearShortMonth + "</br><span class='secondary-text'>Age " + case.dob | yearsSince + "</span>" if case.dob else "Restricted",
attributes: { 'data-qa': 'dobValue' + loop.index }
Expand All @@ -171,11 +171,11 @@
},
head: [
{
text: "Name</br>CRN",
html: "Name</br>CRN",
attributes: {'aria-sort': setSortOrder('nameOrCrn', caseload.sortedBy) , 'col-name': 'nameOrCrn', 'action': 'case'}
},
{
text: "Date of birth</br>Age",
html: "Date of birth</br>Age",
attributes: {'aria-sort': setSortOrder('dob', caseload.sortedBy) , 'col-name': 'dob', 'data-qa': 'dob', 'action': 'case' },
classes: "nowrap"
},
Expand Down Expand Up @@ -212,7 +212,7 @@
{% for case in caseload.caseload %}
<tr class="govuk-table__row">
<td class="govuk-table__cell" data-qa="case{{loop.index}}Value">
<a href="/case/{{ case.crn }}" class="govuk-!-font-weight-bold">{{ case.caseName | fullName }}</a><br />
<a data-ai-id="teamCasesPersonNameLink" href="/case/{{ case.crn }}" class="govuk-!-font-weight-bold">{{ case.caseName | fullName }}</a><br />
<span class="app-!-font-family-tabular govuk-!-margin-bottom-0">{{ case.crn }}</span>
</td>
{% if currentNavSection == 'teamCases' and caseload.team %}
Expand Down
1 change: 1 addition & 0 deletions server/views/pages/caseload/recent-cases.njk
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
}
anchor.href = "./case/" + recentCase.crn
anchor.text = lao(recentCase.limitedAccess, recentCase.name, "Restricted access")
anchor.setAttribute("data-ai-id", "recentCasesPersonNameLink")
const span1 = document.createElement("span")
span1.className = "govuk-!-font-weight-bold secondary-text"
span1.innerText = recentCase.crn
Expand Down
2 changes: 1 addition & 1 deletion server/views/pages/overview.njk
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
}) }}

<input type="hidden" id="caseCrn" name="crn" value="{{ crn }}">
<input type="hidden" id="name" name="name" value="{{ overview.personalDetails.name.surname }},{{ overview.personalDetails.name.forename }}">
<input type="hidden" id="name" name="name" value="{{ overview.personalDetails.name.surname }}, {{ overview.personalDetails.name.forename }}">
<input type="hidden" id="dob" name="dob" value="{{ headerDob | dateWithYear }}">
<input type="hidden" id="age" name="age" value="{{ headerDob | yearsSince }}">
<input type="hidden" id="tier" name="age" value="{{ tierCalculation.tierScore }}">
Expand Down
4 changes: 2 additions & 2 deletions server/views/pages/personal-details.njk
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<li>
<p>
{{ contact.relationshipType }}:<br />
<a href="personal-details/personal-contact/{{ contact.contactId }}">{{ contact.name | fullName }}{{ contact.relationship }}</a>
<a data-ai-id="personalContactLink" href="personal-details/personal-contact/{{ contact.contactId }}">{{ contact.name | fullName }}{{ contact.relationship }}</a>
</p>
</li>
{% endfor %}
Expand Down Expand Up @@ -261,7 +261,7 @@
{% if documents.length > 0 %}
{% for doc in documents %}
<li>
<a href="personal-details/documents/{{ doc.id }}/download" download="{{ doc.name }}">{{ doc.name }}</a><br>
<a data-ai-id="documentDownload" href="personal-details/documents/{{ doc.id }}/download" download="{{ doc.name }}">{{ doc.name }}</a><br>
<span class="govuk-!-font-size-16">
{% if doc.lastUpdated %}
{{ doc.lastUpdated | lastUpdatedDate }}
Expand Down
2 changes: 1 addition & 1 deletion server/views/partials/case-nav.njk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% endif %}
{% if flags.enableNavAppointments === true %}
<li class="moj-sub-navigation__item" data-qa="appointmentsTab">
<a data-ai-id="AppointmentsTab" class="moj-sub-navigation__link govuk-link--no-visited-state"
<a class="moj-sub-navigation__link govuk-link--no-visited-state"
{% if currentNavSection == 'appointments' %}
aria-current="page"
{% endif %}
Expand Down

0 comments on commit 358f268

Please sign in to comment.