From af5a0f64b001d8f6987ab690bc9b6de89740f325 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 4 Sep 2024 20:19:19 +1000 Subject: [PATCH] PUI: Improve table rendering of link columns (#8072) - Some columns were missing correct rendering function --- src/frontend/src/tables/company/AddressTable.tsx | 7 ++----- .../tables/purchasing/PurchaseOrderLineItemTable.tsx | 10 ++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/frontend/src/tables/company/AddressTable.tsx b/src/frontend/src/tables/company/AddressTable.tsx index e65b42bc01..efdef74534 100644 --- a/src/frontend/src/tables/company/AddressTable.tsx +++ b/src/frontend/src/tables/company/AddressTable.tsx @@ -15,6 +15,7 @@ import { useTable } from '../../hooks/UseTable'; import { apiUrl } from '../../states/ApiState'; import { useUserState } from '../../states/UserState'; import { TableColumn } from '../Column'; +import { LinkColumn } from '../ColumnRenderers'; import { InvenTreeTable } from '../InvenTreeTable'; import { RowAction, RowDeleteAction, RowEditAction } from '../RowActions'; @@ -91,11 +92,7 @@ export function AddressTable({ sortable: false, switchable: true }, - { - accessor: 'link', - sortable: false, - switchable: true - } + LinkColumn({}) ]; }, []); diff --git a/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx b/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx index a875ec02e8..e2cf862a88 100644 --- a/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx +++ b/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx @@ -203,13 +203,11 @@ export function PurchaseOrderLineItemTable({ sortable: true, ordering: 'SKU' }, - { - accessor: 'supplier_link', + LinkColumn({ + accessor: 'supplier_part_detail.link', title: t`Supplier Link`, - - sortable: false, - render: (record: any) => record?.supplier_part_detail?.link - }, + sortable: false + }), { accessor: 'MPN', title: t`Manufacturer Code`,