From fde675f8407d94f675baa52c2ff5973c4002e34a Mon Sep 17 00:00:00 2001 From: Phil Date: Wed, 13 Nov 2024 17:03:23 +0000 Subject: [PATCH] Fixed issues from PRs --- Gemfile.lock | 60 +++++++++---------- app/assets/stylesheets/admin/admin.scss | 2 +- app/models/concerns/field_defaults.rb | 4 +- .../concerns/nfs_store/has_current_user.rb | 2 +- app/models/dynamic/implementation_handler.rb | 4 +- app/models/formatter/substitution.rb | 2 +- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index cc68d732f0..afbb48e990 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,11 +62,11 @@ GEM activejob (6.1.7.10) activesupport (= 6.1.7.10) 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.10) + activesupport (= 6.1.7.10) + activerecord (6.1.7.10) + activemodel (= 6.1.7.10) + activesupport (= 6.1.7.10) activerecord-import (1.8.1) activerecord (>= 4.2) activerecord-session_store (2.1.0) @@ -96,29 +96,29 @@ GEM attr_encrypted (4.1.1) encryptor (~> 3.0.0) aws-eventstream (1.3.0) - aws-partitions (1.988.0) - aws-sdk-cloudwatchlogs (1.96.0) - aws-sdk-core (~> 3, >= 3.207.0) + aws-partitions (1.1001.0) + aws-sdk-cloudwatchlogs (1.100.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-core (3.209.1) + aws-sdk-core (3.211.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.94.0) - aws-sdk-core (~> 3, >= 3.207.0) + aws-sdk-kms (1.95.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-pinpoint (1.101.0) - aws-sdk-core (~> 3, >= 3.207.0) + aws-sdk-pinpoint (1.102.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.167.0) - aws-sdk-core (~> 3, >= 3.207.0) + aws-sdk-s3 (1.169.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sdk-sns (1.88.0) - aws-sdk-core (~> 3, >= 3.207.0) + aws-sdk-sns (1.89.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sigv4 (1.10.0) + aws-sigv4 (1.10.1) aws-eventstream (~> 1, >= 1.0.2) backport (1.2.0) base64 (0.2.0) @@ -167,10 +167,10 @@ GEM debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) - delayed_job (4.1.13) - activesupport (>= 3.0, < 9.0) - delayed_job_active_record (4.1.11) - activerecord (>= 3.0, < 9.0) + delayed_job (4.1.12) + activesupport (>= 3.0, < 8.0) + delayed_job_active_record (4.1.10) + activerecord (>= 3.0, < 8.0) delayed_job (>= 3.0, < 5) delayed_job_recurring (0.3.9) delayed_job (>= 3.0) @@ -226,7 +226,7 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.8.1) + json (2.7.5) kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) @@ -236,7 +236,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) @@ -258,7 +258,7 @@ GEM minitest (5.25.1) msgpack (1.7.3) multi_json (1.15.0) - net-imap (0.4.16) + net-imap (0.5.0) date net-protocol net-pop (0.1.2) @@ -284,7 +284,7 @@ GEM ast (~> 2.4.1) racc path_expander (1.1.3) - pg (1.5.8) + pg (1.5.9) psych (5.1.2) stringio public_suffix (6.0.1) @@ -349,13 +349,13 @@ GEM netrc (~> 0.8) reverse_markdown (2.1.1) nokogiri - rexml (3.3.8) + rexml (3.3.9) rotp (6.3.0) rqrcode (2.2.0) chunky_png (~> 1.0) rqrcode_core (~> 1.0) rqrcode_core (1.2.0) - rspec-core (3.13.1) + rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) @@ -372,7 +372,7 @@ GEM rspec-mocks (~> 3.13) rspec-support (~> 3.13) rspec-support (3.13.1) - rubocop (1.66.1) + rubocop (1.68.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -480,7 +480,7 @@ GEM xpath (3.2.0) nokogiri (~> 1.8) yard (0.9.37) - zeitwerk (2.6.18) + zeitwerk (2.7.1) PLATFORMS arm64-darwin-21 diff --git a/app/assets/stylesheets/admin/admin.scss b/app/assets/stylesheets/admin/admin.scss index 9ad9546c0f..aa45b252c4 100644 --- a/app/assets/stylesheets/admin/admin.scss +++ b/app/assets/stylesheets/admin/admin.scss @@ -247,4 +247,4 @@ a.link-disabled { [data-out-attr-name="user_id"] .chosen-container { min-width: 300px; -} \ No newline at end of file +} diff --git a/app/models/concerns/field_defaults.rb b/app/models/concerns/field_defaults.rb index 725c1ae5a7..df3ef4247d 100644 --- a/app/models/concerns/field_defaults.rb +++ b/app/models/concerns/field_defaults.rb @@ -12,7 +12,7 @@ module FieldDefaults # @param [DateTime] from_when - a DateTime to use instead of now # @param [Boolean] allow_nil - by default, return empty string instead of nil. Set true to allow nils # @return [String|Number|nil] the result after substitutions - def self.calculate_default(obj, value, type = nil, from_when: nil, allow_nil: false) + def self.calculate_default(obj, value, type = nil, from_when: nil, allow_nil: false, ignore_missing: false) value = '' if value.nil? && !allow_nil res = value @@ -46,7 +46,7 @@ def self.calculate_default(obj, value, type = nil, from_when: nil, allow_nil: fa elsif value.include? '{{{' res = Formatter::Substitution.substitute_plain(value, data: obj) elsif value.include? '{{' - res = Formatter::Substitution.substitute(value, data: obj, tag_subs: nil) + res = Formatter::Substitution.substitute(value, data: obj, tag_subs: nil, ignore_missing:) end elsif value.is_a? Hash ca = ConditionalActions.new value, obj diff --git a/app/models/concerns/nfs_store/has_current_user.rb b/app/models/concerns/nfs_store/has_current_user.rb index 1907b85538..cb52bfa342 100644 --- a/app/models/concerns/nfs_store/has_current_user.rb +++ b/app/models/concerns/nfs_store/has_current_user.rb @@ -44,7 +44,7 @@ def current_user=(user) end def current_user - master.current_user + master&.current_user end def master_id=(master_id) diff --git a/app/models/dynamic/implementation_handler.rb b/app/models/dynamic/implementation_handler.rb index d98d4ff24f..8fc60a9457 100644 --- a/app/models/dynamic/implementation_handler.rb +++ b/app/models/dynamic/implementation_handler.rb @@ -265,13 +265,13 @@ def force_preset_values init_value = config[:preset_value] if init_value - res = FieldDefaults.calculate_default self, init_value + res = FieldDefaults.calculate_default self, init_value, ignore_missing: current_admin_sample send "#{name}=", res end init_value = config[:blank_preset_value] if init_value - res = FieldDefaults.calculate_default self, init_value + res = FieldDefaults.calculate_default self, init_value, ignore_missing: current_admin_sample send "#{name}=", res if attributes[name.to_s].blank? end end diff --git a/app/models/formatter/substitution.rb b/app/models/formatter/substitution.rb index 1e72984a89..b2a76c9256 100644 --- a/app/models/formatter/substitution.rb +++ b/app/models/formatter/substitution.rb @@ -400,7 +400,7 @@ def self.setup_data_for_current_user(data, master, item) # Certain methods in resources should be accessible as attributes for substitution # Set these up def self.setup_methods_as_attributes(data) - return unless data + return unless data.is_a?(Hash) orig_obj = data[:original_item] rn = data[:resource_name]