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

Move speech document #4573

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

Move speech document #4573

wants to merge 22 commits into from

Conversation

sairamya93
Copy link
Contributor

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

What

To handle the rendering of Speech document type from government_frontend to frontend as part of [RFC 175]

Why

https://trello.com/c/IKDY5W9u/371-move-document-type-speech-from-government-frontend-to-frontend

How

To add a scoped route for, a controller, a model and a view. Here we split up the methods in the original file into presenter, model and its related concerns, with the minimum functionality required to get Speech document working.

Screenshots?

Frontend

Screenshot 2025-01-09 at 10 39 43
Screenshot 2025-01-09 at 10 40 22
Screenshot 2025-01-09 at 10 40 53

Government-Frontend

Screenshot 2025-01-09 at 10 44 31
Screenshot 2025-01-09 at 10 44 56
Screenshot 2025-01-09 at 10 45 59

@sairamya93 sairamya93 marked this pull request as draft January 9, 2025 11:25
@sairamya93 sairamya93 force-pushed the move-speech-document branch from 876a571 to 01f9f7e Compare January 9, 2025 14:50
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4573 January 9, 2025 14:51 Inactive
@sairamya93 sairamya93 force-pushed the move-speech-document branch from 01f9f7e to ce2b218 Compare January 9, 2025 16:13
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4573 January 9, 2025 16:14 Inactive
@sairamya93 sairamya93 force-pushed the move-speech-document branch from ce2b218 to c08cd5b Compare January 9, 2025 17:59
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4573 January 9, 2025 18:00 Inactive
@sairamya93 sairamya93 marked this pull request as ready for review January 10, 2025 08:50
app/models/speech.rb Outdated Show resolved Hide resolved
@@ -0,0 +1,8 @@
<% if content_item.historically_political? %>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this shared partial should also be in a separate commit, which is then followed by the generation of the locale keys in c08cd5b

@view_context = ApplicationController.new.view_context
end

def display_date(timestamp, format = "%-d %B %Y")
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this method as the helper method is already available in date_helper.rb

</div>
</div>

<%= render 'shared/publisher_metadata_with_logo' %>
Copy link
Contributor

Choose a reason for hiding this comment

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

This has been renamed to publisher_metadata in c4dceb3

@@ -37,18 +37,18 @@ def component_name
expect(rendered).to have_css(".app-c-important-metadata dt", text: "Case type:")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this file crept into this commit during a rebase

expect(page).to have_text("Published 8 March 2016")
end

# Check important metadata
Copy link
Contributor

Choose a reason for hiding this comment

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

This test will need to be updated to use the metadata block component instead

expect(page).to have_text("Location: Women in Nuclear UK Conference, Church House Conference Centre, Dean's Yard, Westminster, London")
end

# Check the footer for published dates
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment can be removed

expect(page).to have_css(".gem-c-translation-nav")
expect(page).to have_text("بوريس جونسون: يمنح القرار الترخيص اللازم لمنظمة حظر الأسلحة الكيميائية لإزالة سلائف تلك الأسلحة من ليبيا تمهيدا لإتلافها في بلد ثالث. وبذلك نكون قد خففنا خطر وقوع هذه الأسلحة في أيدي الإرهابيين ")
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I think an additional test can be added to test a withdrawn speech page, where we would expect the notice is included on the page.

@@ -1,22 +1,26 @@
<% content_for :title do %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the commit message be updated to mention the changes made to the view

@@ -9,5 +9,38 @@ def withdrawn?
def withdrawal_notice
content_store_hash["withdrawn_notice"]
end

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this accidentally crept in during a rebase.

- Speech presenter that handles retrieving of important_metadata is copied over from government-frontend
- from and speaker_without_profile methods are handled in Speech model instead of presenter
Commit audit trail - https://github.com/alphagov/government-frontend/blob/122ae292fa540059ee165a94f8129d873c5205d5/app/presenters/speech_presenter.rb
 - Run the command : rake "consolidation:copy_translation[speech,formats.speech]"
- Add important-metadata component in stylesheets and views
- Update dartsass.rb and add yaml file
- Add important_metadata component tests
- Updated code with important_metadata changes
Audit trail: alphagov/government-frontend@b1da197
- Run the command: rake "consolidation:copy_translation[content_item.schema_name.written_statement,formats.written_statement]"
- To handle the pluralization for Speech in all the locales
Run the command: rake "consolidation:copy_translation[content_item.schema_name.speech,formats.speech]"

Commit audit trail: https://github.com/alphagov/government-frontend/tree/122ae292fa540059ee165a94f8129d873c5205d5/config/locales
…d its related concerns

- Refactor to handle the speaker link along with the organisations for speeches in Speech model
- Modify Views with publisher_metadata content
  Reference commit: 338bfe1
 - Add tests for speech model and its related concerns
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.

4 participants