Skip to content

Commit

Permalink
Remove feedback component (#4046)
Browse files Browse the repository at this point in the history
* Remove feedback component

* remove further redundant code
  • Loading branch information
martyn-w authored Jun 25, 2024
1 parent 57e3f70 commit 441e152
Show file tree
Hide file tree
Showing 17 changed files with 12 additions and 71 deletions.
7 changes: 0 additions & 7 deletions app/components/footer/feedback_component.html.erb

This file was deleted.

3 changes: 0 additions & 3 deletions app/components/footer/feedback_component.rb

This file was deleted.

8 changes: 0 additions & 8 deletions app/components/footer_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
<%= render Footer::TalkToUsComponent.new %>
<% end %>
<% if feedback? %>
<%= render Footer::FeedbackComponent.new %>
<% end %>
<% if mailing_list? %>
<%= render Footer::MailingListComponent.new %>
<% end %>
<%= render Footer::CookieAcceptanceComponent.new %>

<footer class="site-footer">
Expand Down
11 changes: 1 addition & 10 deletions app/components/footer_component.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
class FooterComponent < ViewComponent::Base
def initialize(talk_to_us: true, feedback: false)
def initialize(talk_to_us: true)
super

@talk_to_us = talk_to_us
@feedback = feedback
end

def talk_to_us?
@talk_to_us
end

def feedback?
@feedback
end

def mailing_list?
@mailing_list
end
end
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def sentry_dsn
end

def content_footer_kwargs(front_matter)
defaults = { talk_to_us: true, feedback: false }
defaults.merge(front_matter.symbolize_keys.slice(:talk_to_us, :feedback))
defaults = { talk_to_us: true }
defaults.merge(front_matter.symbolize_keys.slice(:talk_to_us))
end
end
1 change: 0 additions & 1 deletion app/views/content/help-and-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ description: |-
Contact Get Into Teaching by phone or live chat and find out how to get dedicated support from an adviser, attend an event, or sign up for tailored emails.
navigation: 40
layout: "layouts/minimal"
feedback: false
talk_to_us: false
content:
- content/help-and-support/header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ keywords:
- BTEC
- HND
talk_to_us: false
feedback: false
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ calls_to_action:
Length of training: "3 months"
Qualification: "Early years teacher status"
talk_to_us: false
feedback: false
---

The early years are critical in children’s development. As an early years teacher you’ll work with young children up to the age of 5. You’ll use your knowledge and skills to help young children enjoy high standards of teaching and open their minds to new ideas every day.
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/category.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
<%= render(partial) %>
<% end %>
<%= render FooterComponent.new(talk_to_us: false, feedback: false) %>
<%= render FooterComponent.new(talk_to_us: false) %>
<% end %>
</html>
2 changes: 1 addition & 1 deletion app/views/layouts/feedback.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
</section>
<% end %>
<%= render FooterComponent.new(talk_to_us: false, feedback: false) %>
<%= render FooterComponent.new(talk_to_us: false) %>
<% end %>
</html>
2 changes: 1 addition & 1 deletion app/views/layouts/registration.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
</section>
</section>

<%= render FooterComponent.new(talk_to_us: false, feedback: false) %>
<%= render FooterComponent.new(talk_to_us: false) %>
<% end %>
</html>
2 changes: 1 addition & 1 deletion app/views/layouts/registration_with_image_above.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
</section>
<% end %>
<%= render FooterComponent.new(talk_to_us: false, feedback: false) %>
<%= render FooterComponent.new(talk_to_us: false) %>
<% end %>
</html>
2 changes: 1 addition & 1 deletion app/views/layouts/registration_with_side_images.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
</section>
</div>

<%= render FooterComponent.new(talk_to_us: false, feedback: false) %>
<%= render FooterComponent.new(talk_to_us: false) %>
<% end %>
</html>
2 changes: 1 addition & 1 deletion app/views/layouts/welcome.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
<% end %>
<% end %>
<%= render FooterComponent.new(talk_to_us: true, feedback: false) %>
<%= render FooterComponent.new(talk_to_us: true) %>
<% end %>
</html>
16 changes: 0 additions & 16 deletions spec/components/footer/feedback_component_spec.rb

This file was deleted.

13 changes: 0 additions & 13 deletions spec/components/footer_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@

before { render }

let(:feedback_selector) { ".feedback-bar" }
let(:talk_to_us_selector) { ".talk-to-us" }

specify "renders the footer" do
expect(page).to have_css(".site-footer")
end

specify "renders the 'Feedback bar' by default" do
expect(page).not_to have_css(feedback_selector)
end

specify "renders the 'Talk To Us' section by default" do
expect(page).to have_css(talk_to_us_selector)
end
Expand All @@ -24,14 +19,6 @@
expect(page).to have_css(".cookie-acceptance")
end

context "when feedback is disabled" do
subject! { render_inline(described_class.new(feedback: false)) }

specify "does not render the feedback bar" do
expect(page).not_to have_css(feedback_selector)
end
end

context "when 'Talk to us' is disabled" do
subject! { render_inline(described_class.new(talk_to_us: false)) }

Expand Down
6 changes: 3 additions & 3 deletions spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@

subject { content_footer_kwargs(front_matter) }

it { is_expected.to eq({ talk_to_us: true, feedback: false }) }
it { is_expected.to eq({ talk_to_us: true }) }

context "when overriden in the front_matter" do
let(:front_matter) { { talk_to_us: false, feedback: false, other: false } }
let(:front_matter) { { talk_to_us: false, other: false } }

it { is_expected.to eq({ talk_to_us: false, feedback: false }) }
it { is_expected.to eq({ talk_to_us: false }) }
end
end
end

0 comments on commit 441e152

Please sign in to comment.