some hotfixes for construction so that the url navigation is correct when clicking on a card and an undefined error when loading heater data
This commit is contained in:
parent
d9bcd07c8d
commit
4342e1f27b
4 changed files with 7 additions and 12 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -10953,7 +10953,7 @@
|
||||||
},
|
},
|
||||||
"node_modules/protobuf-ts": {
|
"node_modules/protobuf-ts": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#c08965a296f2cd0799472fd8b163186cf6885d4c",
|
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#a646dbd472f266154f8c5f44146e0b27ccdda28f",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protobufjs": "^6.8.8"
|
"protobufjs": "^6.8.8"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import { pond } from "protobuf-ts/pond";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { makeStyles } from "@mui/styles";
|
import { makeStyles } from "@mui/styles";
|
||||||
import { useGlobalState } from "providers";
|
import { useGlobalState } from "providers";
|
||||||
|
import { getContextKeys, getContextTypes } from "pbHelpers/Context";
|
||||||
|
|
||||||
interface TabPanelProps {
|
interface TabPanelProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
|
@ -116,13 +117,7 @@ export default function DeviceLinkDrawer(props: Props) {
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
true,
|
true
|
||||||
undefined,
|
|
||||||
undefined,
|
|
||||||
undefined,
|
|
||||||
undefined,
|
|
||||||
undefined,
|
|
||||||
as
|
|
||||||
)
|
)
|
||||||
.then(resp => {
|
.then(resp => {
|
||||||
let devMap = new Map<string, pond.ComprehensiveDevice>();
|
let devMap = new Map<string, pond.ComprehensiveDevice>();
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ export default function ObjectHeaterCard(props: Props) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (heaterData.devices[0]) {
|
if (heaterData.devices && heaterData.devices[0]) {
|
||||||
setConnectedDevice(Device.any(heaterData.devices[0].device));
|
setConnectedDevice(Device.any(heaterData.devices[0].device));
|
||||||
heaterData.devices[0].components.forEach(c => {
|
heaterData.devices[0].components.forEach(c => {
|
||||||
//loop through the components and assign them accordingly
|
//loop through the components and assign them accordingly
|
||||||
|
|
@ -171,7 +171,7 @@ export default function ObjectHeaterCard(props: Props) {
|
||||||
|
|
||||||
const goToHeater = () => {
|
const goToHeater = () => {
|
||||||
//history.push("/objectHeaters/" + heater.key);
|
//history.push("/objectHeaters/" + heater.key);
|
||||||
let path = "/objectHeaters/" + heater.key;
|
let path = "/heaters/" + heater.key;
|
||||||
navigate(path, { state: {heater: heater} });
|
navigate(path, { state: {heater: heater} });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ export default function Site() {
|
||||||
siteAPI
|
siteAPI
|
||||||
.getSitePage(siteKey, as)
|
.getSitePage(siteKey, as)
|
||||||
.then(resp => {
|
.then(resp => {
|
||||||
setSite(ISite.any(resp.data.site));
|
if(resp.data.site) setSite(ISite.any(resp.data.site));
|
||||||
setHeaters(resp.data.heaterData);
|
if(resp.data.heaterData) setHeaters(resp.data.heaterData);
|
||||||
setLoadingSite(false);
|
setLoadingSite(false);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue