Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2024-08-02 (2) #8574

Merged
merged 50 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
cb7bfbc
Bump fog-aws from 3.22.0 to 3.23.0 in /back
dependabot[bot] Jun 24, 2024
029b615
Bump ruby-openai from 7.0.1 to 7.1.0 in /back
dependabot[bot] Jun 24, 2024
eb4064c
Bump mini_magick from 4.12.0 to 4.13.2 in /back
dependabot[bot] Jul 15, 2024
e5ee7a5
Use consistent title on accessibility page
EdwinKato Jul 30, 2024
0b8145d
Translations updated by CI (extract-intl)
Jul 30, 2024
12558c9
Use consistent title for sitemap
EdwinKato Jul 30, 2024
38509f4
Use consistent title on cookie policy page
EdwinKato Jul 30, 2024
5bfbb13
Translations updated by CI (extract-intl)
Jul 30, 2024
c6782b6
New translations en.json (German)
cl-dev-bot Aug 1, 2024
f104aa0
Remove check for attributes before saving
EdwinKato Aug 2, 2024
55c3a36
Merge pull request #8321 from CitizenLabDotCo/dependabot/bundler/back…
adessy Aug 2, 2024
b11e152
Merge pull request #8320 from CitizenLabDotCo/dependabot/bundler/back…
adessy Aug 2, 2024
41dee71
Bump fog-aws from 3.22.0 to 3.24.0 in /back
dependabot[bot] Aug 2, 2024
4f806b4
Merge pull request #8432 from CitizenLabDotCo/dependabot/bundler/back…
adessy Aug 2, 2024
091bb24
Merge pull request #8515 from CitizenLabDotCo/TAN-2387-consistent-title
EdwinKato Aug 2, 2024
8a1978c
New translations en.json (French)
cl-dev-bot Aug 2, 2024
f8fb674
New translations en.json (Spanish)
cl-dev-bot Aug 2, 2024
5798965
New translations en.json (Arabic)
cl-dev-bot Aug 2, 2024
b126479
New translations en.json (Catalan)
cl-dev-bot Aug 2, 2024
4805137
Merge pull request #8571 from CitizenLabDotCo/TAN-2337-remove-conditi…
EdwinKato Aug 2, 2024
8585ad3
New translations en.json (Danish)
cl-dev-bot Aug 2, 2024
480a3a3
New translations en.json (German)
cl-dev-bot Aug 2, 2024
4190c92
New translations en.json (Greek)
cl-dev-bot Aug 2, 2024
edaf789
New translations en.json (Finnish)
cl-dev-bot Aug 2, 2024
79760a4
Bump rubocop-performance from 1.18.0 to 1.21.1 in /back
dependabot[bot] Jul 16, 2024
37fa0bd
New translations en.json (Italian)
cl-dev-bot Aug 2, 2024
a31df8b
New translations en.json (Dutch)
cl-dev-bot Aug 2, 2024
3648528
New translations en.json (Norwegian)
cl-dev-bot Aug 2, 2024
81bb4c6
New translations en.json (Polish)
cl-dev-bot Aug 2, 2024
563c100
New translations en.json (Serbian (Cyrillic))
cl-dev-bot Aug 2, 2024
17b4ab6
New translations en.json (Swedish)
cl-dev-bot Aug 2, 2024
67f38ae
New translations en.json (Turkish)
cl-dev-bot Aug 2, 2024
b0c2528
New translations en.json (Portuguese, Brazilian)
cl-dev-bot Aug 2, 2024
b6d2c56
New translations en.json (Spanish, Chile)
cl-dev-bot Aug 2, 2024
775c5f6
New translations en.json (Croatian)
cl-dev-bot Aug 2, 2024
7ab6e0c
New translations en.json (Latvian)
cl-dev-bot Aug 2, 2024
095c48d
New translations en.json (English, Canada)
cl-dev-bot Aug 2, 2024
adcd1c6
New translations en.json (English, United Kingdom)
cl-dev-bot Aug 2, 2024
9b247d6
New translations en.json (Welsh)
cl-dev-bot Aug 2, 2024
eeb5be5
New translations en.json (Luxembourgish)
cl-dev-bot Aug 2, 2024
f1bedb8
Merge branch 'master' into dependabot/bundler/back/rubocop-performanc…
adessy Aug 2, 2024
ee6402e
New translations en.json (Serbian (Latin))
cl-dev-bot Aug 2, 2024
0eab306
New translations en.json (Dutch, Belgium)
cl-dev-bot Aug 2, 2024
6e7e091
New translations en.json (English, Ireland)
cl-dev-bot Aug 2, 2024
d841dd9
New translations en.json (French, Belgium)
cl-dev-bot Aug 2, 2024
452b15e
New translations en.json (Moroccan Arabic)
cl-dev-bot Aug 2, 2024
5400a49
New translations en.json (Acholi)
cl-dev-bot Aug 2, 2024
ee4ddc4
Merge pull request #8565 from CitizenLabDotCo/l10n_master
EdwinKato Aug 2, 2024
2786ef1
Merge pull request #8394 from CitizenLabDotCo/dependabot/bundler/back…
adessy Aug 2, 2024
e68c5fa
Merge pull request #8267 from CitizenLabDotCo/dependabot/bundler/back…
adessy Aug 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions back/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ gem 'activerecord-postgis-adapter', '~> 8.0'

gem 'carrierwave', '~> 3.0.7'
gem 'carrierwave-base64', '~> 2.10'
gem 'fog-aws', '~> 3.22'
gem 'fog-aws', '~> 3.24'

gem 'api-pagination', '~> 5.0.0'
gem 'kaminari', '~> 1.2'
Expand All @@ -102,7 +102,7 @@ gem 'icalendar', '~> 2.10'
gem 'interactor'
gem 'interactor-rails'
gem 'liquid', '~> 5.5'
gem 'mini_magick', '~> 4.12'
gem 'mini_magick', '~> 4.13'
gem 'nokogiri', '~> 1.16.5'
gem 'pg_search', '~> 2.3.5'
gem 'premailer-rails', '~> 1.12.0'
Expand Down
32 changes: 16 additions & 16 deletions back/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ GEM
debug_inspector (>= 0.0.1)
bootsnap (1.18.3)
msgpack (~> 1.2)
builder (3.2.4)
builder (3.3.0)
bullet (7.1.6)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
Expand Down Expand Up @@ -562,15 +562,15 @@ GEM
thread_safe
erubi (1.12.0)
event_stream_parser (1.0.0)
excon (0.110.0)
excon (0.111.0)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
factory_bot_rails (6.4.3)
factory_bot (~> 6.4)
railties (>= 5.0.0)
faker (3.4.1)
i18n (>= 1.8.11, < 2)
faraday (2.9.0)
faraday (2.9.2)
faraday-net_http (>= 2.0, < 3.2)
faraday-follow_redirects (0.3.0)
faraday (>= 1, < 3)
Expand All @@ -590,7 +590,7 @@ GEM
ffi-compiler (1.3.2)
ffi (>= 1.15.5)
rake
fog-aws (3.22.0)
fog-aws (3.24.0)
fog-core (~> 2.1)
fog-json (~> 1.1)
fog-xml (~> 0.1)
Expand Down Expand Up @@ -793,11 +793,11 @@ GEM
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0507)
mime-types-data (3.2024.0702)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
mini_magick (4.12.0)
mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.23.1)
mjml-rails (4.11.0)
Expand Down Expand Up @@ -884,8 +884,8 @@ GEM
order_as_specified (1.7)
activerecord (>= 5.0.0)
os (1.1.4)
parallel (1.24.0)
parser (3.3.1.0)
parallel (1.25.1)
parser (3.3.4.0)
ast (~> 2.4.1)
racc
pdf-core (0.10.0)
Expand Down Expand Up @@ -934,7 +934,7 @@ GEM
que-web (0.10.0)
que (>= 1)
sinatra
racc (1.8.0)
racc (1.8.1)
rack (2.2.9)
rack-attack (6.7.0)
rack (>= 1.0, < 4)
Expand Down Expand Up @@ -995,7 +995,7 @@ GEM
ffi (~> 1.0)
rbtree (0.4.6)
redcarpet (3.6.0)
regexp_parser (2.9.0)
regexp_parser (2.9.2)
representable (3.1.1)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
Expand Down Expand Up @@ -1084,9 +1084,9 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-performance (1.18.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.22.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
Expand All @@ -1098,7 +1098,7 @@ GEM
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.28.3)
rubocop (~> 1.40)
ruby-openai (7.0.1)
ruby-openai (7.1.0)
event_stream_parser (>= 0.3.0, < 2.0.0)
faraday (>= 1)
faraday-multipart (>= 1)
Expand Down Expand Up @@ -1276,7 +1276,7 @@ DEPENDENCIES
faker
faraday-jwt (~> 0.1.0)
flag_inappropriate_content!
fog-aws (~> 3.22)
fog-aws (~> 3.24)
frontend!
google-cloud-document_ai (~> 1.4)
google_tag_manager!
Expand Down Expand Up @@ -1312,7 +1312,7 @@ DEPENDENCIES
machine_translations!
mailgun-ruby (~> 1.2.14)
matomo!
mini_magick (~> 4.12)
mini_magick (~> 4.13)
mjml-rails (~> 4.11)
moderation!
multi_tenancy!
Expand Down
2 changes: 1 addition & 1 deletion back/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ def remove_image_if_requested!(resource, resource_params, image_field_name)
return unless resource_params.key?(image_field_name) && resource_params[image_field_name].nil?

# setting the image attribute to nil will not remove the image
resource.public_send("remove_#{image_field_name}!")
resource.public_send(:"remove_#{image_field_name}!")
end
end
2 changes: 1 addition & 1 deletion back/app/controllers/web_api/v1/ideas_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def idea_params(custom_form, user_can_moderate_project)
end

def idea_attributes(custom_form, user_can_moderate_project)
submittable_field_keys = submittable_custom_fields(custom_form).map(&:key).map(&:to_sym)
submittable_field_keys = submittable_custom_fields(custom_form).map { |x| x.key.to_sym }
attributes = idea_simple_attributes(submittable_field_keys)
complex_attributes = idea_complex_attributes(custom_form, submittable_field_keys)
attributes << complex_attributes if complex_attributes.any?
Expand Down
2 changes: 1 addition & 1 deletion back/app/jobs/recreate_versions_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def run(instance, attribute, versions = [])
Rails.logger.info(
"Recreating #{AppConfiguration.instance.name} #{instance.class.name} #{instance.id} #{attribute} versions"
)
return unless instance.valid? && instance.send("#{attribute}?")
return unless instance.valid? && instance.send(:"#{attribute}?")

instance.send(attribute).recreate_versions!(*versions)
instance.save!
Expand Down
2 changes: 1 addition & 1 deletion back/app/services/stats_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class StatsService
def group_by_time(resource, field, start_at, end_at, interval)
resource.send(
"group_by_#{interval}",
:"group_by_#{interval}",
field,
range: start_at..end_at,
time_zone: AppConfiguration.instance.settings('core', 'timezone')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

expect(template['models']['project'].first.dig('title_multiloc', 'en')).to eq project.title_multiloc['en']
expect(template['models']['phase'].size).to eq project.phases.count
expect(template['models']['phase'].pluck('start_at')).to match project.phases.map(&:start_at).map(&:iso8601)
expect(template['models']['phase'].pluck('start_at')).to match(project.phases.map { |x| x.start_at.iso8601 })
expect(template['models']['project_image'].pluck('remote_image_url')).to match project.project_images.map(&:image_url)
expect(template['models']['project'].first.dig('admin_publication_attributes', 'publication_status')).to eq 'draft'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def upload_attributes(*attributes_list)
"remote_#{attr_name}_url",
if: proc { |_record, serialization_params| serialization_params[:uploads_full_urls] }
) do |record, _serialization_params|
record.public_send("#{attr_name}_url")
record.public_send(:"#{attr_name}_url")
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace :fix_existing_tenants do
html_attributes.map do |claz, atrs|
claz.all.map do |instance|
atrs.each do |atr|
instance.send("sanitize_#{atr}")
instance.send(:"sanitize_#{atr}")
instance.update_columns(atr => instance.send(atr))
end
end
Expand All @@ -66,7 +66,7 @@ namespace :fix_existing_tenants do
instance.send attribute
begin
multiloc = TextImageService.new.swap_data_images_multiloc instance[attribute], field: attribute, imageable: instance
instance.send "#{attribute}=", multiloc
instance.send :"#{attribute}=", multiloc
instance.save!
rescue Exception => e
errors += [e.message]
Expand Down Expand Up @@ -108,7 +108,7 @@ namespace :fix_existing_tenants do
multiloc[k] = doc.to_s
end
multiloc = TextImageService.new.swap_data_images_multiloc object[attribute], field: attribute, imageable: object
object.send "#{attribute}=", multiloc
object.send :"#{attribute}=", multiloc
object.save!
end
end
Expand Down Expand Up @@ -206,7 +206,7 @@ namespace :fix_existing_tenants do
instance.update_column(attribute, multiloc)
begin
multiloc = TextImageService.new.swap_data_images_multiloc instance[attribute], field: attribute, imageable: instance
instance.send "#{attribute}=", multiloc
instance.send :"#{attribute}=", multiloc
instance.save!
rescue Exception => e
errors += [e.message]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace :fix do
end

if n_gsubs > 0
record.send("#{column}=", JSON.parse(multiloc_value))
record.send(:"#{column}=", JSON.parse(multiloc_value))
gsubs_performed += n_gsubs if record.save!
end
# rubocop:disable Lint/RescueException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace :sync_tenants do

# In a later iteration, we could first try to parse
# the new (string) value provided in the sheet.
object.send "#{field_name}=", value
object.send :"#{field_name}=", value
object.save!
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'ros-apartment', '>=2.9.0'

spec.add_development_dependency 'rubocop', '1.57.2'
spec.add_development_dependency 'rubocop-performance', '1.18.0'
spec.add_development_dependency 'rubocop-performance', '1.21.1'
spec.add_development_dependency 'rubocop-rails', '2.22.1'
spec.add_development_dependency 'rubocop-rspec', '2.29.2'
spec.metadata['rubygems_mfa_required'] = 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def custom_field_params(resource)
.require(:custom_field)
.permit(
UserCustomFieldPolicy.new(current_user, resource)
.send("permitted_attributes_for_#{params[:action]}")
.send(:"permitted_attributes_for_#{params[:action]}")
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def consentable_for?(user)
return true if roles.blank?

roles.any? do |role|
user.send("#{role}?")
user.send(:"#{role}?")
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def remove_deprecated
end

def remove_consents(emails_url)
emails = open(emails_url).readlines.map(&:strip).map(&:downcase)
emails = open(emails_url).readlines.map { |x| x.strip.downcase }
Rails.logger.info "Found #{emails.size} emails"

users = User.where(email: emails).all
Expand Down
2 changes: 1 addition & 1 deletion back/engines/free/polls/spec/acceptance/responses_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
example_request 'XLSX export for a non-anonymous poll' do
expect(status).to eq 200
worksheet = RubyXL::Parser.parse_buffer(response_body).worksheets[0]
worksheet[0].cells.map(&:value).map(&:downcase)
worksheet[0].cells.map { |x| x.value.downcase }

expect(worksheet.count).to eq 3
expect(worksheet[0].cells.map(&:value)).to include 'User ID'
Expand Down
6 changes: 3 additions & 3 deletions back/lib/carrierwave/file_base64/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ def mount_base64_file_uploader(attribute, uploader_class, options = {})
self.name = file_attributes[:name]
return if data.to_s.empty? || data == send(attribute).to_s

send("#{attribute}_will_change!") if respond_to? "#{attribute}_will_change!"
send(:"#{attribute}_will_change!") if respond_to? :"#{attribute}_will_change!"

unless data.is_a?(String) && data.strip.start_with?('data')
send "#{attribute}=", data
send :"#{attribute}=", data
return
end

file_name = name.split('.')[0..-2].join('.')
extension = name.split('.').last
send "#{attribute}=", Carrierwave::FileBase64::Base64StringIo.new(data.strip, file_name, extension)
send :"#{attribute}=", Carrierwave::FileBase64::Base64StringIo.new(data.strip, file_name, extension)
end

send(:define_method, "#{attribute}_by_url=") do |file_attributes|
Expand Down
2 changes: 1 addition & 1 deletion back/lib/carrierwave_temp_remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def save_files!(model, remote_url_field_names)
column = remote_url_field_name_to_column(remote_url_field_name)
next unless url?(model[column])

model.public_send("#{remote_url_field_name}=", model[column])
model.public_send(:"#{remote_url_field_name}=", model[column])
end
model.save!
end
Expand Down
4 changes: 2 additions & 2 deletions back/lib/finder/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def _abort_if_records_class_invalid

def _filter_records
params.each do |param, value|
next unless respond_to?("#{param}_condition", true)
next unless respond_to?(:"#{param}_condition", true)

new_records = send("#{param}_condition", value)
new_records = send(:"#{param}_condition", value)

@records = new_records if new_records
end
Expand Down
2 changes: 1 addition & 1 deletion back/spec/support/pundit_matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec::Matchers.define :permit do |action|
match do |policy|
policy.public_send("#{action}?")
policy.public_send(:"#{action}?")
end

failure_message do |policy|
Expand Down
2 changes: 1 addition & 1 deletion front/app/containers/AccessibilityStatement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const AccessibilityStatement = () => {
return (
<>
<Helmet>
<title>{formatMessage(messages.title)}</title>
<title>{formatMessage(messages.headTitle)}</title>
<meta
name="description"
content={formatMessage(messages.pageDescription)}
Expand Down
5 changes: 4 additions & 1 deletion front/app/containers/AccessibilityStatement/messages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { defineMessages } from 'react-intl';

export default defineMessages({
// Cookie policy
headTitle: {
id: 'app.containers.AccessibilityStatement.headTitle',
defaultMessage: 'Accessibility Statement | {orgName}',
},
title: {
id: 'app.containers.AccessibilityStatement.title',
defaultMessage: 'Accessibility Statement',
Expand Down
Loading