Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
…into pdf-exporter-tests
There was a problem hiding this comment.
🔵 Needs a closer look
One or more issues must be addressed before approval.
Pull request overview
Adds extensive PDF exporter coverage and hardens column-group layout resolution against missing keys and recursive cycles.
Changes:
- Adds PDF content, pagination, font, layout, and edge-case assertions.
- Refactors tests to export prepared records directly.
- Prevents recursive layout resolution for malformed column groups.
File summaries
| File | Description |
|---|---|
| projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter.ts | Updated as part of this pull request. |
| projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter.spec.ts | Updated as part of this pull request. |
Review details
- Files reviewed: 1/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter.ts:977
- A raw dimension value is considered resolved only when it is not
undefined, and the fallback is entered whenevercellValue === null. Consequently, a pivot record whose dimension is explicitlynullis replaced by a positional/header-derived value instead of rendering as an empty dimension cell. Track whether the raw record owns the dimension key and skip the fallback whenever it does, regardless of the stored value.
const dimensionKey = rowDimensionFields[index];
if (isPivotGrid && dimensionKey && record.rawData?.[dimensionKey] !== undefined) {
cellValue = record.rawData[dimensionKey];
}
// Otherwise: get the value from row dimension columns' header property
// The row dimension columns are created with header = actual dimension value to display
if (cellValue === null && isPivotGrid && allColumns) {
- Files reviewed: 3/4 changed files
- Comments generated: 4
- Review effort level: Lite
Removed unnecessary comments regarding sample test data and jsPDF behavior. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter.ts:1125
- The
GRID_LEVEL_COLguard was removed here under the assumption thatcolumnsis always pre-filtered, butleafColumnsis also synthesized fromObject.keys(firstDataElement.data)when the owner has no usable columns (lines 206-219), and the base exporter can putGRID_LEVEL_COLinto that data. In that fallback case this loop now exports the internal level field as a visible header/value (anddrawTableHeadersreceives the same unfiltered list), changing the PDF layout. FilterGRID_LEVEL_COLwhen synthesizing the fallback columns, or retain the guard in both header and row rendering paths.
// Draw data columns - GRID_LEVEL_COL is already out of the list by now
columns.forEach((col, index) => {
const xPosition = xStart + rowDimensionOffset + (index * columnWidth);
let cellValue = record.data[col.field];
- Files reviewed: 3/4 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical and moderate issues can produce incorrect pivot row labels.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter.ts:1153
- When a pivot record's raw dimension value is explicitly
null, line 1147 assignsnull, but this condition immediately treats that as unresolved and falls through to the row-header/record-data heuristics. That can replace a genuinely blank dimension with a caption or another matching value, producing an incorrect exported row label. Track whether the raw-data key exists separately and skip these fallbacks whenever it exists, including when its value isnull.
if (cellValue === null && isPivotGrid && allColumns) {
- Files reviewed: 4/5 changed files
- Comments generated: 1
- Review effort level: Lite
|
@igdmdimitrov This PR is ready for review. I added more context in the description. |
There was a problem hiding this comment.
🔵 Needs a closer look
Pagination can omit pivot row-dimension headers on subsequent pages.
Review details
Suppressed comments (1)
projects/igniteui-angular/grids/core/src/services/pdf/pdf-exporter.ts:374
- When a pivot has row-dimension headers but no multi-column/multi-row data headers, the initial page uses
drawMultiLevelHeaders(the condition above), but subsequent pages enter thisdrawTableHeadersbranch. That method receivesleafColumns, which no longer containsPivotRowHeadercolumns, so it draws no row-dimension header text on page 2 and lays the data headers out with an offset for a missing cell. The new pagination test for pivot row-dimension headers will therefore fail (or produce inconsistent pages). Reuse the same multi-level header path on page breaks whenever the initial header path is selected, or pass the complete column list to the simple-header path.
this.drawTableHeaders(pdf, leafColumns, rowDimensionHeaders, margin, yPosition, columnWidth, headerHeight, usableWidth, options, fontNames);
- Files reviewed: 4/5 changed files
- Comments generated: 0 new
- Review effort level: Lite
Description
Improving test coverage and hardening the test verifications, by adding more tests and more deeper assertions.
Before:


After:


Enhancements:
Added background to the summary rows, so they don't blend with the data rows and are more distinguishable as footers.


Before:
After:
Added background to the row dimension headers on pivot export, so they are also distinguishable from the pure data rows.


Before:
After:
Added merging to the pivot dimension headers on pivot export, similar to the multi-column headers.


Before:
After:
Bug fix:
Failed custom font loading resulted in failed export. Now it falls back to helvetica. Also, custom font was set on root level and could break on parallel exports and was also being preserved for subsequent exports. Now the export instance carries its font with it.
Motivation / Context
Initial motivation was to harden the tests and to increase coverage. Through the tests development, I noticed areas for improvements, which are delighters but make a lot of difference.
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
Test Configuration:
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)