Merge branch 'main' into CEC-5542
This commit is contained in:
12
package-lock.json
generated
12
package-lock.json
generated
@@ -7362,9 +7362,9 @@
|
|||||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
||||||
},
|
},
|
||||||
"node_modules/ejs": {
|
"node_modules/ejs": {
|
||||||
"version": "3.1.9",
|
"version": "3.1.10",
|
||||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz",
|
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
|
||||||
"integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==",
|
"integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jake": "^10.8.5"
|
"jake": "^10.8.5"
|
||||||
},
|
},
|
||||||
@@ -22471,9 +22471,9 @@
|
|||||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
||||||
},
|
},
|
||||||
"ejs": {
|
"ejs": {
|
||||||
"version": "3.1.9",
|
"version": "3.1.10",
|
||||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz",
|
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
|
||||||
"integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==",
|
"integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"jake": "^10.8.5"
|
"jake": "^10.8.5"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,7 +214,6 @@ const MainForm = ({ name }) => {
|
|||||||
selectCount={selected.length}
|
selectCount={selected.length}
|
||||||
rowCount={fleetVehicles.length}
|
rowCount={fleetVehicles.length}
|
||||||
/>
|
/>
|
||||||
<VehicleProvider>
|
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{fleetVehicles && fleetVehicles.map((car) => {
|
{fleetVehicles && fleetVehicles.map((car) => {
|
||||||
const isSelected = selected.includes(car.vin);
|
const isSelected = selected.includes(car.vin);
|
||||||
@@ -260,7 +259,6 @@ const MainForm = ({ name }) => {
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</VehicleProvider>
|
|
||||||
<TableFooter>
|
<TableFooter>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TablePagination
|
<TablePagination
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import { Link } from "react-router-dom";
|
|||||||
import Chip from '@mui/material/Chip';
|
import Chip from '@mui/material/Chip';
|
||||||
import Stack from '@mui/material/Stack';
|
import Stack from '@mui/material/Stack';
|
||||||
import ConnectedIcon from "../Controls/ConnectedIcon";
|
import ConnectedIcon from "../Controls/ConnectedIcon";
|
||||||
import { useVehicleContext } from "../Contexts/VehicleContext";
|
|
||||||
import useStyles from "../useStyles";
|
import useStyles from "../useStyles";
|
||||||
import { useIntersectObserver } from "../../hooks";
|
import { useIntersectObserver } from "../../hooks";
|
||||||
|
import api from "../../services/vehiclesAPI";
|
||||||
|
|
||||||
// Prevent fetching missing data by not including `token` prop
|
// Prevent fetching missing data by not including `token` prop
|
||||||
|
|
||||||
@@ -13,8 +13,7 @@ export function VehicleTeaserController(props) {
|
|||||||
const el = useRef(null);
|
const el = useRef(null);
|
||||||
const isVisible = useIntersectObserver(el, "0px", true);
|
const isVisible = useIntersectObserver(el, "0px", true);
|
||||||
const [isMissingData, setIsMissingData] = useState(false);
|
const [isMissingData, setIsMissingData] = useState(false);
|
||||||
|
const [vehicle, setVehicle] = useState({});
|
||||||
const { getVehicle, vehicle } = useVehicleContext();
|
|
||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
@@ -26,7 +25,9 @@ export function VehicleTeaserController(props) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isVisible && props.token) {
|
if (isVisible && props.token) {
|
||||||
getVehicle(props.vin, props.token)
|
api.getVehicle(props.vin, props.token)
|
||||||
|
.then(setVehicle)
|
||||||
|
.catch(() => setVehicle({}));
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [isMissingData, isVisible, props.vin, props.token]);
|
}, [isMissingData, isVisible, props.vin, props.token]);
|
||||||
|
|||||||
Reference in New Issue
Block a user