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
refactor a bit more stuff
Klaus Zanders4f39ee95c313
diff --git a/modules/costs/app/components/my/time_tracking/calendar_component.html.erb b/modules/costs/app/components/my/time_tracking/calendar_component.html.erbindex d9b301699e3..edd6f7c9dd8 100644--- a/modules/costs/app/components/my/time_tracking/calendar_component.html.erb+++ b/modules/costs/app/components/my/time_tracking/calendar_component.html.erb@@ -23,7 +23,9 @@<div data-my--time-tracking-target="calendar"></div>- <%- if mode != :day %>- <div><%= total_hours %></div>- <%- end %>-<%- end %>+ <% if mode != :day %>+ <%= flex_layout(align_items: :flex_end) do |flex| %>+ <% flex.with_row(mt: 2, font_weight: :bold) { total_hours } %>+ <% end %>+ <% end %>+<% end %>diff --git a/modules/costs/app/components/my/time_tracking/calendar_component.rb b/modules/costs/app/components/my/time_tracking/calendar_component.rbindex c6c39eccc7a..4a470fe99a5 100644--- a/modules/costs/app/components/my/time_tracking/calendar_component.rb+++ b/modules/costs/app/components/my/time_tracking/calendar_component.rb@@ -32,7 +32,8 @@ module Mymodule TimeTrackingclass CalendarComponent < ApplicationComponentinclude OpTurbo::Streamable- include ComponentNavigation+ include OpPrimer::ComponentHelpers+ include SharedComponentoptions time_entries: [],mode: :week,diff --git a/modules/costs/app/components/my/time_tracking/list_component.html.erb b/modules/costs/app/components/my/time_tracking/list_component.html.erbindex 13dd2c0c42c..50b66aa528f 100644--- a/modules/costs/app/components/my/time_tracking/list_component.html.erb+++ b/modules/costs/app/components/my/time_tracking/list_component.html.erb@@ -9,7 +9,7 @@endend- component.with_action_button(tag: :a, href: today_href) { "Today" }+ component.with_action_button(tag: :a, href: today_href) { t("label_today") }component.with_action_button(scheme: :primary,diff --git a/modules/costs/app/components/my/time_tracking/list_component.rb b/modules/costs/app/components/my/time_tracking/list_component.rbindex 885763cbba4..4e1fea3c00c 100644--- a/modules/costs/app/components/my/time_tracking/list_component.rb+++ b/modules/costs/app/components/my/time_tracking/list_component.rb@@ -32,7 +32,7 @@ module Mymodule TimeTrackingclass ListComponent < ApplicationComponentinclude OpTurbo::Streamable- include ComponentNavigation+ include SharedComponentoptions time_entries: [],mode: :week,diff --git a/modules/costs/app/components/my/time_tracking/component_navigation.rb b/modules/costs/app/components/my/time_tracking/shared_component.rbsimilarity index 90%rename from modules/costs/app/components/my/time_tracking/component_navigation.rbrename to modules/costs/app/components/my/time_tracking/shared_component.rbindex 175d1fdcb8c..618fd5b40a4 100644--- a/modules/costs/app/components/my/time_tracking/component_navigation.rb+++ b/modules/costs/app/components/my/time_tracking/shared_component.rb@@ -30,7 +30,7 @@#module Mymodule TimeTracking- module ComponentNavigation+ module SharedComponentextend ActiveSupport::Concerndef title # rubocop:disable Metrics/AbcSizecase mode@@ -41,14 +41,14 @@ module Myeow = date.end_of_weekif bow.year == eow.year && bow.month == eow.month- "#{bow.strftime('%d.')} - #{eow.strftime('%d. %B %Y')}"+ [I18n.l(bow, format: "%d."), I18n.l(eow, format: "%d. %B %Y")].join(" - ")elsif bow.year == eow.year- "#{bow.strftime('%d. %B')} - #{eow.strftime('%d. %B %Y')}"+ [I18n.l(bow, format: "%d. %B"), I18n.l(eow, format: "%d. %B %Y")].join(" - ")else- "#{bow.strftime('%d. %B %Y')} - #{eow.strftime('%d. %B %Y')}"+ [I18n.l(bow, format: "%d. %B %Y"), I18n.l(eow, format: "%d. %B %Y")].join(" - ")endwhen :month- date.strftime("%B %Y")+ I18n.l(date, format: "%B %Y")endenddiff --git a/modules/costs/app/components/my/time_tracking/time_entry_row.rb b/modules/costs/app/components/my/time_tracking/time_entry_row.rbindex 4c4215b446d..d85fa6568ef 100644--- a/modules/costs/app/components/my/time_tracking/time_entry_row.rb+++ b/modules/costs/app/components/my/time_tracking/time_entry_row.rb@@ -34,10 +34,12 @@ module Mydef button_links[action_menu- ]+ ].compactenddef action_menu+ return nil unless User.current.allowed_in_work_package?(:edit_own_time_entries, time_entry.work_package)+render(Primer::Alpha::ActionMenu.new) do |menu|menu.with_show_button(icon: "kebab-horizontal", "aria-label": t("label_more"), scheme: :invisible)menu.with_item(diff --git a/modules/costs/app/controllers/time_entries_controller.rb b/modules/costs/app/controllers/time_entries_controller.rbindex 7e5f15ab3d1..40fb48ef8d3 100644--- a/modules/costs/app/controllers/time_entries_controller.rb+++ b/modules/costs/app/controllers/time_entries_controller.rb@@ -125,8 +125,6 @@ class TimeEntriesController < ApplicationControllerform_component = TimeEntries::TimeEntryFormComponent.new(time_entry: @time_entry, **form_config_options)update_via_turbo_stream(component: form_component, status: :bad_request)end-- respond_with_turbo_streamsendprivate