Skip to content

Commit

Permalink
Put Level B behind current_user ROLLOUT
Browse files Browse the repository at this point in the history
We'd like to ship this to a place with real user data to get feedback,
given that access to actual data for dev is not arriving in a timely
manner. We'd also like to restrict that to just one user for now.

Hide the link for them (it's vanishingly unlikely anyone's going to
the URL for these, and they're protected by the ExportPolicy in any
case).

Run

```
ROLLOUT.activate_user(
  :level_b_exports,
  User.find_by!(email: '[email protected]')
)
```

on prod to enable, and visit

https://report-official-development-assistance.service.gov.uk/rollout/features/level_b_exports

(only set up on prod at present so if you need this for other envs,
don't forget to add a `level_b_exports` feature through the appropriate
env rollout UI)

to set live for everyone later.
  • Loading branch information
rgarner committed Jan 24, 2025
1 parent a2bb3e6 commit 8f29fbd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
39 changes: 20 additions & 19 deletions app/views/exports/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,28 @@
- else
= a11y_action_link("Request", spending_breakdown_exports_path(fund_id: fund.id), t("table.export.spending_breakdown.name", fund: fund.name), ["govuk-link--no-visited-state"])

%h1.govuk-heading-m
Level B exports
- if ROLLOUT.active?(:level_b_exports, current_user)
%h1.govuk-heading-m
Level B exports

%table.govuk-table
%thead.govuk-table__head
%tr.govuk-table__row
%th.govuk-table__header{scope: "col"}
Fund
%th.govuk-table__header{scope: "col"}
= t("table.export.header.format")
%th.govuk-table__header{scope: "col"}
= t("table.header.default.actions")
%tbody.govuk-table__body
- @funds.each do |fund|
%table.govuk-table
%thead.govuk-table__head
%tr.govuk-table__row
%td.govuk-table__cell
= t("table.export.level_b.name", fund: fund.name)
%td.govuk-table__cell
CSV
%td.govuk-table__cell
= a11y_action_link("Download", level_b_exports_path(fund_id: fund.id, format: "csv"), t("table.export.level_b.name", fund: fund.name), ["govuk-link--no-visited-state"])
%th.govuk-table__header{scope: "col"}
Fund
%th.govuk-table__header{scope: "col"}
= t("table.export.header.format")
%th.govuk-table__header{scope: "col"}
= t("table.header.default.actions")
%tbody.govuk-table__body
- @funds.each do |fund|
%tr.govuk-table__row
%td.govuk-table__cell
= t("table.export.level_b.name", fund: fund.name)
%td.govuk-table__cell
CSV
%td.govuk-table__cell
= a11y_action_link("Download", level_b_exports_path(fund_id: fund.id, format: "csv"), t("table.export.level_b.name", fund: fund.name), ["govuk-link--no-visited-state"])

%h1.govuk-heading-m
Ad-hoc exports
Expand Down
1 change: 1 addition & 0 deletions spec/features/beis_users_can_download_exports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
end

scenario "downloading level B exports for a fund" do
allow(ROLLOUT).to receive(:active?).with(:level_b_exports, beis_user).and_return(true)
travel_to Time.zone.local(2025, 1, 21, 11, 26, 34)

other_fund_programme = create(:programme_activity, :newton_funded)
Expand Down

0 comments on commit 8f29fbd

Please sign in to comment.