-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add feature-toggling for reports page transition
Add a feature toggle for toggling on/off the ability to see either the existing, bootstrap-based reports page, or the new design-system based one. Currently the new one is a duplicate of the old one (and so is still bootstrap-based). Future commits will replace the new view with a design-system based one. Since there were ignored brakeman warnings for the redirects on the reports controller, similar ignores need to be made for the legacy reports controller.
- Loading branch information
1 parent
bcde81e
commit 5016773
Showing
7 changed files
with
346 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class LegacyReportsController < ApplicationController | ||
include ActionView::Helpers::TagHelper | ||
|
||
before_action :authenticate_user! | ||
|
||
def index; end | ||
|
||
def progress | ||
redirect_to Report.new("editorial_progress").url, allow_other_host: true | ||
end | ||
|
||
def organisation_content | ||
redirect_to Report.new("organisation_content").url, allow_other_host: true | ||
end | ||
|
||
def edition_churn | ||
redirect_to Report.new("edition_churn").url, allow_other_host: true | ||
end | ||
|
||
def all_edition_churn | ||
redirect_to Report.new("all_edition_churn").url, allow_other_host: true | ||
end | ||
|
||
def content_workflow | ||
redirect_to Report.new("content_workflow").url, allow_other_host: true | ||
end | ||
|
||
def all_content_workflow | ||
redirect_to Report.new("all_content_workflow").url, allow_other_host: true | ||
end | ||
|
||
def all_urls | ||
redirect_to Report.new("all_urls").url, allow_other_host: true | ||
end | ||
|
||
private | ||
|
||
def report_last_updated(report_name) | ||
last_updated = ::Report.new(report_name).last_updated | ||
if last_updated | ||
tag.span "Generated #{last_updated.to_fs(:govuk_date)}", class: "text-muted" | ||
else | ||
tag.span "Report currently unavailable", class: "text-muted" | ||
end | ||
end | ||
helper_method :report_last_updated | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<div class="page-header"> | ||
<h1>CSV Reports</h1> | ||
<p>These reports are updated every hour.</p> | ||
</div> | ||
|
||
<p> | ||
<strong><%= link_to 'All documents for departmental distribution', organisation_content_report_path(format: :csv) %></strong><br /> | ||
<%= report_last_updated("organisation_content")%> | ||
</p> | ||
<p> | ||
<strong><%= link_to 'Churn in non-archived editions', edition_churn_report_path(format: :csv) %></strong><br /> | ||
<%= report_last_updated("edition_churn")%> | ||
</p> | ||
<p> | ||
<strong><%= link_to 'Churn in all editions', all_edition_churn_report_path(format: :csv) %></strong><br /> | ||
<%= report_last_updated("all_edition_churn")%> | ||
</p> | ||
<p> | ||
<strong><%= link_to 'Progress on all non-archived editions', progress_report_path(format: :csv) %></strong><br /> | ||
<%= report_last_updated("editorial_progress")%> | ||
</p> | ||
<p> | ||
<strong><%= link_to 'Content summary and workflow history for all published editions', content_workflow_report_path(format: :csv) %></strong><br /> | ||
<%= report_last_updated("content_workflow")%> | ||
</p> | ||
<p> | ||
<strong><%= link_to 'Content summary and workflow history for all editions', all_content_workflow_report_path(format: :csv) %></strong><br /> | ||
<%= report_last_updated("all_content_workflow")%> | ||
</p> | ||
<p> | ||
<strong><%= link_to 'All URLs', all_urls_report_path(format: :csv) %></strong><br /> | ||
<%= report_last_updated("all_urls")%> | ||
</p> | ||
|
||
<% content_for :page_title, "Reports" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.