File tree Expand file tree Collapse file tree 5 files changed +28
-5
lines changed
Expand file tree Collapse file tree 5 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,14 @@ body.casa_cases {
8484 select {
8585 padding : 5px ;
8686 }
87+
88+ .emancipation-btn {
89+ padding : 5px 10px ;
90+ font-size : 10px ;
91+ line-height : 16px ;
92+ vertical-align : middle ;
93+ }
94+
8795}
8896
8997@media only screen and (max-width : screen-sizes .$small ) {
@@ -200,4 +208,3 @@ span.select2-selection.select2-selection--single {
200208span [role = combobox ] {
201209 padding-top : 2px ;
202210}
203-
Original file line number Diff line number Diff line change @@ -98,7 +98,13 @@ def successful_contacts_this_week_before(date)
9898 end
9999
100100 def transition_aged_youth
101- object . in_transition_age? ? "Yes #{ CasaCase ::TRANSITION_AGE_YOUTH_ICON } " : "No #{ CasaCase ::NON_TRANSITION_AGE_YOUTH_ICON } "
101+ text = object . in_transition_age? ? "Yes #{ CasaCase ::TRANSITION_AGE_YOUTH_ICON } " : "No #{ CasaCase ::NON_TRANSITION_AGE_YOUTH_ICON } "
102+ if object . in_transition_age?
103+ badge_html = h . render ( partial : "shared/emancipation_link" , locals : { casa_case : object } )
104+ h . safe_join ( [ text , " " , badge_html ] )
105+ else
106+ text
107+ end
102108 end
103109
104110 def transition_aged_youth_icon
Original file line number Diff line number Diff line change @@ -72,7 +72,9 @@ $(() => { // JQuery's callback for the DOM loading
7272 return statusArray . includes ( status ) &&
7373 assignedToVolunteerArray . includes ( assignedToVolunteer ) &&
7474 assignedToMoreThanOneVolunteerArray . includes ( assignedToMoreThanOneVolunteer ) &&
75- assignedToTransitionYouthArray . includes ( assignedToTransitionYouth ) &&
75+ assignedToTransitionYouthArray . some ( filterValue =>
76+ assignedToTransitionYouth . toLowerCase ( ) . includes ( filterValue . toLowerCase ( ) . replace ( / [ ^ a - z A - Z ] / g, '' ) )
77+ ) &&
7678 caseNumberPrefixArray . includes ( caseNumberPrefix )
7779 }
7880 )
Original file line number Diff line number Diff line change 1+ <%= link_to(casa_case_emancipation_path(casa_case.id),
2+ class: "main-btn primary-btn btn-sm emancipation-btn") do %>
3+ Emancipation
4+ <%= render BadgeComponent.new(text: casa_case.decorate.emancipation_checklist_count,
5+ type: :light,
6+ margin: false) %>
7+ <% end %>
Original file line number Diff line number Diff line change 6363 end
6464
6565 it "returns transition age youth status with icon if over 14 years old" do
66- casa_case = build ( :casa_case , birth_month_year_youth : CasaCase ::TRANSITION_AGE . years . ago )
66+ casa_case = build_stubbed ( :casa_case , birth_month_year_youth : CasaCase ::TRANSITION_AGE . years . ago )
6767 expect ( casa_case . decorate . transition_aged_youth )
68- . to eq "Yes #{ CasaCase ::TRANSITION_AGE_YOUTH_ICON } "
68+ . to include "Yes #{ CasaCase ::TRANSITION_AGE_YOUTH_ICON } "
69+ expect ( casa_case . decorate . transition_aged_youth ) . to include "Emancipation"
6970 end
7071
7172 it "returns non-transition age youth status with icon if not over 14 years old" do
You can’t perform that action at this time.
0 commit comments