Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Show meta field columns in export preview datatable - #6152

Open
hilfor wants to merge 3 commits into
kimai:mainfrom
hilfor:feature/export-meta-columns
Open

Show meta field columns in export preview datatable#6152
hilfor wants to merge 3 commits into
kimai:mainfrom
hilfor:feature/export-meta-columns

Conversation

@hilfor

@hilfor hilfor commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • Dispatch TimesheetMetaDisplayEvent::EXPORT in ExportController::indexAction() and pass metaColumns to the template
  • Add mf_ columns to the export preview datatable and column visibility modal in export/index.html.twig
  • Matches the existing pattern in TimesheetAbstractController / timesheet/index.html.twig

Test plan

  • Added testIndexActionShowsMetaFieldColumns to ExportControllerTest
  • Fixed pre-existing phpstan errors in ExportControllerTest
  • 15 tests, 90 assertions, 0 failures
  • Codestyle clean, 0 phpstan errors

@CLAassistant

CLAassistant commented Aug 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@kevinpapst

Copy link
Copy Markdown
Member

Thanks, LGTM 👍
Will give it a test soon.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Dynamic columns leave the overflow warning row misaligned because its colspan remains hard-coded.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds timesheet meta fields to the export preview.

Changes:

  • Dispatches the export meta-display event.
  • Adds dynamic meta-field columns and visibility controls.
  • Adds controller integration coverage and PHPStan fixes.
File summaries
File Description
src/Controller/ExportController.php Supplies meta-field definitions to the export template.
templates/export/index.html.twig Renders configurable meta-field columns.
tests/Controller/ExportControllerTest.php Tests meta columns and resolves type warnings.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread templates/export/index.html.twig
The export preview datatable hardcodes its columns and does not
pick up meta fields registered via TimesheetMetaDisplayEvent.
Dispatch the event in ExportController and render the fields as
mf_ columns, matching the existing pattern in
TimesheetAbstractController and timesheet/index.html.twig.
- Guard nullable Project in addProject callback
- Assert response content is string before assertStringContainsString
- Assert template is not null before calling getId
- Add test for meta field columns in export preview
The skipped-rows warning row used a literal colspan of 10. That
matched the column count when it was introduced in 0330f45, but
columns have been added since and the rate columns became
conditional, so the span already stopped short of the last column.
Timesheet meta columns widen the gap further.

Derive the span from the same columns hash the table header
iterates over, as templates/reporting/project_list_data.html.twig does.

Claude-Session: https://claude.ai/code/session_011Ax3aU3Hor35RRu5G7ZBUm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Rendering meta fields introduces an N+1 query pattern for previews of up to 500 entries.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread templates/export/index.html.twig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants