-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add list collector content pages #1156
Conversation
* 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 --------- Co-authored-by: petechd <[email protected]> Co-authored-by: Mebin Abraham <[email protected]> Co-authored-by: Guilhem <[email protected]>
* 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]>
* Calculated summary of dynamic answers * Fix progress update for non-repeating blocks * Add integration test and dependency fix * Use looping4 validator branch * Experimental fix * Rename schemas and add comments * Functional tests * Fix schema name in test * Fix typo * Restore progress capture for add block * Move some comments into docstrings * PR comments * Update test and add another * Remove unnecessary posts after test assertion * Use list for dynamic answer values * Revert validator branch * Dummy change * Revert dummy change
* Initial repeating blocks test schema * Schema for repeating blocks and section summary incomplete + ListCollector Question handling many add types by enum. * Repeating blocks are presented to the user and can be answered however are not posted correctly and navigation not tested. * List Collector now always enters add_block & both add_block and edit_block go to repeating_blocks if existing. * make format * edit_block does not lead to repeating_blocks. All repeating_blocks show on list collector summary. * Blocks in repeating_blocks calculated upfront. Answers from repeating_blocks shown on list collector summary underneath the relevant list item. * Reverting list_collector handler and fixing invalid use of set * Return to summary reused throughout ListActions * Adding list item completion progress to progress_store and loading this upon block GET. * Looping 2.5 - Simple Repeating Blocks in List Collector (No Item Progress Tracking) (#1100) * Schema for repeating blocks and section summary incomplete + ListCollector Question handling many add types by enum. * Repeating blocks are presented to the user and can be answered however are not posted correctly and navigation not tested. * List Collector now always enters add_block & both add_block and edit_block go to repeating_blocks if existing. * make format * edit_block does not lead to repeating_blocks. All repeating_blocks show on list collector summary. * Blocks in repeating_blocks calculated upfront. Answers from repeating_blocks shown on list collector summary underneath the relevant list item. * Reverting list_collector handler and fixing invalid use of set * Return to summary reused throughout ListActions * Fixing existing questionnaire store tests broken by adding list item progress. * Added remove list item progress to progress store and called from questionnaire store updater. * List Item Progress tracked with the section and list item id keyed progresses. * List Item Progress starts with list item add, adding the add block to the list items list of completed locations * Make response expiry date mandatory (#1104) * Reverting change to serialize() method naming + removing dev only chnage. * Bind additional contexts to flush requests (#1108) * Addressing comments to simplify progress evaluation logic + adding cached property for repeating block ids. * Schemas v3.56.0 (#1110) * Addressing comments regarding common usage of first incomplete repeating blocks to evaluate completeness. * Augmenting comment in capture_dependent_sections_for_list(self, list_name) * Bug fix to repeating block cache, list section deps reverted to dict of lists, renamed method for removing list items. * Removing get_completed_block_ids from questionnaire store updater as it is duplicate of router.is_block_complete * Preliminary impl for list item row icons - breaks tests * Feat/looping 2.5 list item progress (#1105) * Schema for repeating blocks and section summary incomplete + ListCollector Question handling many add types by enum. * Repeating blocks are presented to the user and can be answered however are not posted correctly and navigation not tested. * List Collector now always enters add_block & both add_block and edit_block go to repeating_blocks if existing. * make format * edit_block does not lead to repeating_blocks. All repeating_blocks show on list collector summary. * Blocks in repeating_blocks calculated upfront. Answers from repeating_blocks shown on list collector summary underneath the relevant list item. * Reverting list_collector handler and fixing invalid use of set * Return to summary reused throughout ListActions * Adding list item completion progress to progress_store and loading this upon block GET. * Fixing existing questionnaire store tests broken by adding list item progress. * Added remove list item progress to progress store and called from questionnaire store updater. * List Item Progress tracked with the section and list item id keyed progresses. * List Item Progress starts with list item add, adding the add block to the list items list of completed locations * Reverting change to serialize() method naming + removing dev only chnage. * Addressing comments to simplify progress evaluation logic + adding cached property for repeating block ids. * Addressing comments regarding common usage of first incomplete repeating blocks to evaluate completeness. * Augmenting comment in capture_dependent_sections_for_list(self, list_name) * Bug fix to repeating block cache, list section deps reverted to dict of lists, renamed method for removing list items. * Removing get_completed_block_ids from questionnaire store updater as it is duplicate of router.is_block_complete * Fixing tests broken by list collector icon render changes * Fixing incorrect formatting and rewording a type hint * Cleaned up evaluation of list item icon. * Schemas v3.57.0 (#1113) * Reverting accidental reversion of a file * 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) * Passing only section id and bool for repeating blocks for list context and using kwargs where possible. * Adding missing list context constructor arg * Enforcing kwargs on _build_list_items_context * Merge conflict resolution with main. * Running make format * Adding list collector with repeating blocks fixture and testing the repeating blocks are mapped by id correctly when schema loads. * Completing unit testing of additions to QuestionnaireSchema * Update Chromedriver to version 113 (#1118) * update chromedriver * temporarily comment out line, to be fixed separately * ListContext unit tests * Updating list collector summary to correctly acquire related answers and avoid breaks when list collector with same name appears twice. * Enforcing kwargs on update_section_status and make format * 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 * Integration tests started * Fix dynamic answers functional test (#1121) * Repeating blocks integration test suite complete * Schemas v3.59.0 (#1130) * Make format * running and fixing mypy * Merge with main and format and lint * Fixing linting errors and pointing to relevant validator * Fixing validator tag typo * Schemas v3.60.0 (#1133) * Fixing mocker patch of renamed method * make format * Update to chromedriver v114 (#1134) * Functional test progress * Add DESNZ theme (#1131) * Schemas v3.61.0 (#1139) * Adding functional test for editing repeating block answers from section summary * Asserting completing list items in func tests and editing from section summary. * Misc type hinting * Misc type hinting * Formatting * Consolidating duplicate func test helper method and fixing typos. * Linting, formatting and merging with feat prepop. * Fixing broken tests * Linting, formatting and cleaning up merge with main * ListRepeatingBlock now extends to ListAction and does not invoke parent handle_post. * Addressing PR comments 16-6-23 * Reverting local test changes. * Reverting local test changes by formatting * Reverting local test changes by formatting * Adding additional docs and type hints to ProgressStore * Addressing PR comments. * Fixing list collector (no RP) icons * Removing person icon change. * Adding repeating blocks to the submission payload and renaming list name in test schema. * Adding test coverage for repeating block answers in submission payload. * Reformat * Adding func test and schema for a repeating blocks LC on a hub questionnaire. * Fixing test broken in prev commit. * Reformatting. * Updating naming of progress store methods follwoing convos. * Updating comment * Updating comment * Formatting * Addressing comments * Remvovign whitespace from schema * Amending naming and type hinting in list collector block summary and adding context to list collector RP schema. * Changing to unit and currency in simple RB schema. * Formatting * Removing redundant test schema * Using latest validator --------- 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]>
* Create supplementary data store (#1143) * Create supplementary data store * Fix incorrect check on supplementary list items * Custom exception for bad supplementary data selector * Tests for supplementary data store * Change keyname for supplementary data * Update test survey data * Fix test failure from merge * PR Comments * dataset id is not optional * Linting * add survey id and dataset id to loggin
* Initial changes * Updating to align with launcher changes * Changes by katherinegardener * Make mock dataset return a list * Remove cors * Add additional supplementary data schema for sds testing * Remove survey_id from metadata * Extracting survey id from the survey, not survey metadata. * Including survey_id in survey metadata again * linting * Formatting and linting. * Removing redundant schema for sds testing. * Adding more accurate mock period ids and incrementing sds_dataset_version in mock data. * Readme and dataset version --------- Co-authored-by: katie-gardner <[email protected]> Co-authored-by: Katie Gardner_ONS <[email protected]>
Logic in list collector content handler is now aligned with list collector. As discussed with @MebinAbraham the existing issue affecting both types of list collectors (section progress key not being added to progress store when no question block prior to list collector) needs to be addressed separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working subject to the issue that will be resolved on another card 👍 - few minor thoughts added
@katie-gardner all addressed, except two where we are not sure if the changes are necessary or keeping it as it is is necessary (but we left comments). Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unhappy path testing all good and all my comments addressed 👍
What is the context of this PR?
This adds new list collector content block, two new classes
ListCollectorContentBlock
andListCollectorContent
(for list context), as well as newListContentContext
for summaries. content block uses newListCollectorContent
class which inherits fromQuestion
and uses latestrepeating blocks
feature first introduced here. More details on the card.Some extra changes were made to methods checking section completeness for the hub, before (for a section) we didn't take into account repeating blocks when checking it. Also, section progress was not being checked for repeating blocks when generating the link for the hub.
How to review
New integration and functional tests were added. Some changes in
generate_pages.py
were needed.Checklist