Skip to content

Commit

Permalink
Copy changes to some tags
Browse files Browse the repository at this point in the history
This is to make tags copy consistent across the board, no longer using all capital letters.
  • Loading branch information
zheileman committed Aug 12, 2024
1 parent 589261a commit 19593f0
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def sentence_type_label(offender)
def vlo_tag(offender)
return '' unless offender.active_vlo? || offender.victim_liaison_officers.any?

tag.span('VLO CONTACT', class: 'govuk-tag govuk-tag--red')
tag.span('VLO contact', class: 'govuk-tag govuk-tag--red')
end

def humanized_bool(bool_value)
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/early_allocation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ def pom_full_name(early_allocation)
end

EARLY_ALLOCATION_STATUSES = {
eligible: 'ELIGIBLE',
decision_pending: 'DECISION PENDING',
assessment_saved: 'ASSESSMENT SAVED',
eligible: 'eligible',
decision_pending: 'decision pending',
assessment_saved: 'assessment saved',
# in status terms we don't care about the need to make a new assessment
call_to_action: 'ASSESSMENT SAVED'
call_to_action: 'assessment saved'
}.freeze
end
2 changes: 1 addition & 1 deletion app/views/prisoners/review_case_details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-!-width-one-third">Victim liaison officer (VLO)
<br>
<span class="govuk-tag govuk-tag--red" style="margin-top: 5px;">NON-DISCLOSABLE</span>
<span class="govuk-tag govuk-tag--red" style="margin-top: 5px;">Non-Disclosable</span>
</td>

<% if @prisoner.active_vlo? && @prisoner.victim_liaison_officers.none? %>
Expand Down
8 changes: 4 additions & 4 deletions app/views/shared/_badges.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
<% status = offender.early_allocation_state %>
<% if EarlyAllocationHelper::EARLY_ALLOCATION_STATUSES.key?(status) %>
<span id="early-allocation-badge" class="govuk-tag govuk-tag--blue">
EARLY ALLOCATION <%= EarlyAllocationHelper::EARLY_ALLOCATION_STATUSES.fetch(status) %>
Early allocation <%= EarlyAllocationHelper::EARLY_ALLOCATION_STATUSES.fetch(status) %>
</span>
<% end %>
<% if offender.restricted_patient? %>
<%= render('shared/badges/restricted_patient_badge') %>
<% end %>
<% if @prison.womens? %>
<% if offender.complexity_level == 'high' %>
<%= render('shared/badges/complexity_badge', complexity_badge_text: 'HIGH COMPLEXITY') %>
<%= render('shared/badges/complexity_badge', complexity_badge_text: 'High complexity') %>
<% elsif offender.complexity_level == 'medium' %>
<%= render('shared/badges/complexity_badge', complexity_badge_text: 'MEDIUM COMPLEXITY') %>
<%= render('shared/badges/complexity_badge', complexity_badge_text: 'Medium complexity') %>
<% elsif offender.complexity_level == 'low' %>
<%= render('shared/badges/complexity_badge', complexity_badge_text: 'LOW COMPLEXITY') %>
<%= render('shared/badges/complexity_badge', complexity_badge_text: 'Low complexity') %>
<% end %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/shared/badges/_restricted_patient_badge.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<span id="restricted-patient-badge" class="govuk-tag govuk-tag--purple">RESTRICTED PATIENT</span>
<span id="restricted-patient-badge" class="govuk-tag govuk-tag--purple">Restricted patient</span>
6 changes: 3 additions & 3 deletions spec/features/complexity_level_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

expect(page).to have_text('Complexity of need level')
expect(page).to have_css('#complexity-level', text: 'High')
expect(page).to have_css('#complexity-badge', text: 'HIGH COMPLEXITY')
expect(page).to have_css('#complexity-badge', text: 'High complexity')

within(:css, "td#complexity-level") do
click_link('Change')
Expand Down Expand Up @@ -65,7 +65,7 @@

expect(page).to have_current_path(prison_prisoner_allocation_path(prisoner_id: offender.fetch(:prisonerNumber), prison_id: womens_prison.code), ignore_query: true)
expect(page).to have_css('#complexity-level', text: 'Low')
expect(page).to have_css('#complexity-badge', text: 'LOW COMPLEXITY')
expect(page).to have_css('#complexity-badge', text: 'Low complexity')
end

it 'can click back link to return to the prisoner profile page' do
Expand Down Expand Up @@ -130,7 +130,7 @@

expect(page).to have_current_path(prison_prisoner_allocation_path(womens_prison.code, offender_no))
expect(page).to have_css('#complexity-level-row', text: 'Low')
expect(page).to have_css('#complexity-badge', text: 'LOW COMPLEXITY')
expect(page).to have_css('#complexity-badge', text: 'Low complexity')
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/features/early_allocation_badge_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
sentenceStartDate: sentence_start))
end
let(:offender_no) { nomis_offender.fetch(:prisonerNumber) }
let(:notes_badge) { 'EARLY ALLOCATION ASSESSMENT SAVED' }
let(:active_badge) { 'EARLY ALLOCATION DECISION PENDING' }
let(:approved_badge) { 'EARLY ALLOCATION ELIGIBLE' }
let(:notes_badge) { 'Early allocation assessment saved' }
let(:active_badge) { 'Early allocation decision pending' }
let(:approved_badge) { 'Early allocation eligible' }

before do
signin_spo_user([prison.code])
Expand Down
6 changes: 3 additions & 3 deletions spec/views/prisoners/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@
let(:complexity) { 'low' }

it 'shows low complexity badge' do
expect(page).to have_content 'LOW COMPLEXITY'
expect(page).to have_content 'Low complexity'
end
end

context 'with medium complexity' do
let(:complexity) { 'medium' }

it 'shows medium complexity badge' do
expect(page).to have_content 'MEDIUM COMPLEXITY'
expect(page).to have_content 'Medium complexity'
end
end

context 'with high complexity' do
let(:complexity) { 'high' }

it 'shows high complexity badge' do
expect(page).to have_content 'HIGH COMPLEXITY'
expect(page).to have_content 'High complexity'
end
end
end
Expand Down
20 changes: 10 additions & 10 deletions spec/views/shared/early_allocation_badge.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
let(:early_allocation) { build(:early_allocation, :pre_window) }
let(:sentence) { attributes_for(:sentence_detail, :outside_early_allocation_window) }

it 'displays a badge text EARLY ALLOCATION NOTES' do
it 'displays corresponding badge' do
expect(badge_count).to eq(1)
expect(early_allocation_badge.attributes['class'].value).to include 'govuk-tag--blue'
expect(early_allocation_badge.text.strip).to eq 'EARLY ALLOCATION ASSESSMENT SAVED'
expect(early_allocation_badge.text.strip).to eq 'Early allocation assessment saved'
end
end

Expand All @@ -39,39 +39,39 @@
context 'when rejected' do
let(:early_allocation) { build(:early_allocation, :discretionary_declined) }

it 'displays badge text EARLY ALLOCATION NOTES' do
it 'displays corresponding badge' do
expect(badge_count).to eq(1)
expect(early_allocation_badge.attributes['class'].value).to include 'govuk-tag--blue'
expect(early_allocation_badge.text.strip).to eq 'EARLY ALLOCATION ASSESSMENT SAVED'
expect(early_allocation_badge.text.strip).to eq 'Early allocation assessment saved'
end
end

context 'when it is awaiting review by NSD/LDU' do
let(:early_allocation) { build(:early_allocation, :discretionary) }

it 'displays badge text EARLY ALLOCATION ACTIVE' do
it 'displays corresponding badge' do
expect(badge_count).to eq(1)
expect(early_allocation_badge.attributes['class'].value).to include 'govuk-tag--blue'
expect(early_allocation_badge.text.strip).to eq 'EARLY ALLOCATION DECISION PENDING'
expect(early_allocation_badge.text.strip).to eq 'Early allocation decision pending'
end
end

context 'when it has been approved by NSD/LDU' do
let(:early_allocation) { build(:early_allocation, :discretionary_accepted) }

it 'displays badge text EARLY ALLOCATION APPROVED' do
it 'displays corresponding badge' do
expect(badge_count).to eq(1)
expect(early_allocation_badge.attributes['class'].value).to include 'govuk-tag--blue'
expect(early_allocation_badge.text.strip).to eq 'EARLY ALLOCATION ELIGIBLE'
expect(early_allocation_badge.text.strip).to eq 'Early allocation eligible'
end
end

context 'when it is automatic' do
let(:early_allocation) { build(:early_allocation, :eligible) }

it 'displays badge text EARLY ALLOCATION APPROVED' do
it 'displays corresponding badge' do
expect(early_allocation_badge.attributes['class'].value).to include 'govuk-tag--blue'
expect(early_allocation_badge.text.strip).to eq 'EARLY ALLOCATION ELIGIBLE'
expect(early_allocation_badge.text.strip).to eq 'Early allocation eligible'
end
end
end
Expand Down

0 comments on commit 19593f0

Please sign in to comment.