fixed the temp and humidity on the bin cards in the drawer on the map, also fixed the drawer loading bins not in the yard

This commit is contained in:
csawatzky 2025-05-08 15:56:38 -06:00
parent 5f9d39e26d
commit 446147d4d5
4 changed files with 9 additions and 18 deletions

View file

@ -832,7 +832,6 @@ export default function BinSVGV2(props: Props) {
cableGrainEndY = cableGrainStartY;
}
if (cableEstimate && cables.length > 0 && cableGrainPathPoints.length === cables.length) {
console.log("calc cable path");
let cablePath = cableGrainEstimate(
cableGrainPathPoints,
spacingX,

View file

@ -123,10 +123,11 @@ export default function BinyardDisplay(props: Props) {
});
const loadBins = useCallback(() => {
setBinsLoading(true);
if (yardKey === "") return
//load the bins based on the yard key
setBinsLoading(true);
binAPI
.listBinsAndData(maxBins, 0, "asc", "name", undefined, as, undefined, [yardKey], ["binyard"])
.listBinsAndData(maxBins, 0, "asc", "name", undefined, undefined, undefined, [yardKey], ["binyard"])
.then(resp => {
let yardBins: Bin[] = [];
let grainBins: Bin[] = [];
@ -315,17 +316,10 @@ export default function BinyardDisplay(props: Props) {
<Grid size={12}>
<BinsList
gridView
valDisplay="average"
bins={grainBins}
duplicateBin={duplicateBin}
title={"Grain Bins"}
// because this only triggers in scroll view it is no longer necessary as we dont do the scroll here
// loadMore={newTranslation => {
// //only triggered in the scroll view so this will never trigger in grid view
// if (yardBins.length < binTotal) {
// loadMoreBins(contentFilter);
// setScrollTranslations({ ...scrollTranslations, bins: newTranslation });
// }
// }}
/>
</Grid>
</React.Fragment>
@ -338,16 +332,10 @@ export default function BinyardDisplay(props: Props) {
<Grid size={12}>
<BinsList
gridView
valDisplay="average"
bins={fertBins}
duplicateBin={duplicateBin}
title={"Fertilizer Bins"}
// loadMore={newTranslation => {
// //only triggered in the scroll view so this will never trigger in grid view
// if (yardBins.length < binTotal) {
// loadMoreBins(contentFilter);
// setScrollTranslations({ ...scrollTranslations, fertilizer: newTranslation });
// }
// }}
/>
</Grid>
</React.Fragment>
@ -360,6 +348,7 @@ export default function BinyardDisplay(props: Props) {
<Grid size={12}>
<BinsList
gridView
valDisplay="average"
bins={emptyBins}
duplicateBin={duplicateBin}
title={"Empty Bins"}

View file

@ -85,6 +85,7 @@ export default function BinYardDrawer(props: Props) {
const drawerBody = () => {
//return <Bins insert yardFilter={yard.key} />;
console.log(yard.key)
return <BinyardDisplay insert yardKey={yard.key} />;
};

View file

@ -388,6 +388,8 @@ export default function BinProvider(props: PropsWithChildren<Props>) {
(keys ? "&keys=" + keys.join(",") : "") +
(types ? "&types=" + types.join(",") : "")
console.log(url)
return new Promise<AxiosResponse<pond.ListBinsAndDataResponse>>((resolve, reject)=>{
get<pond.ListBinsAndDataResponse>(pondURL(url)).then(resp => {
resp.data = pond.ListBinsAndDataResponse.fromObject(resp.data)