fix add route issue

This commit is contained in:
2026-02-05 17:23:54 -05:00
parent 49d3c16179
commit 99d6265152
9 changed files with 21 additions and 15 deletions

View File

@@ -1,16 +1,16 @@
{
"files": {
"main.css": "/static/css/main.8bf7011f.css",
"main.js": "/static/js/main.62378aa0.js",
"main.js": "/static/js/main.5ccb77ca.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.8bf7011f.css.map": "/static/css/main.8bf7011f.css.map",
"main.62378aa0.js.map": "/static/js/main.62378aa0.js.map",
"main.5ccb77ca.js.map": "/static/js/main.5ccb77ca.js.map",
"787.c4e7f8f9.chunk.js.map": "/static/js/787.c4e7f8f9.chunk.js.map"
},
"entrypoints": [
"static/css/main.8bf7011f.css",
"static/js/main.62378aa0.js"
"static/js/main.5ccb77ca.js"
]
}

View File

@@ -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.62378aa0.js"></script><link href="/static/css/main.8bf7011f.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.5ccb77ca.js"></script><link href="/static/css/main.8bf7011f.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

View File

@@ -24,7 +24,11 @@ const CreateRoute = () => {
const [routeName, setRouteName] = useState('');
const [newDriver, setNewDriver] = useState('');
const [newVehicle, setNewVehicle] = useState('');
const [newRouteType, setNewRouteType] = useState(params.get('type'));
// Only accept valid route types from URL param, default to 'inbound'
const urlRouteType = params.get('type');
const [newRouteType, setNewRouteType] = useState(
urlRouteType === 'inbound' || urlRouteType === 'outbound' ? urlRouteType : 'inbound'
);
const [showAddCheckItem, setShowAddCheckItem] = useState(false);
const [showCopyCheckItem, setShowCopyCheckItem] = useState(false);
const [newChecklistItems, setNewChecklistItems] = useState([]);
@@ -58,7 +62,9 @@ const CreateRoute = () => {
setRouteName('');
setNewDriver('');
setNewVehicle('');
setNewRouteType(params.get('type'));
// Only accept valid route types from URL param, default to 'inbound'
const urlType = params.get('type');
setNewRouteType(urlType === 'inbound' || urlType === 'outbound' ? urlType : 'inbound');
setNewCustomerList([]);
}
setErrorMessage(undefined);
@@ -243,7 +249,7 @@ const CreateRoute = () => {
<input type="text" value={routeName || ''} onChange={e => setRouteName(e.target.value)}/>
</div>
<div className="me-4">
<div className="field-label">Vechile
<div className="field-label">Vehicle
<span className="required">*</span>
</div>
<select value={newVehicle} onChange={e => setNewVehicle(e.target.value)}>

View File

@@ -163,7 +163,7 @@ const CreateTemplateRoute = () => {
<input type="text" value={routeName || ''} onChange={e => setRouteName(e.target.value)}/>
</div>
<div className="me-4">
<div className="field-label">Vechile
<div className="field-label">Vehicle
<span className="required">*</span>
</div>
<select value={newVehicle} onChange={e => setNewVehicle(e.target.value)}>

View File

@@ -583,7 +583,7 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
};
return (
<>
<DndProvider backend={HTML5Backend}>
{ !viewMode && <h6 class="text-primary">Customers Assigned ({getCurrentAssignedNumber()})</h6>}
{ viewMode && <h6 class="text-primary">Route Assignment <button className="btn btn-sm btn-primary" onClick={() => editFun('assignment')}><Pencil size={16} className="me-2"></Pencil>Edit </button></h6>}
{!viewMode && <CustomersDropZone>
@@ -860,7 +860,7 @@ const RouteCustomerEditor = ({currentRoute, setNewCustomerList = (a) => {}, view
</Button>
</Modal.Footer>
</Modal>
</>
</DndProvider>
);
};

View File

@@ -304,7 +304,7 @@ const RouteEdit = () => {
<input type="text" value={routeName || ''} onChange={e => setRouteName(e.target.value)}/>
</div>
<div className="me-4">
<div className="field-label">Vechile
<div className="field-label">Vehicle
<span className="required">*</span>
</div>
<select value={newVehicle} onChange={e => setNewVehicle(e.target.value)}>