From 914985517ce5f82e5358f58c9d1f55ac4815a42f Mon Sep 17 00:00:00 2001 From: Lixian Zhou Date: Mon, 9 Mar 2026 12:31:10 -0400 Subject: [PATCH] cicd --- .DS_Store | Bin 18436 -> 18436 bytes .gitea/workflows/deploy-main.yml | 101 ++++++++++++++++++ app/.DS_Store | Bin 28676 -> 28676 bytes .../trans-routes/PersonnelInfoTable.js | 12 ++- .../trans-routes/PersonnelSection.js | 4 +- .../trans-routes/RouteCustomerEditor.js | 18 +++- .../src/components/trans-routes/RouteView.js | 20 +++- 7 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 .gitea/workflows/deploy-main.yml diff --git a/.DS_Store b/.DS_Store index bc6562e2b5bd3a7d1bff59652c99b233e77aa6d5..58f0955b4bce326e937a3f4514ceef992614f960 100644 GIT binary patch delta 69 zcmZpfz}PZ@aRa-Sh^3){j)Ix7S*?yjwWSe|ZDM3N`GSJ+W0RXDN B5={UA delta 54 zcmV-60LlM^-~oi-0kFs*2stn@EFd#DIFlh4KeG=ZZZDJ9K)tg$QHlnWKsG?L1X#5Y MlZr~avvf(21{IhS_W%F@ diff --git a/client/src/components/trans-routes/PersonnelInfoTable.js b/client/src/components/trans-routes/PersonnelInfoTable.js index fe42a56..5beb3e3 100644 --- a/client/src/components/trans-routes/PersonnelInfoTable.js +++ b/client/src/components/trans-routes/PersonnelInfoTable.js @@ -15,7 +15,8 @@ const PersonnelInfoTable = ({transRoutes, showCompletedInfo, driverName, vehicle, relatedOutbound, vehicles, isInbound, deleteFile, keyword, statusFilter, customerNameFilter, - customerTableId, routeTypeFilter, customerTypeFilter + customerTableId, routeTypeFilter, customerTypeFilter, + onRouteUpdated = null }) => { const [show, setShow] = useState(false); const [showGroupEditor, setShowGroupEditor] = useState(false); @@ -223,6 +224,9 @@ const PersonnelInfoTable = ({transRoutes, showCompletedInfo, if (dateStr !== '' && dateStr !== moment().format('MM/DD/YYYY')) { finalParams = Object.assign({}, finalParams, {dateText: dateStr}) } + if (onRouteUpdated) { + finalParams = Object.assign({}, finalParams, {callback: onRouteUpdated}) + } dispatch(updateRoute(finalParams)); // if (removeSignature && deleteFile) { // deleteFile(); @@ -276,6 +280,9 @@ const PersonnelInfoTable = ({transRoutes, showCompletedInfo, if (dateStr !== '' && dateStr !== moment().format('MM/DD/YYYY')) { finalParams = Object.assign({}, finalParams, {dateText: dateStr}) } + if (onRouteUpdated) { + finalParams = Object.assign({}, finalParams, {callback: onRouteUpdated}) + } dispatch(updateRoute(finalParams)); // if (removeSignature && deleteFile) { // deleteFile(); @@ -628,6 +635,9 @@ const PersonnelInfoTable = ({transRoutes, showCompletedInfo, if (dateStr !== '' && dateStr !== moment().format('MM/DD/YYYY')) { finalParams = Object.assign({}, finalParams, {dateText: dateStr}) } + if (onRouteUpdated) { + finalParams = Object.assign({}, finalParams, {callback: onRouteUpdated}) + } // Log final payload before dispatch, especially for Wang,Huanran const wangCustomer = finalParams.data.route_customer_list?.find(c => diff --git a/client/src/components/trans-routes/PersonnelSection.js b/client/src/components/trans-routes/PersonnelSection.js index 9706da4..09ae70c 100644 --- a/client/src/components/trans-routes/PersonnelSection.js +++ b/client/src/components/trans-routes/PersonnelSection.js @@ -5,7 +5,8 @@ const PersonnelSection = ({transRoutes, sectionName, showCompletedInfo, showGroupInfo, allowForceEdit, showFilter, driverName, vehicle, relatedOutbound, vehicles, isInbound, deleteFile, keyword, - statusFilter, customerTypeFilter, customerNameFilter, customerTableId, routeTypeFilter + statusFilter, customerTypeFilter, customerNameFilter, customerTableId, routeTypeFilter, + onRouteUpdated = null }) => { return ( <> @@ -21,6 +22,7 @@ const PersonnelSection = ({transRoutes, sectionName, showCompletedInfo, customerNameFilter={customerNameFilter} customerTable={customerTableId} routeTypeFilter={routeTypeFilter} + onRouteUpdated={onRouteUpdated} /> diff --git a/client/src/components/trans-routes/RouteCustomerEditor.js b/client/src/components/trans-routes/RouteCustomerEditor.js index 7d2c231..59b31af 100644 --- a/client/src/components/trans-routes/RouteCustomerEditor.js +++ b/client/src/components/trans-routes/RouteCustomerEditor.js @@ -16,11 +16,13 @@ const ItemTypes = { const Card = ({ content, index, moveCard }) => { const ref = useRef(null); - const [{ handlerId }, drop] = useDrop({ + const [{ handlerId, isOver, draggedIndex }, drop] = useDrop({ accept: ItemTypes.CARD, collect(monitor) { return { handlerId: monitor.getHandlerId(), + isOver: monitor.isOver({ shallow: true }), + draggedIndex: monitor.getItem()?.index, } }, drop(item, monitor) { @@ -72,9 +74,21 @@ const Card = ({ content, index, moveCard }) => { }), }) const opacity = isDragging ? 0 : 1 + const showDropTopIndicator = isOver && draggedIndex !== undefined && draggedIndex > index; + const showDropBottomIndicator = isOver && draggedIndex !== undefined && draggedIndex < index; + const dropZoneStyle = { + opacity, + paddingTop: '10px', + paddingBottom: '10px', + borderRadius: '8px', + backgroundColor: isOver ? '#eef6ff' : 'transparent', + borderTop: showDropTopIndicator ? '4px solid #0d6efd' : '4px solid transparent', + borderBottom: showDropBottomIndicator ? '4px solid #0d6efd' : '4px solid transparent', + transition: 'background-color 0.12s ease, border-color 0.12s ease' + }; drag(drop(ref)) return ( -
+
{content}
) diff --git a/client/src/components/trans-routes/RouteView.js b/client/src/components/trans-routes/RouteView.js index bca8d41..93d6fbc 100644 --- a/client/src/components/trans-routes/RouteView.js +++ b/client/src/components/trans-routes/RouteView.js @@ -26,6 +26,7 @@ const RouteView = () => { const [signatureRequest, setSignatureRequest] = useState(undefined); const [routeStatusValue, setRouteStatusValue] = useState(''); const [isSavingRouteStatus, setIsSavingRouteStatus] = useState(false); + const [latestRouteForStatus, setLatestRouteForStatus] = useState(undefined); const paramsQuery = new URLSearchParams(window.location.search); const scheduleDate = paramsQuery.get('dateSchedule'); @@ -40,6 +41,7 @@ const RouteView = () => { { value: ROUTE_STATUS.SIGN_OFF, label: 'Signed Off' }, { value: ROUTE_STATUS.UNEXPECTED_ABSENT, label: 'Unexpected Absent' }, ]; + const routeForStatusView = latestRouteForStatus || currentRoute; const closeModal = () => { setShowVehicleDetails(false); } @@ -109,11 +111,27 @@ const RouteView = () => { } }; + const refreshRouteStatusData = async () => { + if (!currentRoute?.id) return; + try { + const response = await TransRoutesService.getRoute(currentRoute.id); + if (response?.data) { + setLatestRouteForStatus(response.data); + } + } catch (error) { + console.error('Error refreshing route status data:', error); + } + }; + useEffect(() => { const currentStatus = Array.isArray(currentRoute?.status) ? currentRoute.status[0] : ''; setRouteStatusValue(currentStatus || ''); }, [currentRoute?.id, currentRoute?.status]); + useEffect(() => { + setLatestRouteForStatus(undefined); + }, [currentRoute?.id]); + useEffect(() => { if (!currentRoute?.driver || currentDriver?.id) { setFallbackDriver(undefined); @@ -268,7 +286,7 @@ const RouteView = () => {
- {currentRoute && } + {routeForStatusView && }