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

Prevent IR request link from appearing on all interstitial pages #310

Merged
merged 28 commits into from Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
279f45d
Make initial changes
petechd Sep 28, 2020
47ada7d
Add logic
petechd Sep 28, 2020
01b3070
Refactor if conditions
petechd Sep 28, 2020
71a436f
Merge branch 'master' into fix-request-link
petechd Sep 28, 2020
7297452
Remove list item id check
petechd Sep 28, 2020
14c8ae3
Merge branch 'fix-request-link' of github.com:ONSdigital/eq-questionn…
petechd Sep 28, 2020
b84f9c5
Add review changes
petechd Sep 28, 2020
5335b9b
Update app/views/handlers/__init__.py
petechd Sep 29, 2020
dc4c3d7
Add review changes
petechd Sep 29, 2020
61997cc
Merge branch 'master' into fix-request-link
petechd Sep 29, 2020
28bc326
Remove repetition
petechd Sep 29, 2020
2a3ef4f
Merge branch 'master' into fix-request-link
petechd Sep 29, 2020
50cd252
Move method to content block and rename
petechd Sep 29, 2020
47ed188
Merge branch 'master' into fix-request-link
petechd Sep 29, 2020
0381d03
Move method to questionnaire schema class
petechd Sep 29, 2020
a445a32
Remove method from a list
petechd Sep 29, 2020
269760e
Add test and new interstitial
petechd Sep 29, 2020
a951414
Rename method
petechd Sep 29, 2020
289960f
Move method to content handler
petechd Sep 29, 2020
87af948
Add review changes
petechd Sep 29, 2020
91ddfda
Merge branch 'master' into fix-request-link
petechd Sep 29, 2020
e55bff1
Implement new method in individual_response file
petechd Sep 29, 2020
70b09be
Merge branch 'fix-request-link' of github.com:ONSdigital/eq-questionn…
petechd Sep 29, 2020
68b63c6
Reformat method
petechd Sep 29, 2020
b18d919
Fix method typo
petechd Sep 29, 2020
13d4eed
Fix integration test
petechd Sep 29, 2020
358e589
Update test_schemas/en/test_individual_response.json
petechd Sep 30, 2020
c19aa5e
Move ir method to its group
petechd Sep 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/questionnaire/questionnaire_schema.py
Expand Up @@ -497,3 +497,8 @@ def _get_error_messages(self):
messages.update(self.json["messages"])

return messages

def get_individual_response_individual_section_id(self):
return self._questionnaire_json.get("individual_response", {}).get(
"individual_section_id"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to group this with the other IR methods in this class for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to ir group now.

12 changes: 5 additions & 7 deletions app/views/handlers/content.py
Expand Up @@ -34,8 +34,8 @@ def get_context(self):
self._current_location.list_item_id,
self._questionnaire_store,
)
if self._is_first_block_in_individual_response(
self._current_location, self._schema
if self._is_block_first_block_in_individual_response(
self._current_location.block_id, self._schema
)
else None,
}
Expand All @@ -45,8 +45,6 @@ def _get_content_title(self, transformed_block):
if content:
return self._get_safe_page_title(content["title"])

def _is_first_block_in_individual_response(self, location, schema):
section = schema.json.get("individual_response", {}).get(
"individual_section_id"
)
return location.block_id == schema.get_first_block_id_for_section(section)
def _is_block_first_block_in_individual_response(self, block_id, schema):
section_id = schema.get_individual_response_individual_section_id()
return block_id == schema.get_first_block_id_for_section(section_id)
MebinAbraham marked this conversation as resolved.
Show resolved Hide resolved