Skip to content

Commit

Permalink
fix(dfc-717): add data attributes for navigation tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
di-aholme committed Jan 17, 2025
1 parent db99835 commit cb0918c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/views/address/address.njk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% include "../components/address-input-fields.njk" %}
{{ yearFromField(ctx, { name: "addressYearFrom", title: title, label: label }) }}

{{ hmpoSubmit(ctx, {id: "continue", text: translate("buttons.next")}) }}
{{ hmpoSubmit(ctx, {attributes: {"data-nav": "true", "data-link": "/undefined"}, id: "continue", text: translate("buttons.next")}) }}

{% endcall %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/address/results.njk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

{{ hmpoHtml(translate("links.cantFindAddress")) }}

{{ hmpoSubmit(ctx, {id: "continue", text: translate("buttons.select-address")}) }}
{{ hmpoSubmit(ctx, {id: "continue", attributes: {"data-nav": true, "data-link": "/undefined"}, text: translate("buttons.select-address")}) }}

{% endcall %}

Expand Down
5 changes: 4 additions & 1 deletion src/views/address/search.njk
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
autocomplete: "postal-code"
}) }}

{{ hmpoSubmit(ctx, {id: "continue", text: translate("buttons.find-address")}) }}
{{ hmpoSubmit(ctx, {
id: "continue",
attributes: { "data-nav": true, "data-link": "/results" },
text: translate("buttons.find-address")}) }}
{%- include "../components/continue-submit-spinner.njk" -%}

{% endcall %}
Expand Down
8 changes: 5 additions & 3 deletions src/views/components/address-confirm.njk
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@
text: translate("pages.address-confirm.buttons.next"),
id: "continue",
attributes: {
"data-id": "next"
}
}) }}
"data-id": "next",
"data-nav": true,
"data-link": "/undefined"
}
}) }}
{%- include "../components/continue-submit-spinner.njk" -%}

{% endcall %}
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/address-problem-field.njk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
})
}}

{{ hmpoSubmit(ctx, {id: "continue", text: translate("buttons.next")}) }}
{{ hmpoSubmit(ctx, {attributes: {"data-nav": true, "data-link": "/undefined"}, id: "continue", text: translate("buttons.next")}) }}

{{hmpoHtml(translate("links.helpContact"))}}

Expand Down
2 changes: 1 addition & 1 deletion src/views/previous/address.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

{% include "../components/address-input-fields.njk" %}

{{ hmpoSubmit(ctx, {id: "continue", text: translate("buttons.next")}) }}
{{ hmpoSubmit(ctx, {attributes: {"data-nav": true, "data-link": "/undefined"}, id: "continue", text: translate("buttons.next")}) }}

{% endcall %}
{{ ga4OnPageLoad({
Expand Down
2 changes: 1 addition & 1 deletion src/views/previous/results.njk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

{{ hmpoHtml(translate("links.previous.cantFindAddress")) }}

{{ hmpoSubmit(ctx, {id: "continue", text: translate("buttons.select-address")}) }}
{{ hmpoSubmit(ctx, {attributes: {"data-nav": true, "data-link": "/previous-address-check"}, id: "continue", text: translate("buttons.select-address")}) }}

{% endcall %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/previous/search.njk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
hint: translate("fields.addressSearch.previous.hint")
}) }}

{{ hmpoSubmit(ctx, {id:"continue", text: translate("buttons.find-address")}) }}
{{ hmpoSubmit(ctx, {id:"continue", attributes: {"data-nav": true, "data-link": "/previous-results"}, text: translate("buttons.find-address")}) }}

{% endcall %}

Expand Down

0 comments on commit cb0918c

Please sign in to comment.