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

increase limit to 1000 characters for comment

Klaus Zanders6088309bfefb
diff --git a/modules/costs/app/components/time_entries/comments_form.rb b/modules/costs/app/components/time_entries/comments_form.rb
index 0b8d68e3b47..a6cd7abff20 100644
--- a/modules/costs/app/components/time_entries/comments_form.rb
+++ b/modules/costs/app/components/time_entries/comments_form.rb
@@ -31,7 +31,7 @@
module TimeEntries
class CommentsForm < ApplicationForm
form do |f|
- f.text_area name: :comments, label: TimeEntry.human_attribute_name(:comments), maxlength: 255
+ f.text_area name: :comments, label: TimeEntry.human_attribute_name(:comments), maxlength: 1_000
end
end
end
diff --git a/modules/costs/app/models/time_entry.rb b/modules/costs/app/models/time_entry.rb
index 0001ef25d32..a665bd6c1f4 100644
--- a/modules/costs/app/models/time_entry.rb
+++ b/modules/costs/app/models/time_entry.rb
@@ -60,7 +60,7 @@ class TimeEntry < ApplicationRecord
allow_nil: true
validates :comments,
- length: { maximum: 255 },
+ length: { maximum: 1_000 },
allow_blank: true
validates :start_time,
diff --git a/modules/costs/spec/models/time_entry_spec.rb b/modules/costs/spec/models/time_entry_spec.rb
index 650261693da..8ef9fad7413 100644
--- a/modules/costs/spec/models/time_entry_spec.rb
+++ b/modules/costs/spec/models/time_entry_spec.rb
@@ -491,13 +491,13 @@ RSpec.describe TimeEntry do
expect(time_entry).to be_valid
end
- it "allows values with a length of 255 characters" do
- time_entry.comments = "a" * 255
+ it "allows values with a length of 1000 characters" do
+ time_entry.comments = "a" * 1000
expect(time_entry).to be_valid
end
- it "does not allow values with a length of >255 characters" do
- time_entry.comments = "a" * 256
+ it "does not allow values with a length of >1000 characters" do
+ time_entry.comments = "a" * 1001
expect(time_entry).not_to be_valid
end
end