Changed the customer name and Property column types to link to support additional ways to access the forthcoming customer detail page and the current property detail page.

This commit is contained in:
rocketdebris 2026-01-09 09:51:22 -05:00
parent 1a7f0d872a
commit 54280ac78f

View File

@ -112,10 +112,11 @@ const columns = [
{
label: "Customer Name",
fieldName: "customerName",
type: "text",
type: "link",
sortable: true,
filterable: true,
filterInputId: "customerSearchInput",
onLinkClick: (link, rowData) => handleCustomerClick(link, rowData),
},
{
label: "Type",
@ -126,10 +127,11 @@ const columns = [
{
label: "Property",
fieldName: "address",
type: "text",
type: "link",
sortable: true,
filterable: true,
filterInputId: "propertySearchInput",
onLinkClick: (link, rowData) => handlePropertyClick(link, rowData),
},
//{
// label: "Create Estimate",
@ -297,6 +299,20 @@ const handleAppointmentClick = (status, rowData) => {
}
};
const handleCustomerClick = (link, rowData) => {
console.log("DEBUG: Customer Link Clicked.");
const client = encodeURIComponent(rowData.customerName);
const address = encodeURIComponent(rowData.address);
router.push(`/client?client=${client}&address=${address}`);
}
const handlePropertyClick = (link, rowData) => {
console.log("DEBUG: Property Link Clicked.");
const client = encodeURIComponent(rowData.customerName);
const address = encodeURIComponent(rowData.address);
router.push(`/client?client=${client}&address=${address}`);
}
const handleEstimateClick = (status, rowData) => {
const address = encodeURIComponent(rowData.address);
router.push(`/estimate?new=true&address=${address}`);