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

minor adjustments towards resource injection, not restricting the editor type

Jonas Jabari78ca627db506
diff --git a/app/components/work_packages/activities_tab/journals/item_component/edit.html.erb b/app/components/work_packages/activities_tab/journals/item_component/edit.html.erb
index 0e17f8952e1..3fae4360c28 100644
--- a/app/components/work_packages/activities_tab/journals/item_component/edit.html.erb
+++ b/app/components/work_packages/activities_tab/journals/item_component/edit.html.erb
@@ -10,7 +10,7 @@
) do |f|
flex_layout do |form_container|
form_container.with_row do
- render(WorkPackages::ActivitiesTab::Journals::NotesForm.new(f, journal:))
+ render(WorkPackages::ActivitiesTab::Journals::NotesForm.new(f))
end
form_container.with_row(flex_layout: true, mt: 3, justify_content: :flex_end) do |submit_container|
submit_container.with_column(mr: 2) do
diff --git a/app/components/work_packages/activities_tab/journals/new_component.html.erb b/app/components/work_packages/activities_tab/journals/new_component.html.erb
index f14375d05a8..42ff11c03bc 100644
--- a/app/components/work_packages/activities_tab/journals/new_component.html.erb
+++ b/app/components/work_packages/activities_tab/journals/new_component.html.erb
@@ -41,7 +41,7 @@
) do |f|
flex_layout(justify_content: :space_between, align_items: :flex_end) do |form_container|
form_container.with_column(id: "ck-editor-column", mr: 2) do
- render(WorkPackages::ActivitiesTab::Journals::NotesForm.new(f, journal:))
+ render(WorkPackages::ActivitiesTab::Journals::NotesForm.new(f))
end
form_container.with_column do
render(Primer::Beta::IconButton.new(
diff --git a/app/forms/work_packages/activities_tab/journals/notes_form.rb b/app/forms/work_packages/activities_tab/journals/notes_form.rb
index f76ba4ede8b..9d28b86b8ba 100644
--- a/app/forms/work_packages/activities_tab/journals/notes_form.rb
+++ b/app/forms/work_packages/activities_tab/journals/notes_form.rb
@@ -27,6 +27,8 @@
#++
module WorkPackages::ActivitiesTab::Journals
class NotesForm < ApplicationForm
+ delegate :object, to: :@builder
+
form do |notes_form|
notes_form.rich_text_area(
name: :notes,
@@ -34,21 +36,18 @@ module WorkPackages::ActivitiesTab::Journals
rich_text_options: {
showAttachments: false,
macros: "none",
- resource:,
- editorType: "constrained"
+ resource:
}
)
end
- def initialize(journal:)
- @journal = journal
- end
-
private
def resource
+ return unless object
+
API::V3::Activities::ActivityRepresenter
- .new(@journal, current_user: User.current, embed_links: false)
+ .new(object, current_user: User.current, embed_links: false)
end
end
end