diff --git a/package-lock.json b/package-lock.json index eb7d904..fe947bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#staging", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", @@ -10911,7 +10911,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#0b7dd45fa720d6c3f20ac7bafac4a3f0bdbc7ab6", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#0cdf4d5e3038ef13318da0841886a7c9f0926f8d", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/package.json b/package.json index fc7a1ac..ee0e9b7 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "mui-tel-input": "^7.0.0", "notistack": "^3.0.1", "openweathermap-ts": "^1.2.10", - "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#staging", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#master", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", diff --git a/src/app/UserWrapper.tsx b/src/app/UserWrapper.tsx index 722705e..cb4cdf8 100644 --- a/src/app/UserWrapper.tsx +++ b/src/app/UserWrapper.tsx @@ -82,7 +82,20 @@ export default function UserWrapper(props: Props) { firmware: new Map() }) }).catch(() => { - setGlobal(globalDefault) + userAPI.getUser(user_id).then(user => { + setGlobal({ + user: user ? user : User.create(), + team: globalDefault.team, + as: "", + showErrors: false, + userTeamPermissions: [], + backgroundTasksComplete: false, + firmware: new Map() + }) + }).catch(() => { + setGlobal(globalDefault) + }) + }) .finally(() => { setLoading(false) diff --git a/src/bin/BinCardV2.tsx b/src/bin/BinCardV2.tsx index 35fcd12..683e598 100644 --- a/src/bin/BinCardV2.tsx +++ b/src/bin/BinCardV2.tsx @@ -490,7 +490,7 @@ export default function BinCard(props: Props) { return ( - {user.hasFeature("admin") && ( + {user.hasFeature("installer") && ( UnitMeasurement.create(m, user)) + lastMeasurement.map(m => UnitMeasurement.create(m, user)) )} /> } diff --git a/src/common/ResponsiveTable.tsx b/src/common/ResponsiveTable.tsx index 79238ea..ef99665 100644 --- a/src/common/ResponsiveTable.tsx +++ b/src/common/ResponsiveTable.tsx @@ -59,7 +59,7 @@ const useStyles = makeStyles((theme: Theme) => { }, stickyHeader: { position: "sticky", - // backgroundColor: getThemeType() === "light" ? "rgb(245, 245, 245)" : "rgb(40, 40, 40)", + backgroundColor: getThemeType() === "light" ? "rgb(245, 245, 245)" : "rgb(40, 40, 40)", top: 0, zIndex: 300 //giving a really high z-index to make sure nothing is in front of it } diff --git a/src/grain/GrainDescriber.ts b/src/grain/GrainDescriber.ts index ce394b3..c140a85 100644 --- a/src/grain/GrainDescriber.ts +++ b/src/grain/GrainDescriber.ts @@ -190,7 +190,7 @@ export const GrainExtensions: Map = new Map([ [ pond.Grain.GRAIN_OATS, { - name: "Oats", + name: "Oats a", group: "Oats", equation: Equation.henderson, a: 0.000085511, @@ -203,6 +203,40 @@ export const GrainExtensions: Map = new Map([ weightConversionKg: 15.4222988297197, bushelsPerTonne: 64.842 } + ], + [ + pond.Grain.GRAIN_OATS_B, + { + name: "Oats b", + group: "Oats", + equation: Equation.chungPfost, + a: 442.85, + b: 0.21228, + c: 35.803, + setTempC: 32.0, + targetMC: 13.6, + img: OatImg, + colour: "#79955a", + weightConversionKg: 15.4222988297197, + bushelsPerTonne: 64.842 + } + ], + [ + pond.Grain.GRAIN_OATS_C, + { + name: "Oats c", + group: "Oats", + equation: Equation.oswin, + a: 12.412, + b: -0.060707, + c: 2.9397, + setTempC: 32.0, + targetMC: 13.6, + img: OatImg, + colour: "#79955a", + weightConversionKg: 15.4222988297197, + bushelsPerTonne: 64.842 + } ], [ pond.Grain.GRAIN_PEANUTS, diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx index 7721ec1..673f097 100644 --- a/src/pages/Devices.tsx +++ b/src/pages/Devices.tsx @@ -472,7 +472,7 @@ export default function Devices() { ] if (hasPlenums) { columns.push({ - title: "Plenum", + title: "Temp/Humidity", // sortKey: "hi", // disableSort: true, render: (device: Device) => {