Skip to content

Commit

Permalink
Update Ratifying partner text
Browse files Browse the repository at this point in the history
  • Loading branch information
inulty-dfe committed Jan 9, 2025
1 parent ea85330 commit f3179a2
Show file tree
Hide file tree
Showing 25 changed files with 148 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def update
if update_params[:accredited_provider_code] == 'other'
redirect_to_provider_search
elsif @course.update(update_params)
course_updated_message('Accredited provider')
course_updated_message('Ratifying partner')
redirect_to_update_successful
else
@errors = @course.errors.messages
Expand Down Expand Up @@ -127,7 +127,7 @@ def errors_for_search_query(code, query)
if other_selected_with_no_autocompleted_code?(code) && query.length < 2
errors = { accredited_provider: ['Accredited provider search too short, enter 2 or more characters'] }
elsif code.blank?
errors = { accredited_provider_code: ['Select an accredited provider'] }
errors = { accredited_provider_code: ['Select a ratifying partner'] }
end

errors
Expand Down
10 changes: 5 additions & 5 deletions app/views/publish/courses/_basic_details_tab.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,21 @@
end

unless @provider.accredited_provider?
summary_list.with_row(html_attributes: { data: { qa: "course__accredited_provider" } }) do |row|
row.with_key { "Accredited provider" }
summary_list.with_row(html_attributes: { data: { qa: "course__ratifying_partner" } }) do |row|
row.with_key { "Ratifying partner" }
row.with_value { course.accrediting_provider&.provider_name }
if course.is_published? || course.is_withdrawn?
row.with_action
elsif !course.accrediting_provider.nil?
row.with_action(href: accredited_provider_publish_provider_recruitment_cycle_course_path(@provider.provider_code, course.recruitment_cycle_year, course.course_code),
visually_hidden_text: "accredited provider")
visually_hidden_text: "ratifying partner")
elsif @provider.accredited_providers.any?
row.with_value do
"<div class=\"govuk-inset-text app-inset-text--narrow-border app-inset-text--important\">#{govuk_link_to('Select an accredited provider', accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code))}</div>".html_safe
"<div class=\"govuk-inset-text app-inset-text--narrow-border app-inset-text--important\">#{govuk_link_to('Select an accredited partner', accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code))}</div>".html_safe
end
else
row.with_value do
"<div class=\"govuk-inset-text app-inset-text--narrow-border app-inset-text--important\">#{govuk_link_to('Add at least one accredited provider', publish_provider_recruitment_cycle_accredited_providers_path(@course.provider_code, @course.recruitment_cycle_year))}</div>".html_safe
"<div class=\"govuk-inset-text app-inset-text--narrow-border app-inset-text--important\">#{govuk_link_to('Add at least one accredited partner', publish_provider_recruitment_cycle_accredited_providers_path(@course.provider_code, @course.recruitment_cycle_year))}</div>".html_safe
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="govuk-radios__item" data-qa="course__accredited_provider_option">
<div class="govuk-radios__item" data-qa="course__ratifying_partner_option">
<%= form.radio_button :accredited_provider_code,
provider_suggestion[:provider_code],
checked: provider_suggestion[:provider_code] == @course.accrediting_provider&.provider_code,
Expand Down
10 changes: 5 additions & 5 deletions app/views/publish/courses/accredited_provider/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :page_title, title_with_error_prefix("Accredited provider – #{course.name_and_code}", course.errors.any?) %>
<% content_for :page_title, title_with_error_prefix("Ratifying partner – #{course.name_and_code}", course.errors.any?) %>

<% content_for :before_content do %>
<%= govuk_back_link_to(details_publish_provider_recruitment_cycle_course_path(course.provider_code, course.recruitment_cycle_year, course.course_code)) %>
Expand All @@ -10,7 +10,7 @@
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-fieldset__heading">
<%= render CaptionText.new(text: course.name_and_code) %>
Accredited provider
Ratifying partner
</h1>
</legend>

Expand All @@ -20,14 +20,14 @@
url: accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code),
method: :put do |form| %>

<div class="govuk-radios govuk-!-margin-top-2" data-module="govuk-radios" data-qa="course__accredited_provider">
<div class="govuk-radios govuk-!-margin-top-2" data-module="govuk-radios" data-qa="course__ratifying_partner">
<%= render partial: "provider_suggestion", collection: @provider.accredited_bodies, locals: { form: } %>
</div>

<div class="govuk-button-group">
<%= form.submit "Update accredited provider", class: "govuk-button govuk-!-margin-top-5", data: { qa: "course__save" } %>
<%= form.submit "Update ratifying partner", class: "govuk-button govuk-!-margin-top-5", data: { qa: "course__save" } %>
<%= govuk_link_to(
"Add accredited provider",
"Add accredited partner",
search_publish_provider_recruitment_cycle_accredited_providers_path(course.provider_code, course.recruitment_cycle_year),
class: "govuk-!-margin-bottom-6 govuk-!-margin-top-5",
data: { qa: "course__add" }
Expand Down
8 changes: 4 additions & 4 deletions app/views/publish/courses/accredited_provider/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :page_title, title_with_error_prefix("Accredited provider – #{course.name_and_code}", @errors && @errors.any?) %>
<% content_for :page_title, title_with_error_prefix("Ratifying partner – #{course.name_and_code}", @errors && @errors.any?) %>

<% content_for :before_content do %>
<%= govuk_back_link_to(@back_link_path) %>
Expand All @@ -9,17 +9,17 @@
<div class="govuk-grid-column-full">
<%= form_with url: continue_publish_provider_recruitment_cycle_courses_accredited_provider_path(@provider.provider_code, @provider.recruitment_cycle_year), method: :get do |form| %>
<%= render "publish/courses/new_fields_holder", form:, except_keys: [:accredited_provider_code] do |fields| %>
<%= render "publish/shared/error_wrapper", error_keys: [:accredited_provider_code], data_qa: "course__accredited_provider" do %>
<%= render "publish/shared/error_wrapper", error_keys: [:accredited_provider_code], data_qa: "course__ratifying_partner" do %>
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-fieldset__heading">
<%= render CaptionText.new(text: t("course.add_course")) %>
Accredited provider
Ratifying partner
</h1>
</legend>
<%= render "publish/shared/error_messages", error_keys: [:accredited_provider_code] %>

<div class="govuk-radios" data-module="govuk-radios" data-qa="course__accredited_provider">
<div class="govuk-radios" data-module="govuk-radios" data-qa="course__ratifying_partner">
<% if @provider.accredited_bodies.length > 0 %>
<%= render partial: "provider_suggestion", collection: @provider.accredited_bodies.sort_by { |k| k[:provider_name] }, locals: { form: fields } %>
<% else %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/publish/courses/accredited_provider/search.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
Pick an accredited provider
Pick an accredited partner
</h1>

<p class="govuk-body">You searched for ‘<%= @query %>’.</p>
Expand All @@ -21,7 +21,7 @@
<% if @provider_suggestions.any? %>
<p class="govuk-body">We found these providers which matched your search:</p>

<div class="govuk-radios" data-module="govuk-radios" data-qa="course__accredited_provider">
<div class="govuk-radios" data-module="govuk-radios" data-qa="course__ratifying_partner">
<%= render partial: "provider_suggestion", collection: @provider_suggestions, locals: { form: } %>
<div class="govuk-radios__divider">or</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
Pick an accredited provider
Pick an accredited partner
</h1>

<p class="govuk-body">You searched for ‘<%= @query %>’.</p>
Expand All @@ -25,7 +25,7 @@
<% if @provider_suggestions.any? %>
<p class="govuk-body">We found these providers which matched your search:</p>

<div class="govuk-radios" data-module="govuk-radios" data-qa="course__accredited_provider">
<div class="govuk-radios" data-module="govuk-radios" data-qa="course__ratifying_partner">
<%= render partial: "provider_suggestion", collection: @provider_suggestions, locals: { form: } %>
<div class="govuk-radios__divider">or</div>

Expand Down
6 changes: 3 additions & 3 deletions app/views/publish/courses/confirmation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@
<% end %>

<% unless @provider.accredited_provider? || course.is_further_education? %>
<% summary_list.with_row(html_attributes: { data: { qa: "course__accredited_provider" } }) do |row| %>
<% row.with_key { "Accredited provider" } %>
<% summary_list.with_row(html_attributes: { data: { qa: "course__ratifying_partner" } }) do |row| %>
<% row.with_key { "Ratifying partner" } %>
<% row.with_value { course.accrediting_provider.provider_name } %>
<% if @provider.accredited_bodies.length > 1 %>
<% row.with_action(
href: new_publish_provider_recruitment_cycle_courses_accredited_provider_path(course.provider.provider_code, course.recruitment_cycle.year, params.to_unsafe_h.merge(goto_confirmation: true)),
visually_hidden_text: "accredited provider"
visually_hidden_text: "ratifying partner"
) %>
<% else %>
<% row.with_action %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/publish/courses/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<% @courses_by_accrediting_provider.each do |accrediting_provider, courses| %>
<section data-qa="courses__table-section">
<h2 class="govuk-heading-m">
<span class="govuk-caption-m">Accredited provider</span>
<span class="govuk-caption-m">Ratifying partner</span>
<%= accrediting_provider %>
</h2>

Expand Down
2 changes: 1 addition & 1 deletion app/views/support/courses/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Course name and code</th>
<th scope="col" class="govuk-table__header">Status</th>
<th scope="col" class="govuk-table__header">Ratifying Provider</th>
<th scope="col" class="govuk-table__header">Ratifying partner</th>
<th scope="col" class="govuk-table__header"></th>
</tr>
</thead>
Expand Down
8 changes: 4 additions & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ en:
train_with_us:
text: "Enter details about the training provider"
about_accrediting_provider:
text: "Enter details about the accredited provider"
text: "Enter details about the ratifying partner"
value_not_entered: "Not entered"
a_level_grades:
minimum_grade: Grade %{minimum_grade}
Expand Down Expand Up @@ -828,9 +828,9 @@ en:
applications_open_from:
blank: "Select an applications open date"
accrediting_provider:
blank: "Select an accredited provider"
is_not_accredited: "Update the accredited provider"
does_not_exist_in_cycle: "The accredited provider %{accredited_provider_code} does not exist in this cycle"
blank: "Select a ratifying partner"
is_not_accredited: "Update the ratifying partner"
does_not_exist_in_cycle: "The accredited partner %{accredited_provider_code} does not exist in this cycle"
is_send:
inclusion: Select if this course has a special educational needs and disability (SEND) specialism
a_level_subject_requirements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module CoursePreview
include_examples 'course with missing information', :train_with_disability, 'Enter details about training with disabilities and other needs'

include_examples 'course with missing information', :train_with_us, 'Enter details about the training provider'
include_examples 'course with missing information', :about_accrediting_provider, 'Enter details about the accredited provider'
include_examples 'course with missing information', :about_accrediting_provider, 'Enter details about the ratifying partner'
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
given_i_am_authenticated_as_a_provider_user
end

scenario 'Add accrediting provider to provider and provider has no accrediting providers, change accrediting provider of course then publish' do
and_the_provider_has_no_accredited_provider
scenario 'Add ratifying provider to training provider and provider has no accredited partner, change ratifying provider of course then publish' do
and_the_provider_has_no_accredited_partners
and_there_is_a_draft_course_with_an_unaccredited_provider

# Publising is invalid
when_i_visit_the_course_page
and_i_click_the_publish_button
then_i_should_see_an_error_message_that_accredited_provider_is_not_accredited
then_i_should_see_an_error_message_that_ratifying_provider_is_not_accredited

# Add accrediting provider to provider
when_i_click_the_error_message_link
Expand All @@ -28,11 +28,11 @@
# Publishing is invalid
when_i_visit_the_course_page
and_i_click_the_publish_button
then_i_should_see_an_error_message_that_accredited_provider_is_not_accredited
then_i_should_see_an_error_message_that_ratifying_provider_is_not_accredited

# Clicking error message allows user to select accrediting provider
when_i_click_the_error_message_link
and_i_choose_the_new_accredited_provider
and_i_choose_the_new_accredited_partner
and_i_click_the_publish_button
then_i_should_see_a_success_message
end
Expand All @@ -49,7 +49,7 @@

# Clicking error message allows user to select accrediting provider
when_i_click_the_select_accredited_provider_error_message_link
and_i_choose_the_new_accredited_provider
and_i_choose_the_new_accredited_partner
and_i_click_the_publish_button
then_i_should_see_a_success_message
end
Expand All @@ -68,7 +68,7 @@ def and_the_provider_has_a_valid_accrediting_provider
provider.update!(accrediting_provider_enrichments: [enrichment])
end

def and_the_provider_has_no_accredited_provider
def and_the_provider_has_no_accredited_partners
expect(provider.accredited_providers).to be_empty
end

Expand Down Expand Up @@ -103,12 +103,12 @@ def then_i_should_see_a_success_message
expect(page).to have_content('Your course has been published.')
end

def then_i_should_see_an_error_message_that_accredited_provider_is_not_accredited
expect(publish_provider_courses_show_page.error_messages).to include('Update the accredited provider')
def then_i_should_see_an_error_message_that_ratifying_provider_is_not_accredited
expect(publish_provider_courses_show_page.error_messages).to include('Update the ratifying partner')
end

def then_i_should_see_an_error_message_for_the_accrediting_provider
expect(publish_provider_courses_show_page.error_messages).to include('Select an accredited provider')
expect(publish_provider_courses_show_page.error_messages).to include('Select a ratifying partner')
end

def when_i_click_the_error_message_link
Expand All @@ -132,31 +132,31 @@ def and_i_search_for_an_accredited_provider
end

def and_i_fill_in_the_accredited_provider_form
publish_courses_new_accredited_provider_page.about_section_input.set('About course')
publish_courses_new_ratifying_partner_page.about_section_input.set('About course')

publish_courses_new_accredited_provider_page.submit.click
publish_courses_new_ratifying_partner_page.submit.click
end

def and_i_confirm_creation_of_the_accredited_provider
publish_courses_new_accredited_provider_page.submit.click
publish_courses_new_ratifying_partner_page.submit.click
end

def then_i_see_that_the_accredited_provider_has_been_added
expect(page).to have_content('Accredited provider added')
expect(page).to have_content('Accredited partner added')
end

def and_i_click_the_publish_button
publish_provider_courses_show_page.publish_button.click
end

def when_i_click_the_select_accredited_provider_error_message_link
page.click_link_or_button('Select an accredited provider')
page.click_link_or_button('Select a ratifying partner')
end

def and_i_choose_the_new_accredited_provider
def and_i_choose_the_new_accredited_partner
choose accredited_provider.provider_name
page.click_link_or_button('Update accredited provider')
expect(page).to have_content('Accredited provider updated')
page.click_link_or_button('Update ratifying partner')
expect(page).to have_content('Ratifying partner updated')
end

def and_an_accredited_provider_exists
Expand Down
Loading

0 comments on commit f3179a2

Please sign in to comment.