added the cable estimator and the pdf stuff that goes with it

This commit is contained in:
csawatzky 2025-04-09 14:49:04 -06:00
parent 9074120f74
commit e039a75bf8
26 changed files with 3157 additions and 24 deletions

View file

@ -19,6 +19,8 @@ import Heaters from "pages/Heaters";
import Heater from "pages/Heater";
import Tasks from "pages/Tasks";
import Transactions from "pages/Transactions";
import BinCableEstimator from "pages/BinCableEstimator";
import { useGlobalState } from "providers";
//import Site from "pages/Site";
const DeviceHistory = lazy(() => import("pages/DeviceHistory"));
@ -48,6 +50,7 @@ export default function Router(props: Props) {
const { toggleTheme } = props;
const { isAuthenticated, loginWithRedirect, isLoading } = useAuth0();
const whiteLabel = getWhitelabel();
const [{ user }] = useGlobalState();
const RelativeRoutes = () => {
return (
@ -303,6 +306,9 @@ export default function Router(props: Props) {
<Route path="users" element={<Users/>} />
<Route path="tasks" element={<Tasks />} />
<Route path="transactions" element={<Transactions />} />
{user.hasFeature("installer") &&
<Route path="cableEstimate" element={<BinCableEstimator />} />
}
{/* Map pages */}
<Route path="visualFarm" element={<FieldMap />} />

View file

@ -40,6 +40,7 @@ import JobsiteIcon from "products/Construction/JobSiteIcon";
import { getThemeType } from "theme";
import ObjectHeaterIcon from "products/Construction/ObjectHeaterIcon";
import TasksIcon from "products/Construction/TasksIcon";
import CableIcon from "products/Bindapt/CableIcon";
const drawerWidth = 230;
@ -321,6 +322,20 @@ export default function SideNavigator(props: Props) {
{open && <ListItemText primary="Transactions" />}
</ListItemButton>
</Tooltip>
{(user.hasFeature("installer") && isAg || user.hasFeature("admin")) &&
<Tooltip title="Cable Estimator" placement="right">
<ListItemButton
id="tour-cable-estimator"
onClick={() => goTo("/cableEstimate")}
classes={getClasses("/cableEstimate")}
>
<ListItemIcon>
<CableIcon />
</ListItemIcon>
{open && <ListItemText primary="Cable Estimator" />}
</ListItemButton>
</Tooltip>
}
</List>
)
}