Skip to content

Commit

Permalink
Remove feature flag for political and history mode
Browse files Browse the repository at this point in the history
  • Loading branch information
leenagupte committed Dec 12, 2019
1 parent ca694f2 commit a7667cb
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 50 deletions.
1 change: 0 additions & 1 deletion app/controllers/political_controller.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true

class PoliticalController < ApplicationController
before_action { authorise_user!(User::PRE_RELEASE_FEATURES_PERMISSION) }
before_action :check_permission

def edit
Expand Down
80 changes: 39 additions & 41 deletions app/views/documents/index/_filters.html.erb
Expand Up @@ -100,47 +100,45 @@
%>
</div>

<% if current_user.has_permission?(User::PRE_RELEASE_FEATURES_PERMISSION) %>
<div class="govuk-form-group">
<%= render "govuk_publishing_components/components/label", {
text: t("documents.index.filter.political"),
html_for: "political-filter",
bold: true
} %>
<%= select_tag "political",
options_for_select([["Yes", "yes"], ["No", "no"]], [params[:political]]),
include_blank: true,
id: "political-filter",
class: "govuk-select",
data: {
gtm: "select-political",
"gtm-visibility-tracking": params[:political].present? || nil,
"gtm-value": params[:political]
}
%>
</div>

<div class="govuk-form-group">
<%= render "govuk_publishing_components/components/label", {
text: t("documents.index.filter.history_mode"),
html_for: "history_mode-filter",
bold: true
} %>
<%= select_tag "history_mode",
options_for_select([["Yes", "yes"], ["No", "no"]], [params[:history_mode]]),
include_blank: true,
id: "history_mode-filter",
class: "govuk-select",
data: {
gtm: "select-history_mode",
"gtm-visibility-tracking": params[:history_mode].present? || nil,
"gtm-value": params[:history_mode]
}
%>
</div>
<% end %>
<div class="govuk-form-group">
<%= render "govuk_publishing_components/components/label", {
text: t("documents.index.filter.political"),
html_for: "political-filter",
bold: true
} %>
<%= select_tag "political",
options_for_select([["Yes", "yes"], ["No", "no"]], [params[:political]]),
include_blank: true,
id: "political-filter",
class: "govuk-select",
data: {
gtm: "select-political",
"gtm-visibility-tracking": params[:political].present? || nil,
"gtm-value": params[:political]
}
%>
</div>

<div class="govuk-form-group">
<%= render "govuk_publishing_components/components/label", {
text: t("documents.index.filter.history_mode"),
html_for: "history_mode-filter",
bold: true
} %>
<%= select_tag "history_mode",
options_for_select([["Yes", "yes"], ["No", "no"]], [params[:history_mode]]),
include_blank: true,
id: "history_mode-filter",
class: "govuk-select",
data: {
gtm: "select-history_mode",
"gtm-visibility-tracking": params[:history_mode].present? || nil,
"gtm-value": params[:history_mode]
}
%>
</div>

<%= hidden_field_tag "sort", @sort %>
Expand Down
12 changes: 5 additions & 7 deletions app/views/documents/show/_content_settings.html.erb
Expand Up @@ -39,13 +39,11 @@
} %>
<% end %>
<% if current_user.has_permission?(User::PRE_RELEASE_FEATURES_PERMISSION) %>
<% items << {
field: t("documents.show.content_settings.political.title"),
value: @edition.political? ? t("documents.show.content_settings.political.true_label") : t("documents.show.content_settings.political.false_label"),
edit: @edition.editable? ? { href: political_path, data_attributes: { gtm: "edit-political" } } : {}
} %>
<% end %>
<% items << {
field: t("documents.show.content_settings.political.title"),
value: @edition.political? ? t("documents.show.content_settings.political.true_label") : t("documents.show.content_settings.political.false_label"),
edit: @edition.editable? ? { href: political_path, data_attributes: { gtm: "edit-political" } } : {}
} %>
<%= render "govuk_publishing_components/components/summary_list", {
id: "content_settings",
Expand Down
2 changes: 1 addition & 1 deletion app/views/documents/show/_summary_tab.html.erb
Expand Up @@ -4,7 +4,7 @@
<%= render "documents/show/submitted_for_review" %>
<% end %>
<% if @edition.history_mode? && current_user.has_permission?(User::PRE_RELEASE_FEATURES_PERMISSION) %>
<% if @edition.history_mode? %>
<%= render "documents/show/historical_notice" %>
<% end %>
Expand Down

0 comments on commit a7667cb

Please sign in to comment.