views: fix deprecated calls to ViewComponent#with_variant.
This commit is contained in:
@@ -7,12 +7,4 @@ class ApplicationComponent < ViewComponent::Base
|
||||
def policy(subject)
|
||||
Pundit.policy!(current_user, subject)
|
||||
end
|
||||
|
||||
# XXX Silence warnings about `with_variant` being deprecated until we can fix it.
|
||||
# DEPRECATION WARNING: `with_variant` is deprecated and will be removed in ViewComponent v3.0.0
|
||||
def with_variant(...)
|
||||
ActiveSupport::Deprecation.silence do
|
||||
super(...)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
5
app/components/categorized_tag_list_component.rb
Normal file
5
app/components/categorized_tag_list_component.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# A vertical tag list, with tags split into categories. Used in app/views/posts/show.html.erb.
|
||||
class CategorizedTagListComponent < TagListComponent
|
||||
end
|
||||
6
app/components/inline_tag_list_component.rb
Normal file
6
app/components/inline_tag_list_component.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# A horizontal tag list, with tags grouped by category. Used in post tooltips,
|
||||
# on the comments index, and in the modqueue.
|
||||
class InlineTagListComponent < TagListComponent
|
||||
end
|
||||
5
app/components/meta_links_component.rb
Normal file
5
app/components/meta_links_component.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# The <link rel="next"> / <link rel="prev"> links in the <meta> element of the <head>.
|
||||
class MetaLinksComponent < PaginatorComponent
|
||||
end
|
||||
4
app/components/numbered_paginator_component.rb
Normal file
4
app/components/numbered_paginator_component.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class NumberedPaginatorComponent < PaginatorComponent
|
||||
end
|
||||
@@ -13,10 +13,6 @@ class PaginatorComponent < ApplicationComponent
|
||||
@params = params
|
||||
end
|
||||
|
||||
def use_sequential_paginator?
|
||||
paginator_mode != :numbered
|
||||
end
|
||||
|
||||
def pages
|
||||
last_page = total_pages.clamp(1..)
|
||||
left = (current_page - window).clamp(2..)
|
||||
|
||||
5
app/components/related_tag_list_component.rb
Normal file
5
app/components/related_tag_list_component.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# A simple vertical tag list with no post counts. Used in related tags.
|
||||
class RelatedTagListComponent < TagListComponent
|
||||
end
|
||||
5
app/components/search_tag_list_component.rb
Normal file
5
app/components/search_tag_list_component.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# A vertical tag list, used in the post index sidebar.
|
||||
class SearchTagListComponent < TagListComponent
|
||||
end
|
||||
4
app/components/sequential_paginator_component.rb
Normal file
4
app/components/sequential_paginator_component.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SequentialPaginatorComponent < PaginatorComponent
|
||||
end
|
||||
Reference in New Issue
Block a user