Skip to content

Commit

Permalink
Update Prepop with Latest Main (#1141)
Browse files Browse the repository at this point in the history
* Make response expiry date mandatory (#1104)

* Bind additional contexts to flush requests (#1108)

* Schemas v3.56.0 (#1110)

* Schemas v3.57.0 (#1113)

* Schemas v3.57.1 (#1115)

* Schemas v3.58.0 (#1116)

* Implement "progress" value source (#1044)

Co-authored-by: Rhys Berrow <[email protected]

* Fix handling of invalid values in form numerical inputs  (#1111)

* Update Chromedriver to version 113 (#1118)

* update chromedriver

* temporarily comment out line, to be fixed separately

* Feat/Grand calculated summary (#1107)

* initial ideas

* Implementation closer to calculated summaries

* better test schemas and routing evaluation

* get routing working

* dont need section id

* make routing better, start adding tests

* start fixing test schemas

* Two further schema fixes

* Fix remaining schema issue

* Add integration test

* Add functional test

* Functional tests for routing and answers not on the path

* Changing an answer updates GCS progress

* Add schema for overlapping answers

* Functionally test skip-question in grand calculated summary

* Add tests for GCS routing

* Fix errors caused by merge

* type hints, comments, remove some duplication

* fix formatting

* Update translation templates

* remove accidental update

* Fix some type hints

* Use validator branch and update test description

* refactor GCS answer format

* Fix lint and test errors

* Address PR comments

* improve context and coverage of test schemas

* Fix invalid schema and add invalid routing test

* Fix line length in test

* test schema linting

* Fix routing bug

* Make schema easier to follow

* Linting

* partial fix to routing

* Add addtional routing test case

* Remove arg from new test case

* Routing to next incomplete block for summaries

* linting error

* remove arg from router tests

* PR comments

* PR Comment

* Amend comment and improve dependencies function

* Handle merge errors

* fix gcs routing within same section

* Add test for GCS with progress value source

* Remove backtick

* update chromedriver

* Revert "update chromedriver"

This reverts commit a2e3698.

* Fix schema labels

* Revert validator branch to latest

* Fix dynamic answers functional test (#1121)

* Schemas v3.59.0 (#1130)

* Schemas v3.60.0 (#1133)

* Update to chromedriver v114 (#1134)

* Add DESNZ theme (#1131)

* Schemas v3.61.0 (#1139)

* Linting, formatting and cleaning up merge with main

---------

Co-authored-by: petechd <[email protected]>
Co-authored-by: Mebin Abraham <[email protected]>
Co-authored-by: Guilhem <[email protected]>
Co-authored-by: Katie Gardner_ONS <[email protected]>
Co-authored-by: Rhys Berrow <[email protected]>
  • Loading branch information
6 people authored Jun 16, 2023
1 parent 1a48972 commit 679c304
Show file tree
Hide file tree
Showing 13 changed files with 400 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .schemas-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.60.0
v3.61.0
4 changes: 4 additions & 0 deletions app/helpers/template_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
DBTDSITBusinessSurveyConfig,
DBTDSITNIBusinessSurveyConfig,
DBTNIBusinessSurveyConfig,
DESNZBusinessSurveyConfig,
DESNZNIBusinessSurveyConfig,
NIBusinessSurveyConfig,
ORRBusinessSurveyConfig,
SocialSurveyConfig,
Expand Down Expand Up @@ -188,6 +190,8 @@ def survey_config_mapping(
SurveyType.DBT_NI: DBTNIBusinessSurveyConfig,
SurveyType.DBT_DSIT: DBTDSITBusinessSurveyConfig,
SurveyType.DBT_DSIT_NI: DBTDSITNIBusinessSurveyConfig,
SurveyType.DESNZ: DESNZBusinessSurveyConfig,
SurveyType.DESNZ_NI: DESNZNIBusinessSurveyConfig,
SurveyType.ORR: ORRBusinessSurveyConfig,
SurveyType.CENSUS: (
WelshCensusSurveyConfig if language == "cy" else CensusSurveyConfig
Expand Down
10 changes: 8 additions & 2 deletions app/questionnaire/questionnaire_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,11 @@ def _get_section_and_block_ids_dependencies_for_progress_source_and_answer_ids_f
elif source == "progress" and identifier:
if selector == "section" and identifier != current_section_id:
# Type ignore: Added as this will be a set rather than a dict at this point
dependencies_ids_for_progress_value_source["sections"][identifier] = OrderedSet([current_section_id]) # type: ignore
dependencies_ids_for_progress_value_source["sections"][
identifier
] = OrderedSet(
[current_section_id]
) # type: ignore
elif selector == "block" and (
section_id := self.get_section_id_for_block_id(identifier)
):
Expand All @@ -1109,7 +1113,9 @@ def _get_section_and_block_ids_dependencies_for_progress_source_and_answer_ids_f
dependencies_ids_for_progress_value_source["blocks"][section_id] = {
identifier: OrderedSet()
}
dependencies_ids_for_progress_value_source["blocks"][section_id][identifier].add(current_section_id) # type: ignore
dependencies_ids_for_progress_value_source["blocks"][section_id][
identifier # type: ignore
].append(current_section_id)

return answer_id_list, dependencies_ids_for_progress_value_source

Expand Down
4 changes: 4 additions & 0 deletions app/survey_config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
DBTDSITBusinessSurveyConfig,
DBTDSITNIBusinessSurveyConfig,
DBTNIBusinessSurveyConfig,
DESNZBusinessSurveyConfig,
DESNZNIBusinessSurveyConfig,
NIBusinessSurveyConfig,
ORRBusinessSurveyConfig,
)
Expand All @@ -29,5 +31,7 @@
"DBTDSITBusinessSurveyConfig",
"DBTDSITNIBusinessSurveyConfig",
"ORRBusinessSurveyConfig",
"DESNZBusinessSurveyConfig",
"DESNZNIBusinessSurveyConfig",
"Link",
]
12 changes: 12 additions & 0 deletions app/survey_config/business_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ class DBTNIBusinessSurveyConfig(BusinessSurveyConfig):
) + read_file("./templates/assets/images/finance-ni-logo-stacked.svg")


@dataclass
class DESNZBusinessSurveyConfig(BusinessSurveyConfig):
masthead_logo: str = read_file("./templates/assets/images/desnz-logo-stacked.svg")


@dataclass
class DESNZNIBusinessSurveyConfig(BusinessSurveyConfig):
masthead_logo: str = read_file(
"./templates/assets/images/desnz-logo-stacked.svg"
) + read_file("./templates/assets/images/finance-ni-logo-stacked.svg")


@dataclass
class ORRBusinessSurveyConfig(BusinessSurveyConfig):
masthead_logo: str = read_file("./templates/assets/images/orr-logo.svg")
Expand Down
2 changes: 2 additions & 0 deletions app/survey_config/survey_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ class SurveyType(Enum):
DBT_DSIT = "dbt-dsit"
DBT_DSIT_NI = "dbt-dsit-ni"
ORR = "orr"
DESNZ = "desnz"
DESNZ_NI = "desnz-ni"
CENSUS = "census"
CENSUS_NISRA = "census-nisra"
75 changes: 75 additions & 0 deletions schemas/test/en/test_theme_desnz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"mime_type": "application/json/ons/eq",
"language": "en",
"schema_version": "0.0.1",
"data_version": "0.0.3",
"survey_id": "0",
"title": "Test Department for Energy Security and Net Zero",
"theme": "desnz",
"description": "A questionnaire to demo the DESNZ survey theme",
"metadata": [
{
"name": "user_id",
"type": "string"
},
{
"name": "period_id",
"type": "string"
},
{
"name": "ru_name",
"type": "string"
}
],
"questionnaire_flow": {
"type": "Linear",
"options": {
"summary": {
"collapsible": false
}
}
},
"sections": [
{
"id": "section",
"groups": [
{
"blocks": [
{
"type": "Question",
"id": "radio",
"question": {
"answers": [
{
"id": "radio-answer",
"mandatory": false,
"options": [
{
"label": "Bacon",
"value": "Bacon"
},
{
"label": "Eggs",
"value": "Eggs"
},
{
"label": "Sausage",
"value": "Sausage"
}
],
"type": "Radio"
}
],
"id": "radio-question",
"title": "What is your favourite breakfast food?",
"type": "General"
}
}
],
"id": "group",
"title": "DESNZ Theme Test"
}
]
}
]
}
75 changes: 75 additions & 0 deletions schemas/test/en/test_theme_desnz_ni.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"mime_type": "application/json/ons/eq",
"language": "en",
"schema_version": "0.0.1",
"data_version": "0.0.3",
"survey_id": "0",
"title": "Test NI Department for Energy Security and Net Zero",
"theme": "desnz-ni",
"description": "A questionnaire to demo the DESNZ-NI survey theme",
"metadata": [
{
"name": "user_id",
"type": "string"
},
{
"name": "period_id",
"type": "string"
},
{
"name": "ru_name",
"type": "string"
}
],
"questionnaire_flow": {
"type": "Linear",
"options": {
"summary": {
"collapsible": false
}
}
},
"sections": [
{
"id": "section",
"groups": [
{
"blocks": [
{
"type": "Question",
"id": "radio",
"question": {
"answers": [
{
"id": "radio-answer",
"mandatory": false,
"options": [
{
"label": "Bacon",
"value": "Bacon"
},
{
"label": "Eggs",
"value": "Eggs"
},
{
"label": "Sausage",
"value": "Sausage"
}
],
"type": "Radio"
}
],
"id": "radio-question",
"title": "What is your favourite breakfast food?",
"type": "General"
}
}
],
"id": "group",
"title": "DESNZ-NI Theme Test"
}
]
}
]
}
Loading

0 comments on commit 679c304

Please sign in to comment.