Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
elceebee committed Jan 8, 2025
1 parent dec53ff commit 33305e8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions app/models/withdrawal_reason.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ def self.get_reason_options(reason = '')
end
end

def self.all_reasons
selectable_reasons.map do |key, value|
build_reason(key, value)
end&.flatten
end

def self.build_reason(key, value)
if value == {}
key
Expand Down
6 changes: 5 additions & 1 deletion app/views/provider_interface/reports/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
<%= govuk_link_to t('page_titles.provider.diversity_report'), provider_interface_reports_provider_diversity_report_path(provider_id: provider) %>
</li>
<li>
<%= govuk_link_to t('page_titles.provider.withdrawal_report'), provider_interface_reports_withdrawal_reports_path %>
<% if FeatureFlag.active? :new_candidate_withdrawal_reasons %>
<%= govuk_link_to t('page_titles.provider.withdrawal_report'), provider_interface_reports_withdrawal_reports_path %>
<% else %>
<%= govuk_link_to t('page_titles.provider.withdrawal_report'), provider_interface_reports_provider_withdrawal_report_path(provider_id: provider) %>
<% end %>
</li>
</ul>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<%= row.with_cell(
text: t("provider_interface.withdrawal_reasons.show.#{heading}"),
html_attributes: { class: 'withdrawal-reasons-report-table__heading' },
) %>
) %>
<% end %>
<% end %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

RSpec.describe 'Provider with two providers reports index' do
include DfESignInHelpers

before do
FeatureFlag.deactivate(:new_candidate_withdrawal_reasons)
end

scenario 'when a provider user has more than one provider' do
given_a_provider_user_with_two_providers_exists
and_i_am_signed_in_as_provider_user
Expand Down

0 comments on commit 33305e8

Please sign in to comment.