fix
This commit is contained in:
BIN
app/.DS_Store
vendored
BIN
app/.DS_Store
vendored
Binary file not shown.
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/static/css/main.46cc12be.css",
|
||||
"main.js": "/static/js/main.1eb25967.js",
|
||||
"main.js": "/static/js/main.79e0cd13.js",
|
||||
"static/js/787.c4e7f8f9.chunk.js": "/static/js/787.c4e7f8f9.chunk.js",
|
||||
"static/media/landing.png": "/static/media/landing.d4c6072db7a67dff6a78.png",
|
||||
"index.html": "/index.html",
|
||||
"main.46cc12be.css.map": "/static/css/main.46cc12be.css.map",
|
||||
"main.1eb25967.js.map": "/static/js/main.1eb25967.js.map",
|
||||
"main.79e0cd13.js.map": "/static/js/main.79e0cd13.js.map",
|
||||
"787.c4e7f8f9.chunk.js.map": "/static/js/787.c4e7f8f9.chunk.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.46cc12be.css",
|
||||
"static/js/main.1eb25967.js"
|
||||
"static/js/main.79e0cd13.js"
|
||||
]
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.min.js"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"><link rel="manifest" href="/manifest.json"/><title>Worldshine Transportation</title><script defer="defer" src="/static/js/main.1eb25967.js"></script><link href="/static/css/main.46cc12be.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.min.js"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"><link rel="manifest" href="/manifest.json"/><title>Worldshine Transportation</title><script defer="defer" src="/static/js/main.79e0cd13.js"></script><link href="/static/css/main.46cc12be.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
client/.DS_Store
vendored
BIN
client/.DS_Store
vendored
Binary file not shown.
BIN
client/src/.DS_Store
vendored
BIN
client/src/.DS_Store
vendored
Binary file not shown.
BIN
client/src/components/.DS_Store
vendored
BIN
client/src/components/.DS_Store
vendored
Binary file not shown.
@@ -563,20 +563,26 @@ const Seating = () => {
|
||||
};
|
||||
|
||||
const onCustomerChange = (selectedCustomer) => {
|
||||
const nextCustomer = selectedCustomer || { value: '', label: '' };
|
||||
setEditingSeat({
|
||||
...editingSeat,
|
||||
customerId: selectedCustomer.value,
|
||||
customerName: selectedCustomer.label
|
||||
customerId: nextCustomer.value,
|
||||
customerName: nextCustomer.label
|
||||
});
|
||||
setSelectedCustomer(selectedCustomer)
|
||||
setSelectedCustomer(nextCustomer)
|
||||
}
|
||||
|
||||
const handleLabelChange = (selectedLabel) => {
|
||||
const nextLabel = selectedLabel || { value: '', label: '' };
|
||||
setEditingSeat({
|
||||
...editingSeat,
|
||||
label: { label_name: selectedLabel.label, id: selectedLabel.value, label_color: currentLabels.find(item => item.id === selectedLabel.value)?.label_color }
|
||||
label: {
|
||||
label_name: nextLabel.label,
|
||||
id: nextLabel.value,
|
||||
label_color: currentLabels.find(item => item.id === nextLabel.value)?.label_color
|
||||
}
|
||||
})
|
||||
setSelectedCustomerLabel(selectedLabel);
|
||||
setSelectedCustomerLabel(nextLabel);
|
||||
}
|
||||
|
||||
const handleNewLabelNameChange = (e) => {
|
||||
@@ -612,7 +618,20 @@ const Seating = () => {
|
||||
}
|
||||
};
|
||||
SeatingService.updateSeating(currentDateRecord?.id, { seating_assignment: finalResult, update_by: localStorage.getItem('user') && JSON.parse(localStorage.getItem('user'))?.name, update_date: new Date()});
|
||||
CustomerService.updateCustomer(customerId, { table_id: tableId, seating: seatId, tags:[...customers.find(item => item.id === customerId)?.tags, label?.label_name], edit_by: localStorage.getItem('user') && JSON.parse(localStorage.getItem('user'))?.name, edit_date: new Date()})
|
||||
if (customerId) {
|
||||
const targetCustomer = customers.find(item => item.id === customerId);
|
||||
const existingTags = Array.isArray(targetCustomer?.tags) ? targetCustomer.tags : [];
|
||||
const nextTags = label?.label_name
|
||||
? Array.from(new Set([...existingTags, label.label_name]))
|
||||
: existingTags;
|
||||
CustomerService.updateCustomer(customerId, {
|
||||
table_id: tableId,
|
||||
seating: seatId,
|
||||
tags: nextTags,
|
||||
edit_by: localStorage.getItem('user') && JSON.parse(localStorage.getItem('user'))?.name,
|
||||
edit_date: new Date()
|
||||
});
|
||||
}
|
||||
return finalResult;
|
||||
});
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
|
||||
const [itemOffset, setItemOffset] = useState(0);
|
||||
const [pageCount, setPageCount] = useState(0);
|
||||
const itemsPerPage = 10;
|
||||
const hasActiveFilters = Boolean((customerFilter || '').trim()) || Boolean(lastNameFilter);
|
||||
|
||||
// Helper function to get all customer IDs already in the route
|
||||
const getAssignedCustomerIds = () => {
|
||||
@@ -151,8 +152,28 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
|
||||
const assignedIds = getAssignedCustomerIds();
|
||||
// Filter out customers already in the route
|
||||
const availableCustomers = customerOptions?.filter(customer => !assignedIds.has(customer.id));
|
||||
setCurrentItems(availableCustomers?.filter(customer => (lastNameFilter && (customer.lastname?.toLowerCase().indexOf(lastNameFilter) === 0)) || !lastNameFilter).filter((customer) => customer.name?.toLowerCase().includes(customerFilter?.toLowerCase()) || customer.id.toLowerCase().includes(customerFilter?.toLowerCase()) || customer.address1?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.address2?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.address3?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.address4?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.address5?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.apartment?.toLowerCase().includes(customerFilter.toLocaleLowerCase()) ).slice(itemOffset, endOffset));
|
||||
setPageCount(Math.ceil(availableCustomers?.filter(customer => (lastNameFilter && (customer.lastname?.toLowerCase().indexOf(lastNameFilter) === 0)) || !lastNameFilter).filter((customer) => customer.name.toLowerCase().includes(customerFilter?.toLowerCase()) || customer.id.toLowerCase().includes(customerFilter?.toLowerCase()) || customer.address1?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.address2?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.address3?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.address4?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.address5?.toLowerCase().includes(customerFilter.toLowerCase()) || customer.apartment?.toLowerCase().includes(customerFilter.toLocaleLowerCase()) ).length / itemsPerPage));
|
||||
const filteredCustomers = availableCustomers
|
||||
?.filter(customer => (lastNameFilter && (customer.lastname?.toLowerCase().indexOf(lastNameFilter) === 0)) || !lastNameFilter)
|
||||
?.filter((customer) =>
|
||||
customer.name?.toLowerCase().includes(customerFilter?.toLowerCase()) ||
|
||||
customer.id.toLowerCase().includes(customerFilter?.toLowerCase()) ||
|
||||
customer.address1?.toLowerCase().includes(customerFilter.toLowerCase()) ||
|
||||
customer.address2?.toLowerCase().includes(customerFilter.toLowerCase()) ||
|
||||
customer.address3?.toLowerCase().includes(customerFilter.toLowerCase()) ||
|
||||
customer.address4?.toLowerCase().includes(customerFilter.toLowerCase()) ||
|
||||
customer.address5?.toLowerCase().includes(customerFilter.toLowerCase()) ||
|
||||
customer.apartment?.toLowerCase().includes(customerFilter.toLocaleLowerCase())
|
||||
) || [];
|
||||
if (hasActiveFilters) {
|
||||
setCurrentItems(filteredCustomers.slice(itemOffset, endOffset));
|
||||
setPageCount(Math.ceil(filteredCustomers.length / itemsPerPage));
|
||||
} else {
|
||||
setCurrentItems(filteredCustomers);
|
||||
setPageCount(0);
|
||||
if (itemOffset !== 0) {
|
||||
setItemOffset(0);
|
||||
}
|
||||
}
|
||||
}, [customerOptions, itemOffset, customerFilter, lastNameFilter, customers]);
|
||||
|
||||
const handlePageClick = (event) => {
|
||||
@@ -723,8 +744,10 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
|
||||
</div>
|
||||
<a className="mb-4" onClick={() => setLastNameFilter(undefined)}>Clear All</a>
|
||||
<div className="customers-container mt-4">
|
||||
<Items currentItems={currentItems} />
|
||||
<ReactPaginate
|
||||
<div style={{ maxHeight: '420px', overflowY: 'auto' }}>
|
||||
<Items currentItems={currentItems} />
|
||||
</div>
|
||||
{hasActiveFilters && pageCount > 1 && <ReactPaginate
|
||||
className="customers-pagination"
|
||||
breakLabel="..."
|
||||
nextLabel=">"
|
||||
@@ -743,7 +766,7 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
|
||||
activeClassName="active"
|
||||
breakClassName="page-item"
|
||||
breakLinkClassName="page-link"
|
||||
/>
|
||||
/>}
|
||||
</div>
|
||||
</>
|
||||
</Modal.Body>
|
||||
@@ -795,8 +818,10 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
|
||||
</div>
|
||||
<a className="mb-4" onClick={() => setLastNameFilter(undefined)}>Clear All</a>
|
||||
<div className="customers-container mt-4">
|
||||
<ItemsGroup currentItems={currentItems} />
|
||||
<ReactPaginate
|
||||
<div style={{ maxHeight: '420px', overflowY: 'auto' }}>
|
||||
<ItemsGroup currentItems={currentItems} />
|
||||
</div>
|
||||
{hasActiveFilters && pageCount > 1 && <ReactPaginate
|
||||
className="customers-pagination"
|
||||
breakLabel="..."
|
||||
nextLabel=">"
|
||||
@@ -815,7 +840,7 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
|
||||
activeClassName="active"
|
||||
breakClassName="page-item"
|
||||
breakLinkClassName="page-link"
|
||||
/>
|
||||
/>}
|
||||
</div>
|
||||
</>
|
||||
</Modal.Body>
|
||||
@@ -867,8 +892,10 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
|
||||
</div>
|
||||
<a className="mb-4" onClick={() => setLastNameFilter(undefined)}>Clear All</a>
|
||||
<div className="customers-container mt-4">
|
||||
<ItemsGroup currentItems={currentItems} />
|
||||
<ReactPaginate
|
||||
<div style={{ maxHeight: '420px', overflowY: 'auto' }}>
|
||||
<ItemsGroup currentItems={currentItems} />
|
||||
</div>
|
||||
{hasActiveFilters && pageCount > 1 && <ReactPaginate
|
||||
className="customers-pagination"
|
||||
breakLabel="..."
|
||||
nextLabel=">"
|
||||
@@ -887,7 +914,7 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
|
||||
activeClassName="active"
|
||||
breakClassName="page-item"
|
||||
breakLinkClassName="page-link"
|
||||
/>
|
||||
/>}
|
||||
</div>
|
||||
</>
|
||||
</Modal.Body>
|
||||
|
||||
Reference in New Issue
Block a user