This commit is contained in:
@@ -90,6 +90,7 @@ const RoutesDashboard = () => {
|
|||||||
const [customerTypeFixing, setCustomerTypeFixing] = useState({});
|
const [customerTypeFixing, setCustomerTypeFixing] = useState({});
|
||||||
const [customerSpecialNeedsFixing, setCustomerSpecialNeedsFixing] = useState({});
|
const [customerSpecialNeedsFixing, setCustomerSpecialNeedsFixing] = useState({});
|
||||||
const [customerNoteFixing, setCustomerNoteFixing] = useState({});
|
const [customerNoteFixing, setCustomerNoteFixing] = useState({});
|
||||||
|
const [isScheduleEditMode, setIsScheduleEditMode] = useState(false);
|
||||||
const scheduleImportProgressTimerRef = useRef(null);
|
const scheduleImportProgressTimerRef = useRef(null);
|
||||||
|
|
||||||
|
|
||||||
@@ -701,6 +702,10 @@ const RoutesDashboard = () => {
|
|||||||
}
|
}
|
||||||
}, [allRoutes, allHistoryRoutes, allTomorrowRoutes]);
|
}, [allRoutes, allHistoryRoutes, allTomorrowRoutes]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setIsScheduleEditMode(false);
|
||||||
|
}, [dateSelected, currentTab]);
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const yesterday = new Date();
|
const yesterday = new Date();
|
||||||
const tomorrow = new Date();
|
const tomorrow = new Date();
|
||||||
@@ -1754,13 +1759,12 @@ const RoutesDashboard = () => {
|
|||||||
<div className="app-main-content-list-func-container">
|
<div className="app-main-content-list-func-container">
|
||||||
<Tabs defaultActiveKey="allRoutesOverview" id="routes-tab" onSelect={k => changeTab(k)}>
|
<Tabs defaultActiveKey="allRoutesOverview" id="routes-tab" onSelect={k => changeTab(k)}>
|
||||||
<Tab eventKey="allRoutesOverview" title="All Routes Overview">
|
<Tab eventKey="allRoutesOverview" title="All Routes Overview">
|
||||||
{(!dateSelected || getDateString(dateSelected) === getDateString(new Date())) && <div className="app-main-content-fields-section with-function">
|
{(!dateSelected || getDateString(dateSelected) === getDateString(new Date())) && isScheduleEditMode && <div className="app-main-content-fields-section with-function">
|
||||||
<button className="btn btn-primary me-2" onClick={() => directToSchedule()}><CalendarCheck size={16} className="me-2"></CalendarCheck> Schedule Tomorrow's Routes</button>
|
<button className="btn btn-primary me-2" onClick={() => directToSchedule()}><CalendarCheck size={16} className="me-2"></CalendarCheck> Schedule Tomorrow's Routes</button>
|
||||||
{/* <button className="btn btn-primary me-2" onClick={() => syncCustomersInfo()}><Clock size={16} className="me-2"></Clock> {showSyncCustomersLoading? <Spinner size={12}></Spinner> : `Sync Customers Data`}</button> */}
|
{/* <button className="btn btn-primary me-2" onClick={() => syncCustomersInfo()}><Clock size={16} className="me-2"></Clock> {showSyncCustomersLoading? <Spinner size={12}></Spinner> : `Sync Customers Data`}</button> */}
|
||||||
<button className="btn btn-primary me-2" onClick={()=> handleCleanAllRoutesStatus()}><Eraser size={16} className="me-2"></Eraser > Clean Route Status</button>
|
<button className="btn btn-primary me-2" onClick={()=> handleCleanAllRoutesStatus()}><Eraser size={16} className="me-2"></Eraser > Clean Route Status</button>
|
||||||
{/* <button className="btn btn-primary me-2" onClick={() => goToHistoryPage()}><ClockHistory size={16} className="me-2"></ClockHistory> View History</button> */}
|
{/* <button className="btn btn-primary me-2" onClick={() => goToHistoryPage()}><ClockHistory size={16} className="me-2"></ClockHistory> View History</button> */}
|
||||||
<button className="btn btn-primary me-2" onClick={() => copyYesterdayRoutes()}><Copy size={16} className="me-2"></Copy>{showCopyDateLoading? <Spinner size={12}></Spinner> : `Copy Yesterday Routes`}</button>
|
<button className="btn btn-primary me-2" onClick={() => copyYesterdayRoutes()}><Copy size={16} className="me-2"></Copy>{showCopyDateLoading? <Spinner size={12}></Spinner> : `Copy Yesterday Routes`}</button>
|
||||||
<button className="btn btn-primary" onClick={() => generateRouteReport()}><Download size={16} className="me-2"></Download>Export Route Report</button>
|
|
||||||
</div>}
|
</div>}
|
||||||
{isFutureScheduleSelected && <div className="app-main-content-fields-section with-function">
|
{isFutureScheduleSelected && <div className="app-main-content-fields-section with-function">
|
||||||
{/* <button type="button" className="btn btn-primary btn-sm me-2" onClick={()=> validateSchedule()}><Check size={16} className="me-2"></Check> Validate and Finish Planning</button> */}
|
{/* <button type="button" className="btn btn-primary btn-sm me-2" onClick={()=> validateSchedule()}><Check size={16} className="me-2"></Check> Validate and Finish Planning</button> */}
|
||||||
@@ -1920,6 +1924,9 @@ const RoutesDashboard = () => {
|
|||||||
{
|
{
|
||||||
currentTab === 'allRoutesOverview' && <> {
|
currentTab === 'allRoutesOverview' && <> {
|
||||||
!showCopyDateTargetLoading && <>
|
!showCopyDateTargetLoading && <>
|
||||||
|
<button className="btn btn-outline-secondary me-2" onClick={() => generateRouteReport()}>
|
||||||
|
<Download size={16} className="me-2"></Download>Export Route Report
|
||||||
|
</button>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
key={'signature-date'}
|
key={'signature-date'}
|
||||||
id="signature-date"
|
id="signature-date"
|
||||||
@@ -1970,7 +1977,12 @@ const RoutesDashboard = () => {
|
|||||||
</>}
|
</>}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
{!isFutureScheduleSelected && <button className="btn btn-primary me-2" onClick={() => goToCreateRoute()}><Plus size={16}></Plus>Add New Route</button>}
|
{!isFutureScheduleSelected && AuthService.canAddOrEditRoutes() && (
|
||||||
|
<button className="btn btn-primary me-2" onClick={() => setIsScheduleEditMode((prev) => !prev)}>
|
||||||
|
{isScheduleEditMode ? 'Done Editing' : 'Edit Schedule'}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{!isFutureScheduleSelected && isScheduleEditMode && <button className="btn btn-primary me-2" onClick={() => goToCreateRoute()}><Plus size={16}></Plus>Add New Route</button>}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user