Angular: grid cells that use a cellTemplate aren't included in CSV or Print
Bug #1835982 reported by
Jane Sandberg
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Translating a TODO item into a launchpad bug, so that it is easier to find and discuss. :-D
Basically, if a cell uses a specific template rather than just the regular formatter, it will not display in the Print Full Grid or Download Full CSV views.
One example:
1) Go to Cataloging > Match Import/Export
2) Go to the Record Match Set grid
3) If you don't already have a record match set grid, create a new one.
4) Click the gear icon for the column picker/grid options menu.
5) Click Download Full CSV -- note that all the entries in the name column are empty.
6) Click Print Full Grid -- note that the name column is empty again.
Thanks to James Fournie for bringing this to my attention!
Changed in evergreen: | |
assignee: | nobody → Bill Erickson (berick) |
status: | New → Confirmed |
Changed in evergreen: | |
assignee: | nobody → Bill Erickson (berick) |
Changed in evergreen: | |
milestone: | 3.4-beta1 → 3.4-beta2 |
Changed in evergreen: | |
milestone: | 3.4-beta2 → 3.4.1 |
Changed in evergreen: | |
milestone: | 3.4.1 → 3.4.2 |
Changed in evergreen: | |
assignee: | nobody → Galen Charlton (gmc) |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ berick/ lp1835982- grid-csv- template- fields
I tried some experiments with extracting the rendered contents of cellTemplates for printing, but it started getting messy. It also occurred to me generating print content from DOM-rendered templates would require the entire grid to be rendered in the DOM just to print it.
So, I've punted on that for now and instead added support for grid callers to provide functions which return print-friendly content for a given cell.
For example:
<eg-grid-column i18n-label label="Barcode" name="barcode" ]="barcodeTempl ate" [cellPrintValue ]="cellPrintVal ues">
[cellTemplate
this.cellPrintV alues = (row: any, cell: GridColumn): string => {
if (cell.name === 'barcode') {
return row.barcode;
}
}
This requires more effort to define the handlers, but I think the flexibility will appreciated. In the example noted above, where the displayed cell renders view/edit links, the print version skips the links which serve no purpose in a print context.
Also adds a fix to avoid printing "undefined" when no a cellTemplate is used but no cellPrintValue is defined.