Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate DS to version 72.2.0 #1579

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion .design-system-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
70.0.16
72.2.0
2 changes: 1 addition & 1 deletion app/helpers/language_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _get_language_context(
language_code: str, current_language: str
) -> dict[str, str | bool]:
return {
"ISOCode": language_code,
"isoCode": language_code,
"url": _get_query_string_with_language(language_code),
"text": LANGUAGE_TEXT[language_code],
"current": language_code == current_language,
Expand Down
24 changes: 12 additions & 12 deletions app/jinja_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,11 @@ def __init__( # noqa: C901, R0912 pylint: disable=too-complex, too-many-branche
or is_summary_with_calculation(summary_type)
or use_answer_label
) and answer.get("label"):
self.rowTitle = answer["label"]
self.rowTitleAttributes = {"data-qa": answer["id"] + "-label"}
self.title = answer["label"]
self.titleAttributes = {"data-qa": answer["id"] + "-label"}
else:
self.rowTitle = strip_tags(question["title"])
self.rowTitleAttributes = {"data-qa": question["id"]}
self.title = strip_tags(question["title"])
self.titleAttributes = {"data-qa": question["id"]}

if edit_link_text:
self.id = answer["id"]
Expand Down Expand Up @@ -546,7 +546,7 @@ def __init__( # noqa: C901, R0912 pylint: disable=too-complex, too-many-branche

if answers_are_editable:
self.actions = [
SummaryAction(answer, self.rowTitle, edit_link_text, item_name)
SummaryAction(answer, self.title, edit_link_text, item_name)
]


Expand All @@ -561,16 +561,16 @@ def __init__(
use_answer_label: bool = False,
item_name: str | None = None,
) -> None:
self.rowTitle = strip_tags(question["title"])
self.title = strip_tags(question["title"])
self.id = question["id"]
self.rowItems = []
self.itemsList = []
use_answer_label = use_answer_label or len(question["answers"]) > 1

if is_summary_with_calculation(summary_type) and not answers_are_editable:
self.total = True

for answer in question["answers"]:
self.rowItems.append(
self.itemsList.append(
SummaryRowItem(
question,
answer,
Expand Down Expand Up @@ -742,7 +742,7 @@ def map_list_collector_config(
"iconVisuallyHiddenText": "Completed" if icon else None,
"actions": actions,
"id": list_item.get("list_item_id"),
"rowTitleAttributes": {
"titleAttributes": {
"data-qa": f"list-item-{index}-label",
"data-list-item-id": list_item.get("list_item_id"),
},
Expand All @@ -751,7 +751,7 @@ def map_list_collector_config(
if item_label:
row_item["valueList"] = [{"text": item_name}]

row_item["rowTitle"] = item_label or item_name
row_item["title"] = item_label or item_name
row_items: list = [row_item]

if related_answers:
Expand All @@ -765,9 +765,9 @@ def map_list_collector_config(
use_answer_label=True,
item_name=item_name,
)
row_items.extend(summary_row.rowItems)
row_items.extend(summary_row.itemsList)

rows.append({"rowItems": row_items})
rows.append({"itemsList": row_items})

return rows

Expand Down
8 changes: 4 additions & 4 deletions app/views/contexts/hub_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def get_row_context_for_section(
) -> dict[str, str | list]:
section_content = self.SECTION_CONTENT_STATES[section_status]
context: dict = {
"rowItems": [
"itemsList": [
{
"rowTitle": section_name,
"rowTitleAttributes": {"data-qa": f"hub-row-{row_id}-title"},
"title": section_name,
"titleAttributes": {"data-qa": f"hub-row-{row_id}-title"},
"attributes": {"data-qa": f"hub-row-{row_id}-state"},
"valueList": [{"text": section_content["text"]}],
"actions": [
Expand All @@ -113,7 +113,7 @@ def get_row_context_for_section(
CompletionStatus.COMPLETED,
CompletionStatus.INDIVIDUAL_RESPONSE_REQUESTED,
):
context["rowItems"][0]["iconType"] = "check"
context["itemsList"][0]["iconType"] = "check"

return context

Expand Down
2 changes: 1 addition & 1 deletion templates/confirm-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% set error_title = _("There is a problem with your answer") %}
{% include "partials/error-panel.html" %}
{% endif %}
<h1 class="question__title ons-u-fs-xxl" data-qa="confirm-email-title">{{ content.question.title }}</h1>
<h1 class="question__title ons-u-fs-2xl" data-qa="confirm-email-title">{{ content.question.title }}</h1>
<div class="question__description">
<p>{{ content.question.description }}</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/feedback.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{% set error_title = ngettext('There is a problem with your feedback', 'There are %(num)s problems with your feedback', form.mapped_errors | length) %}
{% include "partials/error-panel.html" %}
{% endif %}
<h1 class="question__title ons-u-fs-xxl" data-qa="feedback-title">{{ content.question.title }}</h1>
<h1 class="question__title ons-u-fs-2xl" data-qa="feedback-title">{{ content.question.title }}</h1>
{%- for answer in question.answers -%}
{% include "partials/answer.html" %}
{%- endfor -%}
Expand Down
8 changes: 4 additions & 4 deletions templates/partials/answers/address.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"manualLinkText": _("Manually enter address"),
"isEditable": true,
"mandatory": answer.mandatory,
"APIDomain": address_lookup_api_url,
"APIDomainBearerToken": content.address_lookup_api_auth_token,
"apiDomain": address_lookup_api_url,
"apiDomainBearerToken": content.address_lookup_api_auth_token,
"instructions": _("Use up and down keys to navigate suggestions once you’ve typed more than two characters. Use the enter key to select a suggestion. Touch device users, explore by touch or with swipe gestures."),
"ariaYouHaveSelected": _("You have selected"),
"ariaMinChars": _("Enter 3 or more characters for suggestions."),
Expand All @@ -54,8 +54,8 @@
"errorTitle": ngettext('There is a problem with your answer', 'There are %(num)s problems with your answer', 1),
"errorMessageEnter": _("Enter an address"),
"errorMessageSelect": _("Select or manually enter an address"),
"errorMessageAPI": _("Sorry, there was a problem loading addresses"),
"errorMessageAPILinkText": _("Enter address manually"),
"errorMessageApi": _("Sorry, there was a problem loading addresses"),
"errorMessageApiLinkText": _("Enter address manually"),
"options": {
"regionCode": answer.lookup_options.region_code | lower,
"oneYearAgo": answer.lookup_options.one_year_ago if answer.lookup_options.one_year_ago is defined,
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/answers/textarea.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"label": label,
"value": input._value() | e,
"charCheckLimit": {
"limit": answer.max_length | default(input.maxlength, true),
"limit": answer.max_length | default(input.maxLength, true),
"charCountSingular": _("You have {x} character remaining"),
"charCountPlural": _("You have {x} characters remaining")
},
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/feedback-call-to-action.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": "feedback",
"heading": _("What do you think about this service?"),
"content": _("Your comments will help us make improvements"),
"url": url_for('post_submission.send_feedback'),
"linkUrl": url_for('post_submission.send_feedback'),
"linkText": _("Give feedback")
})
}}
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/introduction/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h2 class="ons-u-mt-m">{{ intro.title }}</h2>
{% endset %}
{% set item = {
"title": question.question,
"titleTag": "h3",
"headingLevel": 3,
"content": content,
"summaryAttributes": {
"data-ga": "click",
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/summary/list-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
) %}
{% endif %}
{% set group_config = {
"groupTitle": list_title,
"title": list_title,
"rows": rows,
"placeholderText": empty_list_text,
} %}
Expand Down
4 changes: 2 additions & 2 deletions templates/partials/summary/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% do summary_groups.append
(
{
"groupTitle": group.title if group.title else None,
"title": group.title if group.title else None,
"id": group.id if group.id else None,
"rows": map_summary_item_config(
group=group,
Expand All @@ -40,7 +40,7 @@
{% do summary_sections.append
(
{
"summaryTitle": section.title if summary_type == "Summary",
"title": section.title if summary_type == "Summary",
"groups": summary_groups
}
)
Expand Down
Loading
Loading