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
obey rubocop
as-op4fd2a2d0d9d9
diff --git a/frontend/src/stimulus/controllers/dynamic/costs/export.controller.ts b/frontend/src/stimulus/controllers/dynamic/costs/export.controller.tsindex 183aa9ffc91..ba839789d48 100644--- a/frontend/src/stimulus/controllers/dynamic/costs/export.controller.ts+++ b/frontend/src/stimulus/controllers/dynamic/costs/export.controller.ts@@ -14,7 +14,6 @@ export default class ExportController extends Controller<HTMLLinkElement> {}async showJobModal(job_id:string) {- console.log(this.jobModalUrl(job_id));const response = await fetch(this.jobModalUrl(job_id), {method: 'GET',headers: { Accept: 'text/vnd.turbo-stream.html' },@@ -43,7 +42,7 @@ export default class ExportController extends Controller<HTMLLinkElement> {}get href() {- return (this.element as HTMLLinkElement).href;+ return this.element.href;}download(evt:CustomEvent) {diff --git a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rbindex 907228cbd28..127c32571b1 100644--- a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb+++ b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb@@ -34,6 +34,7 @@ class CostQuery::PDF::TimesheetGeneratorself.pdf = get_pdf@page_count = 0configure_page_size!(:portrait)+ pdf.title = headingenddef generate!@@ -46,19 +47,31 @@ class CostQuery::PDF::TimesheetGeneratordef render_docwrite_cover_page! if with_cover?+ write_heading!+ write_hr!+ write_entries!+ end+ def write_heading!pdf.formatted_text([{ text: heading }])- write_hr- query- .each_direct_result- .map(&:itself)- .filter { |r| r.fields["type"] == "TimeEntry" }+ end++ def write_entries!+ all_entries.group_by { |r| r.fields["user_id"] }.each do |user_id, result|write_table(user_id, result)endend+ def all_entries+ query+ .each_direct_result+ .map(&:itself)+ .filter { |r| r.fields["type"] == "TimeEntry" }+ end++ # rubocop:disable Metrics/AbcSizedef build_table_rows(entries)rows = []entries@@ -82,6 +95,7 @@ class CostQuery::PDF::TimesheetGeneratorendrowsend+ # rubocop:enable Metrics/AbcSizedef format_duration(hours)return "" if hours < 0@@ -105,12 +119,16 @@ class CostQuery::PDF::TimesheetGeneratorquery.each_direct_result.map(&:itself)end- def write_hr+ # rubocop:disable Metrics/AbcSize+ def write_hr!hr_style = styles.cover_header_border- pdf.stroke_color = hr_style[:color]- pdf.line_width = hr_style[:height]- pdf.stroke_horizontal_line pdf.bounds.left, pdf.bounds.right, at: pdf.cursor+ pdf.stroke do+ pdf.line_width = hr_style[:color]+ pdf.stroke_color hr_style[:height]+ pdf.stroke_horizontal_line pdf.bounds.left, pdf.bounds.right, at: pdf.cursor+ endend+ # rubocop:enable Metrics/AbcSizedef with_cover?true