Skip to content

Commit

Permalink
VOTE-3149 add state page data analytics and config (#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamiraMSadat authored Dec 2, 2024
1 parent 6cf4f86 commit 0261ecc
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
4 changes: 4 additions & 0 deletions config/sync/editor.editor.simple_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ settings:
- italic
- link
- bulletedList
- sourceEditing
plugins:
ckeditor5_list:
properties:
reversed: false
startIndex: false
multiBlock: true
ckeditor5_sourceEditing:
allowed_tags:
- '<a data-state-ext>'
editor_advanced_link_link:
enabled_attributes:
- aria-label
Expand Down
2 changes: 1 addition & 1 deletion config/sync/filter.format.simple_html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ filters:
status: true
weight: -10
settings:
allowed_html: '<br> <p> <strong> <em> <a href aria-label title class target="_blank" rel> <ul> <ol> <li>'
allowed_html: '<br> <p> <a data-state-ext href aria-label title class target="_blank" rel> <strong> <em> <ul> <ol> <li>'
filter_html_help: true
filter_html_nofollow: false
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*
#}

{% if link_url %}
{% if link.url and link.title %}
{% set link_markup %}
<a href={{ link_url }}>{{ link_text }}</a>
{{ link(link.title, link.url, create_attribute().setAttribute(data.label, data.value)) }}
{% endset %}
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
<div class="vote-info-card__button">
{% include '@votegov/component/button.html.twig' with {
'href': link.url,
'label': link.title
'label': link.title,
'data_label': data.label,
'data': data.value,
} %}
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{# setting link text to be in inline hyper link #}
{% if registration_not_needed.link_text %}
{% set link_markup %}
<a href="{{ more_info_link }}">{{ registration_not_needed.link_text | render | trim | t({'@state_name': title_english}) }}</a>
<a href="{{ more_info_link }}" data-state-ext="state-website-no-registration">{{ registration_not_needed.link_text | render | trim | t({'@state_name': title_english}) }}</a>
{% endset %}
{% endif %}
{# setting body text to have palceholder for both state name and link #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,14 @@
{% include '@votegov/component/call-out-box.html.twig' with {
'heading': check_registration.heading,
'text': check_registration.text | render | trim,
'link_text': check_registration.link_text | render | trim | t({'@state_name': title_english}),
'link_url': confirm_registration_link
'link': {
'url': confirm_registration_link,
'title': check_registration.link_text | render | trim | t({'@state_name': title_english}),
},
'data': {
'label' : 'data-state-ext',
'value': 'confirm-registration',
},
} %}
{% endif %}
</aside>
Expand All @@ -117,8 +123,14 @@
{% include '@votegov/component/call-out-box.html.twig' with {
'heading': check_registration.heading,
'text': check_registration.text | render | trim,
'link_text': check_registration.link_text | render | trim | t({'@state_name': title_english}),
'link_url': confirm_registration_link
'link': {
'url': confirm_registration_link,
'title': check_registration.link_text | render | trim | t({'@state_name': title_english}),
},
'data': {
'label' : 'data-state-ext',
'value': 'confirm-registration',
},
} %}
{% endif %}

Expand Down Expand Up @@ -148,6 +160,10 @@
'link': {
'url': registration_link,
'title': link_title,
},
'data' : {
'label': 'data-state-ext',
'value': 'online-registration'
}
} %}
{% endif %}
Expand Down Expand Up @@ -187,7 +203,7 @@
{{ mail_registration.text }}

{% if state_mail_pdf_link and mail_registration.link_text %}
<p>{{ link(mail_registration.link_text, state_mail_pdf_link) }}</p>
<p>{{ link(mail_registration.link_text, state_mail_pdf_link, create_attribute().setAttribute('data-state-ext', 'state-mail-registration')) }}</p>
{% endif %}
{% endset %}

Expand Down Expand Up @@ -232,6 +248,10 @@
'link': {
'url': more_info_link,
'title': link_title,
},
'data' : {
'label': 'data-state-ext',
'value': 'in-person-registration'
}
} %}
{% endif %}
Expand Down

0 comments on commit 0261ecc

Please sign in to comment.