Skip to content

Commit

Permalink
Merge branch 'main' into improve-timezones-on-org-settings-sent-emails
Browse files Browse the repository at this point in the history
  • Loading branch information
panacotar committed Sep 26, 2024
2 parents 6f1e667 + 69d3b13 commit 8bd02ad
Show file tree
Hide file tree
Showing 66 changed files with 553 additions and 668 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source "https://rubygems.org"

ruby "3.2.2"
gem "rails", "7.1.3.4"
gem "rails", "7.2.1"

gem "after_party" # post-deployment tasks
gem "amazing_print" # easier console reading
Expand Down
154 changes: 78 additions & 76 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,84 +1,80 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
actioncable (7.2.1)
actionpack (= 7.2.1)
activesupport (= 7.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.4)
actionpack (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.1)
actionpack (= 7.2.1)
activejob (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
mail (>= 2.8.0)
actionmailer (7.2.1)
actionpack (= 7.2.1)
actionview (= 7.2.1)
activejob (= 7.2.1)
activesupport (= 7.2.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionpack (7.2.1)
actionview (= 7.2.1)
activesupport (= 7.2.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.4)
actionpack (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
useragent (~> 0.16)
actiontext (7.2.1)
actionpack (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.4)
activesupport (= 7.1.3.4)
actionview (7.2.1)
activesupport (= 7.2.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.4)
activesupport (= 7.1.3.4)
activejob (7.2.1)
activesupport (= 7.2.1)
globalid (>= 0.3.6)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activemodel (7.2.1)
activesupport (= 7.2.1)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.2.1)
activemodel (= 7.2.1)
activesupport (= 7.2.1)
timeout (>= 0.4.0)
activestorage (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activesupport (= 7.1.3.4)
activestorage (7.2.1)
actionpack (= 7.2.1)
activejob (= 7.2.1)
activerecord (= 7.2.1)
activesupport (= 7.2.1)
marcel (~> 1.0)
activesupport (7.1.3.4)
activesupport (7.2.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
after_party (1.11.2)
Expand Down Expand Up @@ -289,7 +285,7 @@ GEM
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
lint_roller (1.1.0)
logger (1.6.0)
logger (1.6.1)
lograge (0.14.0)
actionpack (>= 4)
activesupport (>= 4)
Expand All @@ -313,7 +309,6 @@ GEM
multi_xml (0.7.1)
bigdecimal (~> 3.1)
multipart-post (2.4.1)
mutex_m (0.2.0)
net-http-persistent (4.0.1)
connection_pool (~> 2.2)
net-imap (0.4.16)
Expand Down Expand Up @@ -386,20 +381,20 @@ GEM
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.3.4)
actioncable (= 7.1.3.4)
actionmailbox (= 7.1.3.4)
actionmailer (= 7.1.3.4)
actionpack (= 7.1.3.4)
actiontext (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activemodel (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
rails (7.2.1)
actioncable (= 7.2.1)
actionmailbox (= 7.2.1)
actionmailer (= 7.2.1)
actionpack (= 7.2.1)
actiontext (= 7.2.1)
actionview (= 7.2.1)
activejob (= 7.2.1)
activemodel (= 7.2.1)
activerecord (= 7.2.1)
activestorage (= 7.2.1)
activesupport (= 7.2.1)
bundler (>= 1.15.0)
railties (= 7.1.3.4)
railties (= 7.2.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -411,10 +406,10 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
irb
railties (7.2.1)
actionpack (= 7.2.1)
activesupport (= 7.2.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand Down Expand Up @@ -452,17 +447,17 @@ GEM
rspec-support (3.13.1)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rswag-api (2.13.0)
activesupport (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rswag-api (2.14.0)
activesupport (>= 5.2, < 8.0)
railties (>= 5.2, < 8.0)
rswag-specs (2.14.0)
activesupport (>= 5.2, < 8.0)
json-schema (>= 2.2, < 5.0)
railties (>= 5.2, < 8.0)
rspec-core (>= 2.14)
rswag-ui (2.13.0)
actionpack (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rswag-ui (2.14.0)
actionpack (>= 5.2, < 8.0)
railties (>= 5.2, < 8.0)
rubocop (1.65.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
Expand Down Expand Up @@ -494,7 +489,13 @@ GEM
nokogiri (>= 1.12.0)
scout_apm (5.3.8)
parser
selenium-webdriver (4.23.0)
securerandom (0.3.1)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
selenium-webdriver (4.25.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
Expand Down Expand Up @@ -553,6 +554,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
uniform_notifier (1.16.0)
useragent (0.16.10)
view_component (3.13.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -643,7 +645,7 @@ DEPENDENCIES
pundit
rack-attack
rack-cors
rails (= 7.1.3.4)
rails (= 7.2.1)
rails-controller-testing
rake
request_store
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/fund_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def verify_casa_case
end

def parsed_params
params.permit(
params.require(:fund_request).permit(
:submitter_email,
:youth_name,
:payment_amount,
Expand Down
2 changes: 2 additions & 0 deletions app/datatables/application_datatable.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class ApplicationDatatable
prepend ActiveSupport::ToJsonWithActiveSupportEncoder

attr_reader :base_relation, :params

DEFAULT_PER_PAGE = 10
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/controllers/court_order_form_controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NestedForm from 'stimulus-rails-nested-form'
import NestedForm from '@stimulus-components/rails-nested-form'
import Swal from 'sweetalert2'

export default class extends NestedForm {
Expand Down
5 changes: 2 additions & 3 deletions app/javascript/controllers/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is auto-generated by ./bin/rails stimulus:manifest:update
// Run that command whenever you add a new controller or create them with
// ./bin/rails generate stimulus controllerName
import RailsNestedForm from '@stimulus-components/rails-nested-form'

import { application } from './application'

Expand Down Expand Up @@ -30,8 +31,7 @@ import SidebarGroupController from './sidebar_group_controller'

import TruncatedTextController from './truncated_text_controller'

import NestedForm from 'stimulus-rails-nested-form'

application.register('nested-form', RailsNestedForm)
application.register('alert', AlertController)
application.register('autosave', AutosaveController)
application.register('disable-form', DisableFormController)
Expand All @@ -45,4 +45,3 @@ application.register('select-all', SelectAllController)
application.register('sidebar', SidebarController)
application.register('sidebar-group', SidebarGroupController)
application.register('truncated-text', TruncatedTextController)
application.register('nested-form', NestedForm)
1 change: 1 addition & 0 deletions app/models/all_casa_admin.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class AllCasaAdmin < ApplicationRecord
prepend ActiveSupport::ToJsonWithActiveSupportEncoder
include Roles

# Include default devise modules. Others available are:
Expand Down
2 changes: 2 additions & 0 deletions app/models/casa_admin.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class CasaAdmin < User
prepend ActiveSupport::ToJsonWithActiveSupportEncoder

devise :invitable, invite_for: 2.weeks

default_scope { order(email: :asc) }
Expand Down
3 changes: 2 additions & 1 deletion app/models/casa_case.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class CasaCase < ApplicationRecord
prepend ActiveSupport::ToJsonWithActiveSupportEncoder
include ByOrganizationScope
include DateHelper
include CasaCase::Validations
Expand Down Expand Up @@ -53,7 +54,7 @@ class CasaCase < ApplicationRecord
has_many :case_court_orders, -> { order "id asc" }, dependent: :destroy
accepts_nested_attributes_for :case_court_orders, reject_if: :all_blank, allow_destroy: true

enum court_report_status: {not_submitted: 0, submitted: 1, in_review: 2, completed: 3}, _prefix: :court_report
enum :court_report_status, {not_submitted: 0, submitted: 1, in_review: 2, completed: 3}, prefix: :court_report

scope :ordered, -> { order(updated_at: :desc) }
scope :actively_assigned_to, ->(volunteer) {
Expand Down
1 change: 1 addition & 0 deletions app/models/casa_org.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class CasaOrg < ApplicationRecord
prepend ActiveSupport::ToJsonWithActiveSupportEncoder
# NOTE: location of the default report template
CASA_DEFAULT_COURT_REPORT = File.new(Rails.root.join("app", "documents", "templates", "default_report_template.docx"), "r")
CASA_DEFAULT_LOGO = Rails.root.join("public", "logo.jpeg")
Expand Down
16 changes: 4 additions & 12 deletions app/models/case_contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CaseContact < ApplicationRecord

attr_accessor :duration_hours

validate :contact_made_chosen
validates :contact_made, inclusion: {in: [true, false], message: :must_be_true_or_false}
validates :miles_driven, numericality: {greater_than_or_equal_to: 0, less_than: 10000}
validates :medium_type, presence: true, if: :active_or_details?
validates :duration_minutes, presence: true, if: :active_or_details?
Expand All @@ -15,8 +15,9 @@ class CaseContact < ApplicationRecord
message: "can't be prior to #{I18n.l(MINIMUM_DATE)}.",
allow_nil: true
}
# NOTE: 'extra' day is a temporary fix for user selecting current date, but this validation failing
validates :occurred_at, comparison: {
less_than: Date.tomorrow,
less_than: Time.zone.tomorrow + 1.day,
message: :cant_be_future,
allow_nil: true
}
Expand All @@ -35,7 +36,7 @@ class CaseContact < ApplicationRecord
belongs_to :casa_case, optional: true
has_one :casa_org, through: :casa_case
validates :casa_case_id, presence: true, if: :active?
validate :draft_case_ids_not_empty, unless: :started?
validates :draft_case_ids, presence: {message: :must_be_selected}, unless: :started?

has_many :case_contact_contact_types
has_many :contact_types, through: :case_contact_contact_types
Expand Down Expand Up @@ -231,15 +232,6 @@ def volunteer_address_is_valid
end
end

def contact_made_chosen
errors.add(:base, "Must enter whether the contact was made.") if contact_made.nil?
!contact_made.nil?
end

def draft_case_ids_not_empty
errors.add(:base, "You must select at least one casa case.") if draft_case_ids.empty?
end

def supervisor_id
supervisor.id
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/case_court_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CaseCourtOrder < ApplicationRecord

validates :text, presence: true

enum implementation_status: IMPLEMENTATION_STATUSES
enum :implementation_status, IMPLEMENTATION_STATUSES

def self.court_order_options
STANDARD_COURT_ORDERS.map { |o| [o, o] }
Expand Down
Loading

0 comments on commit 8bd02ad

Please sign in to comment.