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

show everything in the table like we have it in the figma

Klaus Zanders8b8e6c3f71ff
diff --git a/modules/costs/app/components/my/time_tracking/daily_entries_table.rb b/modules/costs/app/components/my/time_tracking/daily_entries_table.rb
index b163492d5f6..427cf7ee09e 100644
--- a/modules/costs/app/components/my/time_tracking/daily_entries_table.rb
+++ b/modules/costs/app/components/my/time_tracking/daily_entries_table.rb
@@ -59,13 +59,21 @@ module My
def headers
[
- [:time, { caption: "Time" }],
+ TimeEntry.can_track_start_and_end_time? ? [:time, { caption: "Time" }] : nil,
[:hours, { caption: "Hours" }],
[:subject, { caption: "Subject" }],
[:project, { caption: "Project" }],
[:activity, { caption: "Activity" }],
[:comments, { caption: "Comments" }]
- ]
+ ].compact
+ end
+
+ def skip_column?(column)
+ if column == :time
+ !TimeEntry.can_track_start_and_end_time?
+ else
+ false
+ end
end
end
end
diff --git a/modules/costs/app/components/my/time_tracking/time_entry_row.rb b/modules/costs/app/components/my/time_tracking/time_entry_row.rb
index 9097653131b..4c4215b446d 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
@@ -55,8 +55,18 @@ module My
end
end
- def time
- time_entry.start_timestamp || ""
+ def time # rubocop:disable Metrics/AbcSize
+ return if time_entry.start_time.blank?
+
+ times = [I18n.l(time_entry.start_timestamp, format: :time)]
+
+ times << if time_entry.start_timestamp.to_date == time_entry.end_timestamp.to_date
+ I18n.l(time_entry.end_timestamp, format: :time)
+ else
+ I18n.l(time_entry.end_timestamp, format: :short)
+ end
+
+ times.join(" - ")
end
def hours
@@ -64,11 +74,16 @@ module My
end
def subject
- "##{time_entry.work_package.id} - #{time_entry.work_package.subject}"
+ render(Primer::Beta::Link.new(href: project_work_package_path(time_entry.project, time_entry.work_package),
+ underline: false)) do
+ "##{time_entry.work_package.id}"
+ end + " - #{time_entry.work_package.subject}"
end
def project
- time_entry.project.name
+ render(Primer::Beta::Link.new(href: project_path(time_entry.project), underline: false)) do
+ time_entry.project.name
+ end
end
def activity