Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/components/Captures/CaptureTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@ const columns = [
},
];

//additional columns for export options, passed to ExportCaptures
const exportColumns = [
...columns,
{
attr: 'id',
label: 'Capture UUID',
},
{
attr: 'wallet_token_id',
label: 'Wallet UUID',
},
];

const CaptureTable = () => {
const {
filter,
Expand Down Expand Up @@ -227,7 +240,7 @@ const CaptureTable = () => {
<ExportCaptures
isOpen={isOpenExport}
handleClose={() => setOpenExport(false)}
columns={columns}
columns={exportColumns}
filter={filter}
speciesLookup={speciesLookup}
/>
Expand Down Expand Up @@ -323,7 +336,7 @@ export const formatCell = (capture, speciesLookup, attr, renderer) => {
/>
);
} else if (attr === 'species_id') {
return capture[attr] === null ? '--' : speciesLookup[capture[attr]];
return capture[attr] === null ? '' : speciesLookup[capture[attr]];
} else {
return renderer ? renderer(capture[attr]) : capture[attr];
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/ExportCaptures.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ const ExportCaptures = (props) => {
return captures.map((capture) => {
let formattedCapture = {};
Object.keys(selectedColumns).forEach((attr) => {
if (['id', 'grower_account_id', 'imageUrl'].includes(attr)) {
if (
['reference_id', 'grower_reference_id', 'image_url'].includes(attr)
) {
formattedCapture[attr] = capture[attr];
} else {
const renderer = selectedColumns[attr].renderer;
Expand Down