making sure the bin uses the correct data when using libracart as an inventory control
This commit is contained in:
parent
e5300b19f4
commit
3e6185be8f
8 changed files with 115 additions and 69 deletions
|
|
@ -1,7 +1,4 @@
|
|||
import {
|
||||
Accordion,
|
||||
AccordionDetails,
|
||||
AccordionSummary,
|
||||
Box,
|
||||
Button,
|
||||
Checkbox,
|
||||
|
|
@ -10,7 +7,6 @@ import {
|
|||
MenuItem,
|
||||
Select
|
||||
} from "@mui/material";
|
||||
import { ExpandMore } from "@mui/icons-material";
|
||||
import LibraCartAccess from "integrations/LibraCart/LibraCartAccess";
|
||||
import { pond } from "protobuf-ts/pond";
|
||||
import { useGlobalState } from "providers";
|
||||
|
|
@ -22,7 +18,6 @@ export default function LibraCart() {
|
|||
const [currentOrg, setCurrentOrg] = useState("");
|
||||
const libracartAPI = useLibraCartProxyAPI();
|
||||
const [organizations, setOrganizations] = useState<Map<string, pond.LibraCartAccount>>(new Map());
|
||||
const [fieldAccordion, setFieldAccordion] = useState(false);
|
||||
const [dataOptions, setDataOptions] = useState<pond.DataOption[]>([]);
|
||||
const [{ as }] = useGlobalState();
|
||||
|
||||
|
|
@ -32,9 +27,10 @@ export default function LibraCart() {
|
|||
libracartAPI
|
||||
.listAccounts(0, 0, as)
|
||||
.then(resp => {
|
||||
let tempOrgs: Map<string, pond.JDAccount> = new Map();
|
||||
let tempOrgs: Map<string, pond.LibraCartAccount> = new Map();
|
||||
console.log(resp)
|
||||
resp.data.accounts.forEach(org => {
|
||||
let organization = pond.JDAccount.fromObject(org);
|
||||
let organization = pond.LibraCartAccount.fromObject(org);
|
||||
tempOrgs.set(organization.key, organization);
|
||||
});
|
||||
setOrganizations(tempOrgs);
|
||||
|
|
@ -73,34 +69,25 @@ export default function LibraCart() {
|
|||
const fieldOptions = () => {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Accordion
|
||||
expanded={fieldAccordion}
|
||||
onChange={(_, expanded) => {
|
||||
setFieldAccordion(expanded);
|
||||
}}>
|
||||
<AccordionSummary expandIcon={<ExpandMore />}>Field Data</AccordionSummary>
|
||||
<AccordionDetails>
|
||||
<Grid container direction="row" spacing={2} alignItems="center" alignContent="center">
|
||||
<Grid size={6}>
|
||||
<FormControlLabel
|
||||
label="Field Boundaries"
|
||||
label="Destinations"
|
||||
control={
|
||||
<Checkbox
|
||||
checked={dataOptions.includes(pond.DataOption.DATA_OPTION_FIELDS)}
|
||||
checked={dataOptions.includes(pond.DataOption.DATA_OPTION_DESTINATIONS)}
|
||||
onChange={(_, checked) => {
|
||||
//setFields(!fields);
|
||||
updateOrgData(checked, pond.DataOption.DATA_OPTION_FIELDS);
|
||||
updateOrgData(checked, pond.DataOption.DATA_OPTION_DESTINATIONS);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid size={6}>
|
||||
View your data from Libra Cart on your visual Farm
|
||||
Import your destinations for the option to link it to a bin
|
||||
</Grid>
|
||||
</Grid>
|
||||
</AccordionDetails>
|
||||
</Accordion>
|
||||
</React.Fragment>
|
||||
);
|
||||
};
|
||||
|
|
@ -117,7 +104,7 @@ export default function LibraCart() {
|
|||
<Grid>
|
||||
<Select
|
||||
//style={{ maxWidth: 110 }}
|
||||
title="John Deer Account"
|
||||
title="LibraCart Account"
|
||||
displayEmpty
|
||||
disableUnderline={true}
|
||||
value={currentOrg}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue