Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NU-19] Add flag to remove synaccess rev a relay option #5060

Merged
merged 3 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions app/helpers/products_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ def options_for_control_mechanism
end

def options_for_relay
{
RelaySynaccessRevA => RelaySynaccessRevA.name,
RelaySynaccessRevB => RelaySynaccessRevB.name,
RelayDataprobe => RelayDataprobe.name,
}
[
if SettingsHelper.feature_on?(:disable_relay_synaccess_rev_a)
nil
else
[RelaySynaccessRevA, RelaySynaccessRevA.name]
end,
[RelaySynaccessRevB, RelaySynaccessRevB.name],
[RelayDataprobe, RelayDataprobe.name],
].compact
end

def instrument_pricing_modes
Expand Down
1 change: 1 addition & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ feature:
show_daily_rate_option: true
sanger_enabled_service: <%= ENV.fetch("SANGER_ENABLED_SERVICE", false) %>
well_plate_alternative_csv_format: <%= ENV.fetch("well_plate_alternative_csv_format", false) %>
disable_relay_synaccess_rev_a: false

split_accounts:
# Roles are allowed to create Split Accounts
Expand Down
27 changes: 27 additions & 0 deletions spec/helpers/products_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

require "rails_helper"

RSpec.describe ProductsHelper do
describe "#options_for_relay" do
let(:subject) { options_for_relay }

it(
"list all relay types if none disabled",
{ feature_setting: { disable_relay_synaccess_rev_a: false } }
) do
expect(subject.to_h).to include(
RelaySynaccessRevA,
RelaySynaccessRevB,
RelayDataprobe
)
end

it(
"exclude synaccess rev a if disabled flag is on",
{ feature_setting: { disable_relay_synaccess_rev_a: true } }
) do
expect(subject.to_h).to_not include(RelaySynaccessRevA)
end
end
end