Rename Widgets components to Widget
So naming is consistent with the way Admin::Widget controllers are named.
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
</header>
|
||||
</article>
|
||||
|
||||
<%= render Widgets::Feeds::ParticipationComponent.new(feeds) %>
|
||||
<%= render Widget::Feeds::ParticipationComponent.new(feeds) %>
|
||||
|
||||
<% if processes_feed %>
|
||||
<div class="feeds-list">
|
||||
<%= render Widgets::Feeds::FeedComponent.new(processes_feed) %>
|
||||
<%= render Widget::Feeds::FeedComponent.new(processes_feed) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Widgets::Feeds::DebateComponent < ApplicationComponent
|
||||
class Widget::Feeds::DebateComponent < ApplicationComponent
|
||||
attr_reader :debate
|
||||
|
||||
def initialize(debate)
|
||||
@@ -1,4 +1,4 @@
|
||||
class Widgets::Feeds::FeedComponent < ApplicationComponent
|
||||
class Widget::Feeds::FeedComponent < ApplicationComponent
|
||||
attr_reader :feed
|
||||
delegate :kind, to: :feed
|
||||
|
||||
@@ -15,11 +15,11 @@ class Widgets::Feeds::FeedComponent < ApplicationComponent
|
||||
def item_component_class
|
||||
case kind
|
||||
when "proposals"
|
||||
Widgets::Feeds::ProposalComponent
|
||||
Widget::Feeds::ProposalComponent
|
||||
when "debates"
|
||||
Widgets::Feeds::DebateComponent
|
||||
Widget::Feeds::DebateComponent
|
||||
when "processes"
|
||||
Widgets::Feeds::ProcessComponent
|
||||
Widget::Feeds::ProcessComponent
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="row margin-bottom feeds-list feeds-participation">
|
||||
<% feeds.each do |feed| %>
|
||||
<% if feed_proposals?(feed) || feed_debates?(feed) %>
|
||||
<%= render Widgets::Feeds::FeedComponent.new(feed) %>
|
||||
<%= render Widget::Feeds::FeedComponent.new(feed) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
class Widgets::Feeds::ParticipationComponent < ApplicationComponent
|
||||
class Widget::Feeds::ParticipationComponent < ApplicationComponent
|
||||
attr_reader :feeds
|
||||
|
||||
def initialize(feeds)
|
||||
@@ -1,4 +1,4 @@
|
||||
class Widgets::Feeds::ProcessComponent < ApplicationComponent
|
||||
class Widget::Feeds::ProcessComponent < ApplicationComponent
|
||||
attr_reader :process
|
||||
|
||||
def initialize(process)
|
||||
@@ -1,4 +1,4 @@
|
||||
class Widgets::Feeds::ProposalComponent < ApplicationComponent
|
||||
class Widget::Feeds::ProposalComponent < ApplicationComponent
|
||||
attr_reader :proposal
|
||||
|
||||
def initialize(proposal)
|
||||
@@ -1 +1 @@
|
||||
<%= render Widgets::Feeds::ParticipationComponent.new(@feeds) %>
|
||||
<%= render Widget::Feeds::ParticipationComponent.new(@feeds) %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="feeds-list">
|
||||
<% @feeds.each do |feed| %>
|
||||
<% if feed_processes?(feed) %>
|
||||
<%= render Widgets::Feeds::FeedComponent.new(feed) %>
|
||||
<%= render Widget::Feeds::FeedComponent.new(feed) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Widgets::Feeds::FeedComponent, type: :component do
|
||||
describe Widget::Feeds::FeedComponent, type: :component do
|
||||
it "renders a message when there are no items" do
|
||||
feed = double(kind: "debates", items: [])
|
||||
component = Widgets::Feeds::FeedComponent.new(feed)
|
||||
component = Widget::Feeds::FeedComponent.new(feed)
|
||||
|
||||
render_inline component
|
||||
|
||||
@@ -15,7 +15,7 @@ describe Widgets::Feeds::FeedComponent, type: :component do
|
||||
let(:feed) { Widget::Feed.new(kind: "debates") }
|
||||
|
||||
it "points to the debates path for homepage debates feeds" do
|
||||
component = Widgets::Feeds::FeedComponent.new(feed)
|
||||
component = Widget::Feeds::FeedComponent.new(feed)
|
||||
|
||||
render_inline component
|
||||
|
||||
@@ -23,7 +23,7 @@ describe Widgets::Feeds::FeedComponent, type: :component do
|
||||
end
|
||||
|
||||
it "points to the debates filtered by goal for goal feeds" do
|
||||
component = Widgets::Feeds::FeedComponent.new(SDG::Widget::Feed.new(feed, SDG::Goal[6]))
|
||||
component = Widget::Feeds::FeedComponent.new(SDG::Widget::Feed.new(feed, SDG::Goal[6]))
|
||||
|
||||
render_inline component
|
||||
|
||||
@@ -35,7 +35,7 @@ describe Widgets::Feeds::FeedComponent, type: :component do
|
||||
let(:feed) { Widget::Feed.new(kind: "proposals") }
|
||||
|
||||
it "points to the proposals path for homepage proposals feeds" do
|
||||
component = Widgets::Feeds::FeedComponent.new(feed)
|
||||
component = Widget::Feeds::FeedComponent.new(feed)
|
||||
|
||||
render_inline component
|
||||
|
||||
@@ -43,7 +43,7 @@ describe Widgets::Feeds::FeedComponent, type: :component do
|
||||
end
|
||||
|
||||
it "points to the proposals filtered by goal for goal feeds" do
|
||||
component = Widgets::Feeds::FeedComponent.new(SDG::Widget::Feed.new(feed, SDG::Goal[6]))
|
||||
component = Widget::Feeds::FeedComponent.new(SDG::Widget::Feed.new(feed, SDG::Goal[6]))
|
||||
|
||||
render_inline component
|
||||
|
||||
@@ -55,7 +55,7 @@ describe Widgets::Feeds::FeedComponent, type: :component do
|
||||
let(:feed) { Widget::Feed.new(kind: "processes") }
|
||||
|
||||
it "points to the legislation processes path for homepage processes feeds" do
|
||||
component = Widgets::Feeds::FeedComponent.new(feed)
|
||||
component = Widget::Feeds::FeedComponent.new(feed)
|
||||
|
||||
render_inline component
|
||||
|
||||
@@ -63,7 +63,7 @@ describe Widgets::Feeds::FeedComponent, type: :component do
|
||||
end
|
||||
|
||||
it "points to the legislation processes path for goal processes feeds" do
|
||||
component = Widgets::Feeds::FeedComponent.new(SDG::Widget::Feed.new(feed, SDG::Goal[6]))
|
||||
component = Widget::Feeds::FeedComponent.new(SDG::Widget::Feed.new(feed, SDG::Goal[6]))
|
||||
|
||||
render_inline component
|
||||
|
||||
Reference in New Issue
Block a user