diff --git a/package.json b/package.json index 58206d8394..5d73df1481 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "react-plotly.js": "^2.6.0", "react-redux": "^7.2.0", "react-router": "^5.3.4", - "react-router-dom": "^5.2.0", + "react-router-dom": "^5.3.4", "react-router-hash-link": "^2.3.1", "react-select": "^5.10.2", "react-simple-maps": "^3.0.0", diff --git a/src/components/BMDashboard/Equipment/DailyActivityLog/EDailyActivityLog.jsx b/src/components/BMDashboard/Equipment/DailyActivityLog/EDailyActivityLog.jsx index e060548463..d2be4c5cc0 100644 --- a/src/components/BMDashboard/Equipment/DailyActivityLog/EDailyActivityLog.jsx +++ b/src/components/BMDashboard/Equipment/DailyActivityLog/EDailyActivityLog.jsx @@ -3,7 +3,7 @@ import { connect, useDispatch, useSelector } from 'react-redux'; import { Button, Table, Spinner, UncontrolledTooltip } from 'reactstrap'; import Select from 'react-select'; import { toast } from 'react-toastify'; - +import { useHistory } from 'react-router-dom'; import { fetchBMProjects } from '~/actions/bmdashboard/projectActions'; import { fetchAllEquipments, @@ -148,6 +148,7 @@ function EDailyActivityLog(props) { const hasNoEquipments = isMissingProject || rows.length === 0; const noEquipmentSelected = rows.length === 0 || rows.every(r => r.selectedNumbers.length === 0); const isSubmitDisabled = isMissingProject || isInvalidDate || noEquipmentSelected; + const history = useHistory(); useEffect(() => { dispatch(fetchBMProjects()); @@ -241,6 +242,10 @@ function EDailyActivityLog(props) { } }; + const goToPurchaseEquipment = () => { + history.push('/bmdashboard/equipment/purchase'); + }; + const projectSelectStyles = getSelectStyles(darkMode, false); const tableSelectStyles = getSelectStyles(darkMode, true); @@ -441,62 +446,60 @@ function EDailyActivityLog(props) { - + {!selectedProject && ( +
Select a project to load equipments.
+ )} + {selectedProject && rows.length === 0 && ( +
+
No equipment is currently assigned to this project
+
Select different project from the above section
+
OR
+
+ +
+
+ )} {/* Table */} - - - - - - - - - - - - {!selectedProject && ( - - - - )} - - {selectedProject && rows.length === 0 && ( - - + {selectedProject && rows.length > 0 && ( +
Name - Working - - - Total number of units operational today - - - Available - - - Number of units currently not in use - - - Using - - - Quantity being checked in/out - - - Tool / Equipment # - - - Select the specific tool identifier - -
- Select a project to load equipments. -
- No equipments found for this project. -
+ + + + + + + - )} - - {selectedProject && - rows.length > 0 && - rows.map((r, idx) => { + + + {rows.map((r, idx) => { const validList = logType === 'check-in' ? r.inUseNumbers : r.availableNumbers; const limit = logType === 'check-in' ? r.usingQty : r.availableQty; @@ -524,8 +527,9 @@ function EDailyActivityLog(props) { ); })} - -
Name + Working + + + Total number of units operational today + + + Available + + + Number of units currently not in use + + + Using + + + Quantity being checked in/out + + + Tool / Equipment # + + + Select the specific tool identifier + +
+ + + )}