Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix typo in user_format: s/coma/comma/

Alexander Brandon Coles7a5124522c53
diff --git a/app/models/concerns/reactable.rb b/app/models/concerns/reactable.rb
index 9e3fb6e8c64..1c93cdde758 100644
--- a/app/models/concerns/reactable.rb
+++ b/app/models/concerns/reactable.rb
@@ -83,7 +83,7 @@ module Reactable
"users.firstname"
when :lastname_firstname
"concat_ws(' ', users.lastname, users.firstname)"
- when :lastname_coma_firstname
+ when :lastname_comma_firstname
"concat_ws(', ', users.lastname, users.firstname)"
when :lastname_n_firstname
"concat_ws('', users.lastname, users.firstname)"
diff --git a/app/models/principals/scopes/ordered_by_name.rb b/app/models/principals/scopes/ordered_by_name.rb
index 39f8f004c5e..b4699410607 100644
--- a/app/models/principals/scopes/ordered_by_name.rb
+++ b/app/models/principals/scopes/ordered_by_name.rb
@@ -57,7 +57,7 @@ module Principals::Scopes
"concat_ws(' ', users.firstname, users.lastname)"
when :firstname
"users.firstname"
- when :lastname_firstname, :lastname_coma_firstname, :lastname_n_firstname
+ when :lastname_firstname, :lastname_comma_firstname, :lastname_n_firstname
"concat_ws(' ', users.lastname, users.firstname)"
when :username
"users.login"
diff --git a/app/models/queries/filters/shared/user_name_filter.rb b/app/models/queries/filters/shared/user_name_filter.rb
index 2de87015a13..c457df1a380 100644
--- a/app/models/queries/filters/shared/user_name_filter.rb
+++ b/app/models/queries/filters/shared/user_name_filter.rb
@@ -71,7 +71,7 @@ module Queries::Filters::Shared::UserNameFilter
"LOWER(CONCAT(users.firstname, ' ', users.lastname))"
when :firstname
"LOWER(users.firstname)"
- when :lastname_firstname, :lastname_coma_firstname
+ when :lastname_firstname, :lastname_comma_firstname
"LOWER(CONCAT(users.lastname, CONCAT(' ', users.firstname)))"
when :lastname_n_firstname
"LOWER(CONCAT(users.lastname, users.firstname))"
diff --git a/app/models/user.rb b/app/models/user.rb
index e5f2d462219..37d46f537ff 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -36,7 +36,7 @@ class User < Principal
firstname: [:firstname],
lastname_firstname: %i[lastname firstname],
lastname_n_firstname: %i[lastname firstname],
- lastname_coma_firstname: %i[lastname firstname],
+ lastname_comma_firstname: %i[lastname firstname],
username: [:login]
}.freeze
@@ -295,7 +295,7 @@ class User < Principal
when :firstname_lastname then "#{firstname} #{lastname}"
when :lastname_firstname then "#{lastname} #{firstname}"
when :lastname_n_firstname then "#{lastname}#{firstname}"
- when :lastname_coma_firstname then "#{lastname}, #{firstname}"
+ when :lastname_comma_firstname then "#{lastname}, #{firstname}"
when :firstname then firstname
when :username then login
diff --git a/lib/api/decorators/sql/hal_associated_resource.rb b/lib/api/decorators/sql/hal_associated_resource.rb
index 68fc95ae361..ce4512005f7 100644
--- a/lib/api/decorators/sql/hal_associated_resource.rb
+++ b/lib/api/decorators/sql/hal_associated_resource.rb
@@ -58,7 +58,7 @@ module API
def associated_user_link_title(table_name)
-> {
- join_string = if Setting.user_format == :lastname_coma_firstname
+ join_string = if Setting.user_format == :lastname_comma_firstname
" || ', ' || "
else
" || ' ' || "
diff --git a/lib/api/v3/users/user_sql_representer.rb b/lib/api/v3/users/user_sql_representer.rb
index dced22a7510..d8af457821a 100644
--- a/lib/api/v3/users/user_sql_representer.rb
+++ b/lib/api/v3/users/user_sql_representer.rb
@@ -39,7 +39,7 @@ module API
"firstname"
when :lastname_firstname
"concat(lastname, ' ', firstname)"
- when :lastname_coma_firstname
+ when :lastname_comma_firstname
"concat(lastname, ', ', firstname)"
when :lastname_n_firstname
"concat_ws(lastname, '', firstname)"
diff --git a/spec/lib/api/v3/users/user_sql_representer_rendering_spec.rb b/spec/lib/api/v3/users/user_sql_representer_rendering_spec.rb
index 8ab6d29b70d..f1570171427 100644
--- a/spec/lib/api/v3/users/user_sql_representer_rendering_spec.rb
+++ b/spec/lib/api/v3/users/user_sql_representer_rendering_spec.rb
@@ -99,7 +99,7 @@ RSpec.describe API::V3::Users::UserSqlRepresenter, "rendering" do
it_behaves_like "name property depending on user format setting"
end
- context "when user_format is set to lastname_coma_firstname", with_settings: { user_format: :lastname_coma_firstname } do
+ context "when user_format is set to lastname_comma_firstname", with_settings: { user_format: :lastname_comma_firstname } do
it_behaves_like "name property depending on user format setting"
end
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb
index 7959fb13bf1..7528e5727bb 100644
--- a/spec/mailers/user_mailer_spec.rb
+++ b/spec/mailers/user_mailer_spec.rb
@@ -125,7 +125,7 @@ RSpec.describe UserMailer do
# and last name whereby an unescaped comma will lead to have two email addresses
# defined instead of one (['Bobbi', '[email protected]'] vs. ['[email protected]'])
context "with the user name setting prone to trip up email address separation",
- with_settings: { user_format: :lastname_coma_firstname } do
+ with_settings: { user_format: :lastname_comma_firstname } do
it_behaves_like "mail is sent"
end
diff --git a/spec/models/concerns/reactable_spec.rb b/spec/models/concerns/reactable_spec.rb
index 34530f4e2f6..b202d95ce4e 100644
--- a/spec/models/concerns/reactable_spec.rb
+++ b/spec/models/concerns/reactable_spec.rb
@@ -159,7 +159,7 @@ RSpec.describe Reactable do
end
end
- context "when user format is set to :lastname_coma_firstname", with_settings: { user_format: :lastname_coma_firstname } do
+ context "when user format is set to :lastname_comma_firstname", with_settings: { user_format: :lastname_comma_firstname } do
it "returns grouped emoji reactions with last coma firstname" do
result = Journal.grouped_emoji_reactions(reactable_id: wp_journal1.id, reactable_type: "Journal")
diff --git a/spec/models/principal_spec.rb b/spec/models/principal_spec.rb
index 83c0a38a142..38134c1297c 100644
--- a/spec/models/principal_spec.rb
+++ b/spec/models/principal_spec.rb
@@ -135,7 +135,7 @@ RSpec.describe Principal do
shared_let(:placeholder_user_id) { create(:placeholder_user, name: "Wannabejohn").id }
shared_examples "name formatting" do
- context "for lastname_coma_firstname formatter", with_settings: { user_format: :lastname_coma_firstname } do
+ context "for lastname_comma_firstname formatter", with_settings: { user_format: :lastname_comma_firstname } do
it "returns formatted user name" do
expect(user.name).to eq "Smith, John"
end
diff --git a/spec/models/principals/scopes/ordered_by_name_spec.rb b/spec/models/principals/scopes/ordered_by_name_spec.rb
index 65aff95c3e6..5d5c2dd4ee2 100644
--- a/spec/models/principals/scopes/ordered_by_name_spec.rb
+++ b/spec/models/principals/scopes/ordered_by_name_spec.rb
@@ -73,7 +73,7 @@ RSpec.describe Principals::Scopes::OrderedByName do
end
end
- context "with lastname_coma_firstname user sort", with_settings: { user_format: :lastname_coma_firstname } do
+ context "with lastname_comma_firstname user sort", with_settings: { user_format: :lastname_comma_firstname } do
it_behaves_like "sorted results" do
let(:order) { [anonymous.id, eve.id, group.id, placeholder_user.id, alice.id] }
end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 11e084ab73a..af80c4e3ba5 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -332,7 +332,7 @@ RSpec.describe User do
it { is_expected.to eq "SmithJohn" }
end
- context "for lastname_coma_firstname", with_settings: { user_format: :lastname_coma_firstname } do
+ context "for lastname_comma_firstname", with_settings: { user_format: :lastname_comma_firstname } do
it { is_expected.to eq "Smith, John" }
end
@@ -350,8 +350,8 @@ RSpec.describe User do
let(:user) { described_class.select_for_name(formatter).last }
- context "for lastname_coma_firstname" do
- let(:formatter) { :lastname_coma_firstname }
+ context "for lastname_comma_firstname" do
+ let(:formatter) { :lastname_comma_firstname }
it { is_expected.to eq "Smith, John" }
end