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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
highlight journal items with unread notification, minor refactoring
Jonas Jabaricb44f598fb4b
diff --git a/app/components/work_packages/activities_tab/journals/index_component.rb b/app/components/work_packages/activities_tab/journals/index_component.rbindex bf51b4f313e..fb5eb85b3f4 100644--- a/app/components/work_packages/activities_tab/journals/index_component.rb+++ b/app/components/work_packages/activities_tab/journals/index_component.rb@@ -60,7 +60,7 @@ module WorkPackagesenddef journals- result = work_package.journals.includes(:user).reorder(version: journal_sorting)+ result = work_package.journals.includes(:user, :notifications).reorder(version: journal_sorting)result = result.where.not(notes: "") if only_commentsdiff --git a/app/components/work_packages/activities_tab/journals/item_component.html.erb b/app/components/work_packages/activities_tab/journals/item_component.html.erbindex 0ebcf162efb..9378d0daef3 100644--- a/app/components/work_packages/activities_tab/journals/item_component.html.erb+++ b/app/components/work_packages/activities_tab/journals/item_component.html.erb@@ -36,6 +36,11 @@endendheader_container.with_column(flex_layout: true, align_items: :center) do |header_end_container|+ if has_unread_notifications?+ header_end_container.with_column(mr: 2, pt: 1) do+ bubble_html+ end+ endheader_end_container.with_column dorender(Primer::Beta::Link.new(href: activity_anchor,diff --git a/app/components/work_packages/activities_tab/journals/item_component.rb b/app/components/work_packages/activities_tab/journals/item_component.rbindex bbca942ec0c..40734e39fd0 100644--- a/app/components/work_packages/activities_tab/journals/item_component.rb+++ b/app/components/work_packages/activities_tab/journals/item_component.rb@@ -82,16 +82,16 @@ module WorkPackagesjournal.user == User.currentend- def initial_version?- journal.version == 1- end-def updated?- return false if initial_version?+ return false if journal.initial?journal.updated_at - journal.created_at > 5.secondsend+ def has_unread_notifications?+ journal.notifications.where(read_ian: false, recipient_id: User.current.id).any?+ end+def copy_url_action_item(menu)menu.with_item(label: t("button_copy_link_to_clipboard"),tag: :button,@@ -113,6 +113,15 @@ module WorkPackagesitem.with_leading_visual_icon(icon: :pencil)endend++ def bubble_html+ "+ <span+ class=\"comments-number--bubble op-bubble op-bubble_mini\"+ data-test-selector=\"user-activity-bubble\"+ ></span>+ ".html_safe+ endendendenddiff --git a/app/components/work_packages/activities_tab/journals/item_component/show.html.erb b/app/components/work_packages/activities_tab/journals/item_component/show.html.erbindex a45b3637707..797b27b8582 100644--- a/app/components/work_packages/activities_tab/journals/item_component/show.html.erb+++ b/app/components/work_packages/activities_tab/journals/item_component/show.html.erb@@ -1,6 +1,6 @@<%=component_wrapper do- if journal.notes.present? || (journal.details.any? && journal.version != 1)+ if journal.notes.present? || (journal.details.any? && !journal.initial?)flex_layout do |journal_container|if journal.notes.present?journal_container.with_row(mt: 3) do@@ -9,7 +9,7 @@endendend- if journal.details.any? && journal.version != 1+ if journal.details.any? && !journal.initial?journal_container.with_row(flex_layout: true, border_radius: 2, p: 3, my: 3, bg: :subtle) do |details_container|journal.details.each do |detail|details_container.with_row(mt: 1, font_size: :small) do