Skip to content

Commit

Permalink
Merged in r2-3149-main-develop (pull request #7016)
Browse files Browse the repository at this point in the history
R2-3149: Merging main to develop 12.11.24
  • Loading branch information
jtoliver-quoin committed Dec 11, 2024
2 parents 4808764 + 5cd4da1 commit 60fe539
Show file tree
Hide file tree
Showing 28 changed files with 1,040 additions and 1,025 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ gem 'prawn-table', '~> 0.2' # PDF generation
gem 'puma', '~> 6.4' # Ruby Rack server
gem 'rack', '~> 2.2'
gem 'rack-attack', '>= 6.6' # Rack middleware to rate limit sensetive routes, such as those used for auth
gem 'rails', '6.1.7.8'
gem 'rails', '6.1.7.9'
gem 'rake', '~> 13.0'
gem 'rbnacl', '>= 7.1.1' # Libsodium Ruby binding. Used for encrypting export file passwords.
gem 'rubyzip', '~> 2.3', # Zip and encrypt exported files
Expand Down
140 changes: 69 additions & 71 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
actioncable (6.1.7.9)
actionpack (= 6.1.7.9)
activesupport (= 6.1.7.9)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionmailbox (6.1.7.9)
actionpack (= 6.1.7.9)
activejob (= 6.1.7.9)
activerecord (= 6.1.7.9)
activestorage (= 6.1.7.9)
activesupport (= 6.1.7.9)
mail (>= 2.7.1)
actionmailer (6.1.7.8)
actionpack (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionmailer (6.1.7.9)
actionpack (= 6.1.7.9)
actionview (= 6.1.7.9)
activejob (= 6.1.7.9)
activesupport (= 6.1.7.9)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.8)
actionview (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionpack (6.1.7.9)
actionview (= 6.1.7.9)
activesupport (= 6.1.7.9)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.8)
actionpack (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actiontext (6.1.7.9)
actionpack (= 6.1.7.9)
activerecord (= 6.1.7.9)
activestorage (= 6.1.7.9)
activesupport (= 6.1.7.9)
nokogiri (>= 1.8.5)
actionview (6.1.7.8)
activesupport (= 6.1.7.8)
actionview (6.1.7.9)
activesupport (= 6.1.7.9)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.7.8)
activesupport (= 6.1.7.8)
activejob (6.1.7.9)
activesupport (= 6.1.7.9)
globalid (>= 0.3.6)
activemodel (6.1.7.8)
activesupport (= 6.1.7.8)
activerecord (6.1.7.8)
activemodel (= 6.1.7.8)
activesupport (= 6.1.7.8)
activemodel (6.1.7.9)
activesupport (= 6.1.7.9)
activerecord (6.1.7.9)
activemodel (= 6.1.7.9)
activesupport (= 6.1.7.9)
activerecord-nulldb-adapter (0.9.0)
activerecord (>= 5.2.0, < 7.1)
activestorage (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activesupport (= 6.1.7.8)
activestorage (6.1.7.9)
actionpack (= 6.1.7.9)
activejob (= 6.1.7.9)
activerecord (= 6.1.7.9)
activesupport (= 6.1.7.9)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.8)
activesupport (6.1.7.9)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -111,7 +111,7 @@ GEM
crass (1.0.6)
csv-safe (3.2.1)
daemons (1.4.1)
date (3.3.4)
date (3.4.1)
deep_merge (1.2.2)
delayed_job (4.1.11)
activesupport (>= 3.0, < 8.0)
Expand Down Expand Up @@ -183,7 +183,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.1)
loofah (2.22.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -200,7 +200,7 @@ GEM
mime-types-data (3.2023.0808)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
mini_portile2 (2.8.8)
minipack (0.3.6)
actionview
railties (>= 4.2)
Expand All @@ -209,7 +209,7 @@ GEM
multipart-post (2.3.0)
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
net-imap (0.4.12)
net-imap (0.5.1)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -218,8 +218,8 @@ GEM
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.5.9)
nokogiri (1.16.5)
nio4r (2.7.4)
nokogiri (1.16.8)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
openssl (3.1.0)
Expand All @@ -244,9 +244,9 @@ GEM
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
public_suffix (5.0.3)
puma (6.4.2)
puma (6.5.0)
nio4r (~> 2.0)
racc (1.8.0)
racc (1.8.1)
rack (2.2.9)
rack-attack (6.7.0)
rack (>= 1.0, < 4)
Expand All @@ -257,20 +257,20 @@ GEM
rack_session_access (0.2.0)
builder (>= 2.0.0)
rack (>= 1.0.0)
rails (6.1.7.8)
actioncable (= 6.1.7.8)
actionmailbox (= 6.1.7.8)
actionmailer (= 6.1.7.8)
actionpack (= 6.1.7.8)
actiontext (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activemodel (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
rails (6.1.7.9)
actioncable (= 6.1.7.9)
actionmailbox (= 6.1.7.9)
actionmailer (= 6.1.7.9)
actionpack (= 6.1.7.9)
actiontext (= 6.1.7.9)
actionview (= 6.1.7.9)
activejob (= 6.1.7.9)
activemodel (= 6.1.7.9)
activerecord (= 6.1.7.9)
activestorage (= 6.1.7.9)
activesupport (= 6.1.7.9)
bundler (>= 1.15.0)
railties (= 6.1.7.8)
railties (= 6.1.7.9)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand All @@ -280,15 +280,15 @@ GEM
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
rails-html-sanitizer (1.6.1)
loofah (~> 2.21)
nokogiri (~> 1.14)
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)
rails-i18n (7.0.8)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
railties (6.1.7.9)
actionpack (= 6.1.7.9)
activesupport (= 6.1.7.9)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand All @@ -305,8 +305,7 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.6)
strscan
rexml (3.3.9)
roo (2.10.0)
nokogiri (~> 1)
rubyzip (>= 1.3.0, < 3.0.0)
Expand Down Expand Up @@ -384,11 +383,10 @@ GEM
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets-rails (3.5.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
strscan (3.1.0)
sunspot (2.6.0)
pr_geohash (~> 1.0)
rsolr (>= 1.1.1, < 3)
Expand All @@ -403,7 +401,7 @@ GEM
unicode-display_width (>= 1.1.1, < 3)
text (1.3.1)
thor (1.3.1)
timeout (0.4.1)
timeout (0.4.2)
ttfunk (1.7.0)
twitter_cldr (4.4.5)
camertron-eprun
Expand Down Expand Up @@ -476,7 +474,7 @@ DEPENDENCIES
rack-mini-profiler (>= 1.0.0)
rack-test (~> 1.1)
rack_session_access (~> 0.2)
rails (= 6.1.7.8)
rails (= 6.1.7.9)
rails-controller-testing (~> 1.0)
rake (~> 13.0)
rbnacl (>= 7.1.1)
Expand Down
21 changes: 9 additions & 12 deletions app/controllers/api/v2/assigns_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# API endpoints that handle record reassignment
class Api::V2::AssignsController < Api::V2::RecordResourceController
before_action :bulk_approval_params, only: [:create_bulk]
before_action :bulk_assign_params, only: [:create_bulk]
before_action :verify_bulk_records_size, only: [:create_bulk]

def index
Expand All @@ -22,7 +22,7 @@ def create

def create_bulk
authorize_assign!(model_class)
BulkAssignRecordsJob.perform_later(model_class, current_user, bulk_approval_params)
BulkAssignRecordsJob.perform_later(model_class, current_user, bulk_assign_params)
end

private
Expand All @@ -43,10 +43,7 @@ def assign(record)
transitioned_to = params[:data][:transitioned_to]
notes = params[:data][:notes]
transitioned_by = current_user.user_name
Assign.create!(
record:, transitioned_to:,
transitioned_by:, notes:
)
Assign.create!(record:, transitioned_to:, transitioned_by:, notes:)
end

def create_action_message
Expand All @@ -61,19 +58,19 @@ def create_bulk_record_resource
'bulk_assign'
end

def bulk_approval_params
@bulk_approval_params ||= params.require(:data).permit(:transitioned_to, :notes, :query, { filters: {} }).to_h
def bulk_assign_params
@bulk_assign_params ||= params.require(:data)
.permit(:transitioned_to, :notes, :query, filters: {})
.tap { |data_param| data_param.require(:filters) }
end

def find_records
@records = []
@records_total = BulkAssignService.new(model_class, current_user, bulk_assign_params).search_records.total
end

def verify_bulk_records_size
if @bulk_approval_params[:filters][:short_id].blank? ||
@bulk_approval_params[:filters][:short_id].length <= Assign::MAX_BULK_RECORDS
return
end
return if @records_total <= Assign::MAX_BULK_RECORDS

raise(Errors::BulkAssignRecordsSizeError, 'case.messages.bulk_assign_limit')
end
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/api/v2/system_settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Api::V2::SystemSettingsController < ApplicationApiController
def index
@system_setting = SystemSettings.first
@primero_modules = extended? ? PrimeroModule.all : []
@agencies = extended? ? Agency.all : []
@agencies = extended? ? extended_agencies : []
end

def model_class
Expand All @@ -17,4 +17,8 @@ def model_class
def extended?
params[:extended] == 'true'
end

def extended_agencies
Agency.includes(logo_full_attachment: :blob, logo_icon_attachment: :blob, terms_of_use_attachment: :blob).all
end
end
5 changes: 5 additions & 0 deletions app/controllers/api/v2/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def update
validate_json!(User::USER_FIELDS_SCHEMA, user_params)
@user.update_with_properties(@user_params)
@user.save!
keep_user_signed_in
end

def destroy
Expand Down Expand Up @@ -73,4 +74,8 @@ def welcome
def identity_sync
@user.identity_sync(current_user)
end

def keep_user_signed_in
bypass_sign_in(@user) if @user.saved_change_to_encrypted_password? && current_user == @user
end
end
9 changes: 9 additions & 0 deletions app/controllers/application_api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ def model_class
end

def record_id
return unless params[:id].is_a?(String)

params[:id]
end

def metadata_record_ids
return [] unless params[:id].present?
return [params[:id]] if params[:id].is_a?(String)

params[:id].values
end

def authorize_all!(permission, records)
records.each do |record|
authorize!(permission, record)
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/concerns/audit_log_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def default_metadata_audit_params
remote_ip: LogUtils.remote_ip(request),
agency_id: current_user.try(:agency_id),
role_id: current_user.try(:role_id),
http_method: request.method
http_method: request.method,
record_ids: metadata_record_ids
}
end

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/form/fields/radio-input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function RadioInput({ commonInputProps, options, formMethods }) {

return (
<FormControl id={name} error={error} className={className}>
<FormLabel component="legend" className="MuiInputLabel-root">
<FormLabel component="label" className={css.radioLabel}>
{radioGroupLabel}
</FormLabel>
<Controller
Expand Down
Loading

0 comments on commit 60fe539

Please sign in to comment.