Skip to content

Move call for evidence pages from government-frontend #4855

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

Draft
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

deborahchua
Copy link
Contributor

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

Copy the rendering code for call for evidence pages from government-frontend.

Why

Trello card

Examples

Welsh only call for evidence:

"Open" call for evidence:

"Closed" call for evidence:

Call for evidence "outcome"

Screenshots?

Welsh only call for evidence

https://www.gov.uk/government/calls-for-evidence/cerbydau-awtomataidd-datganiad-o-egwyddorion-diogelwch.cy

Screenshot 2025-06-17 at 12 26 31
Screenshot 2025-06-17 at 13 39 39

"Open" Call for evidence

https://www.gov.uk/government/calls-for-evidence/review-of-cqc-regulation-9a-visiting-and-accompanying-in-care-homes-hospitals-and-hospices

open_call_for_evidence-1
open_call_for_evidence-2

"Closed" Call for evidence

https://www.gov.uk/government/calls-for-evidence/data-brokers-and-national-security

closed_call_for_evidence-1
closed_call_for_evidence-2

Call for evidence "outcome"

https://www.gov.uk/government/calls-for-evidence/youth-vaping-call-for-evidence

call_for_evidence_outcome-1
call_for_evidence_outcome-2
call_for_evidence_outcome-3

Screenshot 2025-06-17 at 14 24 51

Similar to consultations, call for evidence documents have different
stages:
- unopened call for evidence
- open call for evidence
- closed call for evidence
- call for evidence outcome
The view has been directly copied over from government-frontend.
It will be updated to match the new data structure in a later
commit.

Commit audit trail:
- https://github.com/alphagov/government-frontend/blob/f1f866238d476a4281cd79fdbab2d671c6d46619/app/views/content_items/call_for_evidence.html.erb
Ran `bundle exec erb_lint --lint-all --autocorrect`
This keeps it consistent with the approach in other document types,
which call the metadata component directly.

It has also been updated to use `extra_headers`, which ensures that
the open graph meta tags are added to the page source correctly.
We also need to add in the description tag as the machine_readable_metadata
component only adds the og tag i.e. <meta name="og:description" content="description">

Audit trail:
machine_readable_metadata_helper.rb: https://github.com/alphagov/government-frontend/blob/0adbc42e5591f9ad914791306b1ae2558f9d3cfc/app/helpers/machine_readable_metadata_helper.rb
Ran rake "consolidation:copy_translation[content_item.schema_name.call_for_evidence, formats.call_for_evidence]"

Audit trail:
- https://github.com/alphagov/government-frontend/tree/0adbc42e5591f9ad914791306b1ae2558f9d3cfc/config/locales
These were introduced in 4b1d2d4
and can be used in the withdrawn notice banner.
These methods are used in the `attachments_list` partial, which will
also be included on consultation and publication pages.

There were no existing tests and have now been added.

Audit trail:
- https://github.com/alphagov/government-frontend/blob/0adbc42e5591f9ad914791306b1ae2558f9d3cfc/app/presenters/content_item/attachments.rb
This is used to pass information to the `devolved_nations`
publishing component.

It is also used by a number of other document types:
- consultation
- detailed_guide
- html_publication
- publication

There were no existing tests and have now been added.

Commit audit trail:
- https://github.com/alphagov/government-frontend/blob/main/app/presenters/content_item/national_applicability.rb > app/models/concerns/national_applicability.rb
The methods `ways_to_respond?` and `response_form?` are called in
the view to determine whether certain sections are shown on the
page. They were originally returning the first contact details
available in their check, but we only care about whether they are
present or not.

Audit trail:
- https://github.com/alphagov/government-frontend/blob/ef31d532d50a1ae80e8831f2f6eac60f54e06ec9/app/presenters/call_for_evidence_presenter.rb#L75-L97
- https://github.com/alphagov/government-frontend/blob/ef31d532d50a1ae80e8831f2f6eac60f54e06ec9/test/presenters/call_for_evidence_presenter_test.rb#L107-L148
Ran rake "consolidation:copy_translation[content_item.schema_name.open_call_for_evidence, formats.open_call_for_evidence.name]"

Audit trail:
- https://github.com/alphagov/government-frontend/tree/cadb97a620b03c18037aec2c4df72546048e6a87/config/locales
Ran rake "consolidation:copy_translation[content_item.schema_name.closed_call_for_evidence, formats.closed_call_for_evidence.name]"

Audit trail:
- https://github.com/alphagov/government-frontend/tree/cadb97a620b03c18037aec2c4df72546048e6a87/config/locales
Ran rake "consolidation:copy_translation[content_item.schema_name.call_for_evidence_outcome, formats.call_for_evidence_outcome.name]"

Audit trail:
- https://github.com/alphagov/government-frontend/tree/cadb97a620b03c18037aec2c4df72546048e6a87/config/locales
Ran `bundle exec i18n-tasks mv "formats.call_for_evidence.{few,many,one,other,two,zero}" "formats.call_for_evidence.name.\1"` in line with d2cf3ea
Frontend has a slightly different yaml structure and locale keys for
call for evidence content now sit under `formats`.
All tests have also been commented out, and incrementally
introduced/updated in following commits.
These features apply to all types of call for evidence documents.
Ran govuk-docker-run bundle exec rake "consolidation:copy_translation[components.print_link]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants