From 69698a29762a63d7e51ba94751513586708ba889 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 4 Aug 2020 10:12:25 -0700 Subject: [PATCH] Added invocie line return selection by line rather than all items BOD-222 --- .../invoices-list-table.component.jsx | 85 +++++++++++++------ 1 file changed, 59 insertions(+), 26 deletions(-) diff --git a/client/src/components/invoices-list-table/invoices-list-table.component.jsx b/client/src/components/invoices-list-table/invoices-list-table.component.jsx index 6a350520f..fe9bf37ad 100644 --- a/client/src/components/invoices-list-table/invoices-list-table.component.jsx +++ b/client/src/components/invoices-list-table/invoices-list-table.component.jsx @@ -30,6 +30,11 @@ export function InvoicesListTableComponent({ setReconciliationContext, }) { const { t } = useTranslation(); + const [ + selectedInvoiceLinesByInvoice, + setSelectedInvoiceLinesByInvoice, + ] = useState({}); + const [state, setState] = useState({ sortedInfo: {}, }); @@ -98,32 +103,6 @@ export function InvoicesListTableComponent({ > - ), }, @@ -228,6 +207,20 @@ export function InvoicesListTableComponent({ }, ]; + const handleOnInvoiceRowclick = (selectedRows) => { + console.log("selectedRows", selectedRows); + console.log("record.id", record.id); + setSelectedInvoiceLinesByInvoice({ + ...selectedInvoiceLinesByInvoice, + [record.id]: selectedRows.map((r) => r.id), + }); + }; + + console.log( + "selectedInvoiceLinesByInvoice[record.id]", + selectedInvoiceLinesByInvoice[record.id] + ); + return (