Extract features tab partial to a component
This commit is contained in:
committed by
Javi Martín
parent
726019616f
commit
6876f080a2
@@ -0,0 +1,7 @@
|
|||||||
|
<h2><%= t("admin.settings.index.feature_flags") %></h2>
|
||||||
|
|
||||||
|
<%= render Admin::Settings::TableComponent.new(setting_name: "feature", table_class: "featured-settings-table") do %>
|
||||||
|
<% settings.each do |key| %>
|
||||||
|
<%= render Admin::Settings::RowComponent.new(key, type: :feature, tab: "#tab-feature-flags") %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
31
app/components/admin/settings/features_tab_component.rb
Normal file
31
app/components/admin/settings/features_tab_component.rb
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
class Admin::Settings::FeaturesTabComponent < ApplicationComponent
|
||||||
|
def settings
|
||||||
|
%w[
|
||||||
|
feature.featured_proposals
|
||||||
|
feature.facebook_login
|
||||||
|
feature.google_login
|
||||||
|
feature.twitter_login
|
||||||
|
feature.wordpress_login
|
||||||
|
feature.public_stats
|
||||||
|
feature.signature_sheets
|
||||||
|
feature.user.recommendations
|
||||||
|
feature.user.recommendations_on_debates
|
||||||
|
feature.user.recommendations_on_proposals
|
||||||
|
feature.user.skip_verification
|
||||||
|
feature.community
|
||||||
|
feature.map
|
||||||
|
feature.allow_attached_documents
|
||||||
|
feature.allow_images
|
||||||
|
feature.help_page
|
||||||
|
feature.remote_translations
|
||||||
|
feature.translation_interface
|
||||||
|
feature.remote_census
|
||||||
|
feature.valuation_comment_notification
|
||||||
|
feature.graphql_api
|
||||||
|
feature.sdg
|
||||||
|
feature.machine_learning
|
||||||
|
feature.remove_investments_supports
|
||||||
|
feature.dashboard.notification_emails
|
||||||
|
]
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<h2><%= t("admin.settings.index.feature_flags") %></h2>
|
|
||||||
|
|
||||||
<%= render Admin::Settings::TableComponent.new(setting_name: "feature", table_class: "featured-settings-table") do %>
|
|
||||||
<% %w[feature.featured_proposals feature.facebook_login feature.google_login feature.twitter_login
|
|
||||||
feature.wordpress_login feature.public_stats feature.signature_sheets feature.user.recommendations
|
|
||||||
feature.user.recommendations_on_debates feature.user.recommendations_on_proposals
|
|
||||||
feature.user.skip_verification feature.community feature.map feature.allow_attached_documents
|
|
||||||
feature.allow_images feature.help_page feature.remote_translations feature.translation_interface
|
|
||||||
feature.remote_census feature.valuation_comment_notification feature.graphql_api feature.sdg
|
|
||||||
feature.machine_learning feature.remove_investments_supports].each do |key| %>
|
|
||||||
<%= render Admin::Settings::RowComponent.new(key, type: :feature, tab: "#tab-feature-flags") %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tabs-panel" id="tab-feature-flags">
|
<div class="tabs-panel" id="tab-feature-flags">
|
||||||
<%= render "features_tab" %>
|
<%= render Admin::Settings::FeaturesTabComponent.new %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tabs-panel" id="tab-map-configuration">
|
<div class="tabs-panel" id="tab-map-configuration">
|
||||||
|
|||||||
Reference in New Issue
Block a user