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

Take part document #4218

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Take part document #4218

wants to merge 8 commits into from

Conversation

KludgeKML
Copy link
Contributor

@KludgeKML KludgeKML commented Sep 3, 2024

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

What

Handle Take Part documents in Frontend, in preparation for them being taken out of Government Frontend

Why

https://trello.com/c/0LYU5bSd/318-move-route-document-type-takepart-from-governmentfrontend-to-frontend

How

These documents all have a fixed prefix, so add a scoped route for them, a controller, a model and a view. Here we add the initial ContentItem model the document type models will be based on, with the minimum functionality required to get Take Part documents working.

We also port across the figure component, which is used in this document type.

We also create a couple of helpers for rendering generic content.

Screenshots?

From example page: https://www.gov.uk/government/get-involved/take-part/improve-your-social-housing

Before (running in Government Frontend)

www gov uk_government_get-involved_take-part_improve-your-social-housing (1)

After (running in Frontend)

frontend dev gov uk_government_get-involved_take-part_improve-your-social-housing (1)

@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 3, 2024 16:10 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 4, 2024 08:35 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 4, 2024 08:53 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 4, 2024 09:38 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 4, 2024 11:52 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 4, 2024 11:53 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 4, 2024 12:04 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 4, 2024 14:19 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 4, 2024 14:43 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 5, 2024 10:06 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 5, 2024 10:09 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 5, 2024 10:15 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 5, 2024 10:18 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 5, 2024 10:24 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 5, 2024 10:25 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 5, 2024 12:52 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 5, 2024 13:09 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 5, 2024 14:55 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 9, 2024 13:05 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4218 September 10, 2024 13:27 Inactive
@@ -102,6 +102,15 @@ cy:
components:
figure:
image_credit: 'Delwedd gan: %{credit}'
content_item:
schema_name:
take_part:
Copy link
Contributor

Choose a reason for hiding this comment

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

There's also a formats lower this file that contains content for the original frontend document types.

I think they should all be in the same place, wherever that is.

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 to formats

- Used in Take Part, among others
- Has Welsh and English translations
- Includes spec file, documentation

Commit audit trail:
- app/assets/stylesheets/components/_figure.scss alphagov/government-frontend@10399a3
- app/views/components/_figure.html.erb alphagov/government-frontend@fe98d1d
- app/views/components/docs/figure.yml alphagov/government-frontend@fe98d1d
- en.yml/cy.yml alphagov/government-frontend@450b53a
- spec/components/figure_spec.rb alphagov/government-frontend@fe98d1d
- Add code in ContentItem links into the desired internal format
  for the sidebar.

Commit audit trail:
- app/views/shared/_footer_navigation.html.erb alphagov/government-frontend@6500698
- app/views/shared/_sidebar_navigation.html.erb alphagov/government-frontend@abd4912
- Add helper to provide language names and translate content info
  into component format
- Add methods to ContentItem to provide available translations

Commit audit trail:
- app/helpers/locale_helper.rb alphagov/government-frontend@90f0dd8
  https://github.com/alphagov/government-frontend/blame/517e4d4619595806bc9a1fb904b2badb65332eaf/app/helpers/application_helper.rb
- app/views/shared/_translations.html.erb alphagov/government-frontend@887399c
- en.yml/cy.yml alphagov/government-frontend@665e1c1
- add view and helpers
- convert test suite to RSpec on move
- add take_part translation keys used in title_helper to formats
  section in localisation files (in government-frontend this
  was in content_item.schema_name.*)
- note that we explicitly remove the content-bottom-margin div
  class that was immediately inside the 2/3rds column. This is
  a style used in a handful of government-frontend document
  types which (on review with frontend developers) does not
  really fix the problem it's trying to fix (insufficient bottom
  margin on some tablet-sized devices). This has been captured
  as alphagov/govuk_publishing_components#4220
  to be fixed properly in the components gem.

Commit audit trail:
- app/views/take_part/show.html.erb alphagov/government-frontend@e858440
- app/helpers/machine_readable_metadata_helper.rb alphagov/government-frontend@5fb924e
- app/helpers/title_helper.rb alphagov/government-frontend@08db76d
- spec/system/take_part_spec.rb alphagov/government-frontend@6ecd50c
commit audit trail:
alphagov/government-frontend@76e9bd2#diff-6048e9f535fbd535b1c38ab5e387e5c6e0a485d411e9edbbbce9b111b40c25b7
(We have not copied the no-image tags yet, as they are not relevant for the
take_part document type. We will bring in when a document type without images
is ported over)
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.

3 participants