Skip to content

Commit 792ed6a

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/glob-10.5.0
2 parents e996cf0 + 391554f commit 792ed6a

File tree

6 files changed

+152
-27
lines changed

6 files changed

+152
-27
lines changed

.schemas-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v5.63.0
1+
v5.66.0

app/questionnaire/path_finder.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def _remove_current_blocks_answers_for_backwards_routing(
253253
)
254254
if "when" in rule:
255255
self._remove_block_answers_for_backward_routing_according_to_when_rule(
256-
rule["when"], answer_ids_for_current_block
256+
rule["when"], answer_ids_for_current_block, this_location
257257
)
258258

259259
self.data_stores.progress_store.remove_location_for_backwards_routing(
@@ -264,7 +264,10 @@ def _remove_current_blocks_answers_for_backwards_routing(
264264
)
265265

266266
def _remove_block_answers_for_backward_routing_according_to_when_rule(
267-
self, rules: Mapping, answer_ids_for_current_block: list[str]
267+
self,
268+
rules: Mapping,
269+
answer_ids_for_current_block: list[str],
270+
this_location: Location,
268271
) -> None:
269272
operands = self.schema.get_operands(rules)
270273

@@ -273,9 +276,12 @@ def _remove_block_answers_for_backward_routing_according_to_when_rule(
273276
"identifier" in rule
274277
and rule["identifier"] in answer_ids_for_current_block
275278
):
276-
self.data_stores.answer_store.remove_answer(rule["identifier"])
279+
self.data_stores.answer_store.remove_answer(
280+
answer_id=rule["identifier"],
281+
list_item_id=this_location.list_item_id,
282+
)
277283

278284
if QuestionnaireSchema.has_operator(rule):
279285
return self._remove_block_answers_for_backward_routing_according_to_when_rule(
280-
rule, answer_ids_for_current_block
286+
rule, answer_ids_for_current_block, this_location
281287
)

app/translations/messages.pot

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Translations template for PROJECT.
2-
# Copyright (C) 2025 ORGANIZATION
2+
# Copyright (C) 2026 ORGANIZATION
33
# This file is distributed under the same license as the PROJECT project.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2026.
55
#
66
#, fuzzy
77
msgid ""
88
msgstr ""
99
"Project-Id-Version: PROJECT VERSION\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2025-01-10 12:58+0000\n"
11+
"POT-Creation-Date: 2026-01-05 11:41+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -17,39 +17,39 @@ msgstr ""
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Generated-By: Babel 2.14.0\n"
1919

20-
#: app/forms/validators.py:389 app/jinja_filters.py:111
20+
#: app/forms/validators.py:391 app/jinja_filters.py:111
2121
#, python-format
2222
msgid "%(num)s year"
2323
msgid_plural "%(num)s years"
2424
msgstr[0] ""
2525
msgstr[1] ""
2626

27-
#: app/forms/validators.py:393 app/jinja_filters.py:119
27+
#: app/forms/validators.py:395 app/jinja_filters.py:119
2828
#, python-format
2929
msgid "%(num)s month"
3030
msgid_plural "%(num)s months"
3131
msgstr[0] ""
3232
msgstr[1] ""
3333

34-
#: app/jinja_filters.py:161
34+
#: app/jinja_filters.py:159
3535
#, python-format
3636
msgid "%(date)s at %(time)s"
3737
msgstr ""
3838

39-
#: app/jinja_filters.py:175
39+
#: app/jinja_filters.py:173
4040
#, python-format
4141
msgid "%(from_date)s to %(to_date)s"
4242
msgstr ""
4343

44-
#: app/jinja_filters.py:441
44+
#: app/jinja_filters.py:439
4545
msgid "Change answer for {item_name}: {question_title_or_answer_label}"
4646
msgstr ""
4747

48-
#: app/jinja_filters.py:445
48+
#: app/jinja_filters.py:443
4949
msgid "Change your answer for: {question_title_or_answer_label}"
5050
msgstr ""
5151

52-
#: app/jinja_filters.py:765
52+
#: app/jinja_filters.py:764
5353
#: templates/partials/summary/collapsible-summary.html:27
5454
#: templates/partials/summary/summary.html:24
5555
msgid "No answer provided"
@@ -210,7 +210,7 @@ msgstr ""
210210
msgid "Enter the year in a valid format. For example, 2023."
211211
msgstr ""
212212

213-
#: app/forms/validators.py:400
213+
#: app/forms/validators.py:402
214214
#, python-format
215215
msgid "%(num)s day"
216216
msgid_plural "%(num)s days"
@@ -427,7 +427,7 @@ msgstr ""
427427
#: templates/individual_response/confirmation-text-message.html:39
428428
#: templates/individual_response/question.html:5 templates/interstitial.html:7
429429
#: templates/listcollectorcontent.html:8 templates/sectionsummary.html:11
430-
#: templates/sectionsummary.html:51
430+
#: templates/sectionsummary.html:52
431431
msgid "Continue"
432432
msgstr ""
433433

@@ -477,15 +477,15 @@ msgstr ""
477477
msgid "Your answers have been submitted."
478478
msgstr ""
479479

480-
#: app/views/contexts/view_submitted_response_context.py:33
480+
#: app/views/contexts/view_submitted_response_context.py:32
481481
msgid "Answers submitted for <span>{ru_name}</span> ({trad_as})"
482482
msgstr ""
483483

484-
#: app/views/contexts/view_submitted_response_context.py:37
484+
#: app/views/contexts/view_submitted_response_context.py:36
485485
msgid "Answers submitted for <span>{ru_name}</span>"
486486
msgstr ""
487487

488-
#: app/views/contexts/view_submitted_response_context.py:41
488+
#: app/views/contexts/view_submitted_response_context.py:40
489489
msgid "Answers submitted."
490490
msgstr ""
491491

@@ -561,7 +561,7 @@ msgstr ""
561561
msgid "Do not include confidential information, such as your contact details"
562562
msgstr ""
563563

564-
#: app/views/handlers/individual_response.py:151
564+
#: app/views/handlers/individual_response.py:153
565565
msgid "Person {list_item_position}"
566566
msgstr ""
567567

@@ -706,7 +706,7 @@ msgstr ""
706706
msgid "Thank you for completing the survey"
707707
msgstr ""
708708

709-
#: app/views/handlers/view_submitted_response.py:52
709+
#: app/views/handlers/view_submitted_response.py:51
710710
msgid "View Submitted Response"
711711
msgstr ""
712712

poetry.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schemas/test/en/test_confirmation_question_within_repeating_section.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,102 @@
482482
]
483483
},
484484
"type": "Question"
485+
},
486+
{
487+
"type": "ConfirmationQuestion",
488+
"id": "confirm-carer-block",
489+
"question": {
490+
"answers": [
491+
{
492+
"id": "confirm-carer-answer",
493+
"mandatory": true,
494+
"options": [
495+
{
496+
"label": "Yes, the carer answer is correct",
497+
"value": "Yes, the carer answer is correct"
498+
},
499+
{
500+
"label": "No, I need to change the carer answer",
501+
"value": "No, I need to change the carer answer"
502+
}
503+
],
504+
"type": "Radio"
505+
}
506+
],
507+
"id": "confirm-carer-question",
508+
"title": "Is the carer response correct?",
509+
"type": "General"
510+
},
511+
"routing_rules": [
512+
{
513+
"block": "carer-block",
514+
"when": {
515+
"==": [
516+
{
517+
"source": "answers",
518+
"identifier": "confirm-carer-answer"
519+
},
520+
"No, I need to change the carer answer"
521+
]
522+
}
523+
},
524+
{
525+
"block": "student-block"
526+
}
527+
]
528+
},
529+
{
530+
"id": "student-block",
531+
"question": {
532+
"id": "student-question",
533+
"type": "General",
534+
"title": {
535+
"placeholders": [
536+
{
537+
"placeholder": "person_name",
538+
"transforms": [
539+
{
540+
"arguments": {
541+
"delimiter": " ",
542+
"list_to_concatenate": [
543+
{
544+
"source": "answers",
545+
"identifier": "first-name"
546+
},
547+
{
548+
"source": "answers",
549+
"identifier": "last-name"
550+
}
551+
]
552+
},
553+
"transform": "concatenate_list"
554+
}
555+
]
556+
}
557+
],
558+
"text": "Is <strong>{person_name}</strong> currently a student?"
559+
},
560+
"answers": [
561+
{
562+
"id": "student-answer",
563+
"label": "Student",
564+
"mandatory": false,
565+
"type": "Radio",
566+
"default": "No",
567+
"options": [
568+
{
569+
"label": "Yes",
570+
"value": "Yes"
571+
},
572+
{
573+
"label": "No",
574+
"value": "No"
575+
}
576+
]
577+
}
578+
]
579+
},
580+
"type": "Question"
485581
}
486582
]
487583
}

tests/functional/spec/features/confirmation_question_within_repeating_section.spec.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import CarerPage from "../../generated_pages/confirmation_question_within_repeat
44
import DateOfBirthPage from "../../generated_pages/confirmation_question_within_repeating_section/dob-block.page";
55
import ConfirmDateOfBirthPage from "../../generated_pages/confirmation_question_within_repeating_section/confirm-dob-block.page";
66
import DefaultSectionSummary from "../../generated_pages/confirmation_question_within_repeating_section/default-section-summary.page";
7+
import ConfirmCarerPage from "../../generated_pages/confirmation_question_within_repeating_section/confirm-carer-block.page.js";
8+
import StudentPage from "../../generated_pages/confirmation_question_within_repeating_section/student-block.page.js";
79
import { click, verifyUrlContains } from "../../helpers";
810
describe("Feature: Confirmation Question Within A Repeating Section", () => {
911
describe("Given I am in a repeating section", () => {
@@ -60,5 +62,26 @@ describe("Feature: Confirmation Question Within A Repeating Section", () => {
6062
await expect(await $(CarerPage.questionText()).getText()).toContain("Does John Doe look");
6163
});
6264
});
65+
describe("Given a confirmation question", () => {
66+
it("When I go back to change my answer and return to the confirmation question, then the confirmation answer is cleared and I am routed to the next question", async () => {
67+
await $(DateOfBirthPage.day()).setValue("01");
68+
await $(DateOfBirthPage.month()).setValue("01");
69+
await $(DateOfBirthPage.year()).setValue("1990");
70+
await click(DateOfBirthPage.submit());
71+
await $(CarerPage.no()).click();
72+
await click(CarerPage.submit());
73+
await $(ConfirmCarerPage.noINeedToChangeTheCarerAnswer()).click();
74+
await click(ConfirmCarerPage.submit());
75+
await $(CarerPage.yes()).click();
76+
await click(CarerPage.submit());
77+
// Assert that neither confirmation radio is selected
78+
expect(await $(ConfirmCarerPage.yesTheCarerAnswerIsCorrect()).isSelected()).toBe(false);
79+
expect(await $(ConfirmCarerPage.noINeedToChangeTheCarerAnswer()).isSelected()).toBe(false);
80+
// Assert routed to next question
81+
await $(ConfirmCarerPage.yesTheCarerAnswerIsCorrect()).click();
82+
await click(ConfirmCarerPage.submit());
83+
await verifyUrlContains(StudentPage.pageName);
84+
});
85+
});
6386
});
6487
});

0 commit comments

Comments
 (0)