Skip to content

Commit

Permalink
Merge pull request #882 from greenriver/release-70
Browse files Browse the repository at this point in the history
Release-70
  • Loading branch information
eanders authored Dec 30, 2024
2 parents 03d250f + 1cfef03 commit 3d6fd50
Show file tree
Hide file tree
Showing 30 changed files with 431 additions and 762 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
tags: |
type=sha,prefix=githash-
type=ref,event=branch,prefix=branch-
# type=raw,event=branch,value=branch-{{branch}}-{{sha}}
type=raw,event=branch,value=branch-{{branch}}-{{sha}}
steps:
- name: Checkout
Expand Down
2 changes: 0 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ Layout/EmptyLinesAroundBlockBody:
- 'spec/controllers/clients_controller_spec.rb'
- 'spec/controllers/match_decisions_controller_spec.rb'
- 'spec/factories/match_decisions/match_recommendation_hsa_housing_date.rb'
- 'spec/factories/programs.rb'
- 'spec/factories/requirements.rb'
- 'spec/factories/users.rb'
- 'spec/models/client_notes_spec.rb'
Expand Down Expand Up @@ -994,7 +993,6 @@ Style/StringLiterals:
- 'spec/controllers/messages_controller_spec.rb'
- 'spec/factories/client_notes.rb'
- 'spec/factories/housing_media_links.rb'
- 'spec/factories/roles.rb'
- 'spec/models/client_notes_spec.rb'
- 'spec/models/prioritization/rank_spec.rb'
- 'spec/requests/express_neighborhood_interests_spec.rb'
Expand Down
126 changes: 63 additions & 63 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,47 @@ GEM
remote: https://rubygems.org/
specs:
StreetAddress (1.0.6)
actioncable (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
actioncable (7.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
actionmailbox (7.0.8.7)
actionpack (= 7.0.8.7)
activejob (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.5)
actionpack (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activesupport (= 7.0.8.5)
actionmailer (7.0.8.7)
actionpack (= 7.0.8.7)
actionview (= 7.0.8.7)
activejob (= 7.0.8.7)
activesupport (= 7.0.8.7)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.5)
actionview (= 7.0.8.5)
activesupport (= 7.0.8.5)
actionpack (7.0.8.7)
actionview (= 7.0.8.7)
activesupport (= 7.0.8.7)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.5)
actionpack (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
actiontext (7.0.8.7)
actionpack (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.5)
activesupport (= 7.0.8.5)
actionview (7.0.8.7)
activesupport (= 7.0.8.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -51,14 +51,14 @@ GEM
activerecord (>= 6.1, < 7.2)
active_record_query_trace (1.8.2)
activerecord (>= 6.0.0)
activejob (7.0.8.5)
activesupport (= 7.0.8.5)
activejob (7.0.8.7)
activesupport (= 7.0.8.7)
globalid (>= 0.3.6)
activemodel (7.0.8.5)
activesupport (= 7.0.8.5)
activerecord (7.0.8.5)
activemodel (= 7.0.8.5)
activesupport (= 7.0.8.5)
activemodel (7.0.8.7)
activesupport (= 7.0.8.7)
activerecord (7.0.8.7)
activemodel (= 7.0.8.7)
activesupport (= 7.0.8.7)
activerecord-import (1.6.0)
activerecord (>= 4.2)
activerecord-session_store (2.1.0)
Expand All @@ -68,14 +68,14 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 4)
railties (>= 6.1)
activestorage (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activesupport (= 7.0.8.5)
activestorage (7.0.8.7)
actionpack (= 7.0.8.7)
activejob (= 7.0.8.7)
activerecord (= 7.0.8.7)
activesupport (= 7.0.8.7)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.5)
activesupport (7.0.8.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -268,7 +268,7 @@ GEM
coffee-script-source (1.12.2)
composite_primary_keys (14.0.9)
activerecord (~> 7.0.2)
concurrent-ruby (1.3.1)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
csv (3.3.0)
Expand Down Expand Up @@ -326,7 +326,7 @@ GEM
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
erubi (1.12.0)
erubi (1.13.0)
erubis (2.7.0)
excon (0.111.0)
execjs (2.9.1)
Expand Down Expand Up @@ -380,7 +380,7 @@ GEM
nokogiri (>= 1.6.0)
ruby_parser (~> 3.5)
htmlentities (4.3.4)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
image_processing (1.12.2)
Expand Down Expand Up @@ -432,7 +432,7 @@ GEM
railties (>= 4)
request_store (~> 1.0)
logstop (0.3.1)
loofah (2.22.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.2.10)
Expand All @@ -452,8 +452,8 @@ GEM
method_source (1.1.0)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.23.1)
mini_portile2 (2.8.8)
minitest (5.25.4)
minitest-reporters (1.6.1)
ansi
builder
Expand Down Expand Up @@ -482,7 +482,7 @@ GEM
net-protocol
net-ssh (7.2.3)
nio4r (2.7.3)
nokogiri (1.16.5)
nokogiri (1.17.1)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
notiffany (0.1.3)
Expand Down Expand Up @@ -524,27 +524,27 @@ GEM
nio4r (~> 2.0)
pwned (2.4.1)
racc (1.8.1)
rack (2.2.9)
rack (2.2.10)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.5)
actioncable (= 7.0.8.5)
actionmailbox (= 7.0.8.5)
actionmailer (= 7.0.8.5)
actionpack (= 7.0.8.5)
actiontext (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activemodel (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
rails (7.0.8.7)
actioncable (= 7.0.8.7)
actionmailbox (= 7.0.8.7)
actionmailer (= 7.0.8.7)
actionpack (= 7.0.8.7)
actiontext (= 7.0.8.7)
actionview (= 7.0.8.7)
activejob (= 7.0.8.7)
activemodel (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
bundler (>= 1.15.0)
railties (= 7.0.8.5)
railties (= 7.0.8.7)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -558,12 +558,12 @@ GEM
activesupport (>= 4.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.6.0)
rails-html-sanitizer (1.6.1)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (7.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down
17 changes: 11 additions & 6 deletions app/controllers/opportunity_matches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,20 @@ def require_access_to_opportunity!
@opportunity.visible_by?(current_user)
end

def can_activate_matches?
(current_user.can_edit_all_clients? ||
@opportunity.editable_by?(current_user)) &&
! @opportunity.successful_match
# You can activate a match if all of the following are true:
# 1. the match hasn't succeeded
# 2. you have can edit all clients or this opportunity is editable by you
# 3. you've been given the can activate matches permission
def can_activate_match?
return false if @opportunity.successful_match
return false unless current_user.can_edit_all_clients? || @opportunity.editable_by?(current_user)

current_user.can_activate_matches?
end
helper_method :can_activate_matches?
helper_method :can_activate_match?

def require_can_activate_matches!
not_authorized! unless can_activate_matches?
not_authorized! unless can_activate_match?
end

def set_show_confidential_names
Expand Down
12 changes: 10 additions & 2 deletions app/models/concerns/match_decisions/accepts_decline_reason.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ def decline_reasons(contact:)
result << reason
end
# Move other to the end of the list
result.sort_by! { |m| m.name.downcase == 'other' ? 1 : 0 }
result.sort_by! { |m| [m.name.downcase == 'other' ? 1 : 0, m.name.downcase] }
result.map! do |reason|
# Only include the asterisks if more than 'Other' requires additional explanation
include_asterisk = decline_reasons_not_other_requiring_explanation.present? && (reason.other? || decline_reasons_not_other_requiring_explanation.include?(reason.name))
name = reason.name
name += '*' if include_asterisk
[name, reason.id]
end
end
end

Expand All @@ -35,7 +42,8 @@ def whitelist_params_for_update params
private def validate_decline_reason
errors.add :decline_reason, 'please indicate the reason for declining' if status == 'declined' && decline_reason_blank?

errors.add :decline_reason_other_explanation, "must be filled in if choosing 'Other'" if status == 'declined' && decline_reason&.other? && decline_reason_other_explanation.blank?
explanation_field_required = status == 'declined' && (decline_reason&.other? || decline_reasons_not_other_requiring_explanation&.include?(decline_reason&.name))
errors.add :decline_reason_other_explanation, "must be filled in if choosing '#{decline_reason&.name}'" if explanation_field_required && decline_reason_other_explanation.blank?
end

private def decline_reason_blank?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,32 @@ module RouteThirteenDeclineReasons

def step_decline_reasons(_contact)
[
'Client has another housing option',
'SORI',
'CORI',
'Does not agree to services',
'Immigration status',
'Unsafe environment for this person',
'Unwilling to live in that neighborhood',
'Unwilling to live in SRO',
'Does not want housing at this time',
'Unsafe environment for this person',
'Falsification of documents',
'Client has another housing option',
'Household did not respond after initial acceptance of match',
'Ineligible for Housing Program', # Additional Text Required
'Client refused offer',
'Client refused unit (non-SRO)',
'Additional screening criteria imposed by third parties', # Additional Text Required
'Health and Safety',
'Client refused voucher',
'Other',
]
end

def decline_reasons_not_other_requiring_explanation
[
'Ineligible for Housing Program',
'Additional screening criteria imposed by third parties',
]
end
end
end
Loading

0 comments on commit 3d6fd50

Please sign in to comment.