From 2f2015ae0895caf542da7c1dda67a73a1b8c950b Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 5 May 2025 12:36:57 -0600 Subject: [PATCH 01/19] set up a way to adjust the threshold for auto lidar --- package-lock.json | 4 ++-- package.json | 2 +- src/bin/BinSettings.tsx | 46 +++++++++++++++++++++++++++++++++++------ 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 737cef9..2a011e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,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#dev", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#hybrid_inventory_control", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", "react-color": "^2.19.3", @@ -10993,7 +10993,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#738c7156ab9cfc46b3cf0b21d5e1a75b4f57d944", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#2a787ba3e5ba69f65fac49ba6120231edb565e47", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/package.json b/package.json index 1db2791..5e14239 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,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#dev", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#hybrid_inventory_control", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", "react-color": "^2.19.3", diff --git a/src/bin/BinSettings.tsx b/src/bin/BinSettings.tsx index b61bb2e..6ae61c2 100644 --- a/src/bin/BinSettings.tsx +++ b/src/bin/BinSettings.tsx @@ -183,6 +183,7 @@ export default function BinSettings(props: Props) { const [inMoistureString, setInMoistureString] = useState("0"); const [tMoistureString, setTMoistureString] = useState("0"); const [moistureTargetDeviation, setMoistureTargetDeviation] = useState("0"); + const [autoFillThreshold, setAutoFillThreshold] = useState(0); const [validInitial, setValidInitial] = useState(true); const [validTarget, setValidTarget] = useState(true); const [validDeviation, setValidDeviation] = useState(true); @@ -311,6 +312,7 @@ export default function BinSettings(props: Props) { setInMoistureString(initForm.inventory?.initialMoisture.toString() ?? "0"); setTMoistureString(initForm.inventory?.targetMoisture.toString() ?? "0"); setMoistureTargetDeviation(initForm.inventory?.moistureTargetDeviation.toString() ?? "0"); + setAutoFillThreshold(initForm.inventory?.autoThreshold ?? 0) setActiveStep(0); if (bin) { setAutoTopNode(bin.settings.autoGrainNode); @@ -405,7 +407,10 @@ export default function BinSettings(props: Props) { form.highTemp = highTempC; form.lowTemp = lowTempC; form.autoGrainNode = autoTopNode; - if (form.inventory) form.inventory.inventoryControl = inventoryControl; + if (form.inventory) { + form.inventory.inventoryControl = inventoryControl + form.inventory.autoThreshold = autoFillThreshold + } binAPI .addBin(form, as) @@ -449,7 +454,10 @@ export default function BinSettings(props: Props) { form.highTemp = highTempC; form.lowTemp = lowTempC; form.autoGrainNode = autoTopNode; - if (form.inventory) form.inventory.inventoryControl = inventoryControl; + if (form.inventory) { + form.inventory.inventoryControl = inventoryControl + form.inventory.autoThreshold = autoFillThreshold + } binAPI .updateBin(bin.key(), form, as) .then(response => { @@ -699,11 +707,14 @@ export default function BinSettings(props: Props) { }; const inventoryControlLabel = (control: pond.BinInventoryControl) => { - let string = "Manual"; - if (control === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC) { - string = "Auto"; + switch(control){ + case pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC_LIDAR: + return "Auto (lidar)" + case pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC: + return "Auto (cable)" + default: + return "Manual" } - return string; }; const inventoryForm = () => { @@ -819,6 +830,7 @@ export default function BinSettings(props: Props) { }> )} + {inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC_LIDAR && + + + % + + ) + }} + type="number" + value={autoFillThreshold} + onChange={e => { + setAutoFillThreshold(+e.target.value) + }} + /> + + } {empty ? ( From 78a5cfe089f0a69fe95bf73bf9a615d9e8278df8 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 20 May 2025 10:22:59 -0600 Subject: [PATCH 02/19] adding hybrid inventory control option --- src/bin/BinSettings.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/bin/BinSettings.tsx b/src/bin/BinSettings.tsx index 6ae61c2..8cc58a3 100644 --- a/src/bin/BinSettings.tsx +++ b/src/bin/BinSettings.tsx @@ -866,6 +866,11 @@ export default function BinSettings(props: Props) { control={} label={"Auto (Lidar)"} /> + } + label={"Hybrid (Lidar)"} + /> {inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC && @@ -876,7 +881,15 @@ export default function BinSettings(props: Props) { )} - {inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC_LIDAR && + {inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_HYBRID_LIDAR && ( + + + Hybrid control will submit a transaction that must be approved by the user before inventory is changed + + + )} + {(inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_AUTOMATIC_LIDAR || + inventoryControl === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_HYBRID_LIDAR) && Date: Wed, 21 May 2025 10:24:05 -0600 Subject: [PATCH 03/19] fixed the drawer on the docs page being in front of the header --- src/pages/APIDocs.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/APIDocs.tsx b/src/pages/APIDocs.tsx index bbc37df..0055cdf 100644 --- a/src/pages/APIDocs.tsx +++ b/src/pages/APIDocs.tsx @@ -24,8 +24,7 @@ const useStyles = makeStyles((theme: Theme) => ({ }, drawer: { width: drawerWidth, - flexShrink: 0, - zIndex: 10 + zIndex: "10 !important" }, drawerPaper: { width: drawerWidth From 554fd0c228a4f00936b8e046a41d04ebef6bbcf6 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Thu, 22 May 2025 13:16:47 -0600 Subject: [PATCH 04/19] added bintransactions component and function for the transaction api to get transaction involving a given object --- package-lock.json | 2 +- src/bin/BinTransactions.tsx | 24 +++++++++++++++++ src/pages/Bin.tsx | 10 ++++++- src/providers/pond/transactionAPI.tsx | 39 +++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 src/bin/BinTransactions.tsx diff --git a/package-lock.json b/package-lock.json index d31fc4d..4be6ab6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10864,7 +10864,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#ed840d3bdb39b1d1bfeb0edbc4404354709f0dfa", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#786abf5b2b15501ee3afb7c3d60c638dc4cc9851", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/src/bin/BinTransactions.tsx b/src/bin/BinTransactions.tsx new file mode 100644 index 0000000..0be3adf --- /dev/null +++ b/src/bin/BinTransactions.tsx @@ -0,0 +1,24 @@ +import { Box } from "@mui/material"; +import { Bin } from "models"; +import { pond } from "protobuf-ts/pond"; +import { useEffect, useState } from "react"; + +interface Props { + bin: Bin +} + +export default function BinTransactions(props: Props){ + const { bin } = props + const [state, setState] = useState(pond.TransactionState.TRANSACTION_STATE_PENDING) + + useEffect(()=>{ + // load transactions for bin with matching state (pending is default) + + },[state, bin]) + + return ( + + {/* */} + + ) +} \ No newline at end of file diff --git a/src/pages/Bin.tsx b/src/pages/Bin.tsx index 114ea0e..caddeea 100644 --- a/src/pages/Bin.tsx +++ b/src/pages/Bin.tsx @@ -67,6 +67,7 @@ import { useNavigate, useParams } from "react-router-dom"; import { Controller } from "models/Controller"; import TaskViewer from "tasks/TaskViewer"; import ButtonGroup from "common/ButtonGroup"; +import BinTransactions from "bin/BinTransactions"; interface TabPanelProps { children?: React.ReactNode; @@ -195,7 +196,7 @@ export default function Bin(props: Props) { const [heaters, setHeaters] = useState([]); const [fans, setFans] = useState([]); const [detail, setDetail] = useState< - "inventory" | "sensors" | "analytics" | "presets" | "alerts" + "inventory" | "sensors" | "analytics" | "presets" | "alerts" | "transactions" >("inventory"); const [mobileTab, setMobileTab] = useState(0); const componentAPI = useComponentAPI(); @@ -886,6 +887,10 @@ export default function Bin(props: Props) { { title: "Presets", function: () => setDetail("presets") + }, + { + title: "Transactions", + function: () => setDetail("transactions") } ]} /> @@ -963,6 +968,9 @@ export default function Bin(props: Props) { compositionNameMap={compositionNameMap} /> )} + {detail === "transactions" && + + } diff --git a/src/providers/pond/transactionAPI.tsx b/src/providers/pond/transactionAPI.tsx index 7b9c671..635b063 100644 --- a/src/providers/pond/transactionAPI.tsx +++ b/src/providers/pond/transactionAPI.tsx @@ -4,6 +4,7 @@ import { pond } from "protobuf-ts/pond"; import { pondURL } from "./pond"; import { AxiosResponse } from "axios"; import { useGlobalState } from "providers"; +import { or } from "utils"; export interface ITransactionAPIContext { addTransaction: ( @@ -25,6 +26,14 @@ export interface ITransactionAPIContext { toKey?: string, otherTeam?: string ) => Promise>; + listTransactionsFor: ( + limit: number, + offset: number, + order: "asc" | "desc", + objectKey: string, + state?: pond.TransactionState, + otherTeam?: string + ) => Promise> revokeTransaction: (key: string, otherTeam?: string) => Promise>; updateTransaction: ( key: string, @@ -88,6 +97,35 @@ export default function TransactionProvider(props: PropsWithChildren) { ); }; + const listTransactionsFor = ( + limit: number, + offset: number, + order: "asc" | "desc", + objectKey: string, + state?: pond.TransactionState, + otherTeam?: string + ) => { + const view = otherTeam ? otherTeam : as + const url = "/transactionsFor" + + "?limit=" + + limit + + "&offset=" + + offset + + ("&order=" + or(order, "asc")) + + "&object=" + objectKey + + (state ? "&state=" + state : "") + + (view ? "&as=" + view : "") + + return new Promise>((resolve, reject)=>{ + get(pondURL(url)).then(resp => { + resp.data = pond.ListTransactionsForResponse.fromObject(resp.data) + return resolve(resp) + }).catch(err => { + return reject(err) + }) + }) + } + const updateTransaction = (key: string, data: pond.TransactionData, otherTeam?: string) => { const view = otherTeam ? otherTeam : as if (view) @@ -125,6 +163,7 @@ export default function TransactionProvider(props: PropsWithChildren) { value={{ addTransaction, listTransactions, + listTransactionsFor, updateTransaction, transactionPageData, revokeTransaction From 3f33a7dd412015970597134b232f9b000578fac4 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Thu, 22 May 2025 14:59:34 -0600 Subject: [PATCH 05/19] transaction load test --- src/bin/BinTransactions.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/BinTransactions.tsx b/src/bin/BinTransactions.tsx index 0be3adf..9087e8e 100644 --- a/src/bin/BinTransactions.tsx +++ b/src/bin/BinTransactions.tsx @@ -1,6 +1,7 @@ import { Box } from "@mui/material"; import { Bin } from "models"; import { pond } from "protobuf-ts/pond"; +import { useTransactionAPI } from "providers"; import { useEffect, useState } from "react"; interface Props { @@ -10,10 +11,13 @@ interface Props { export default function BinTransactions(props: Props){ const { bin } = props const [state, setState] = useState(pond.TransactionState.TRANSACTION_STATE_PENDING) + const transactionAPI = useTransactionAPI() useEffect(()=>{ // load transactions for bin with matching state (pending is default) - + transactionAPI.listTransactionsFor(10, 0, "asc", bin.key()).then(resp => { + console.log(resp) + }) },[state, bin]) return ( From 9bacaa12d90dbf1a323447d4e143b3ee14d43192 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Fri, 23 May 2025 11:07:34 -0600 Subject: [PATCH 06/19] starting table --- src/bin/BinTransactions.tsx | 25 ++++++++++++++++++++----- src/bin/graphs/BinGraphs.tsx | 4 +++- src/bin/graphs/BinWaterLevel.tsx | 14 +++++++++----- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/bin/BinTransactions.tsx b/src/bin/BinTransactions.tsx index 9087e8e..3c7bf49 100644 --- a/src/bin/BinTransactions.tsx +++ b/src/bin/BinTransactions.tsx @@ -1,8 +1,10 @@ import { Box } from "@mui/material"; +import ResponsiveTable from "common/ResponsiveTable"; import { Bin } from "models"; +import { Transaction } from "models/Transaction"; import { pond } from "protobuf-ts/pond"; import { useTransactionAPI } from "providers"; -import { useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; interface Props { bin: Bin @@ -12,17 +14,30 @@ export default function BinTransactions(props: Props){ const { bin } = props const [state, setState] = useState(pond.TransactionState.TRANSACTION_STATE_PENDING) const transactionAPI = useTransactionAPI() - - useEffect(()=>{ + const [transactions, setTransactions] = useState([]) + + const load = useCallback(()=>{ // load transactions for bin with matching state (pending is default) - transactionAPI.listTransactionsFor(10, 0, "asc", bin.key()).then(resp => { + transactionAPI.listTransactionsFor(10, 0, "asc", bin.key(), state).then(resp => { console.log(resp) }) },[state, bin]) + + useEffect(()=>{ + load() + },[state, bin, load]) + + // dialog for approving a transaction return ( - {/* */} + {/* dropdown for transaction state */} + + {/* table to display transactions */} + {/* + + rows={transactions} + /> */} ) } \ No newline at end of file diff --git a/src/bin/graphs/BinGraphs.tsx b/src/bin/graphs/BinGraphs.tsx index 861994d..326d744 100644 --- a/src/bin/graphs/BinGraphs.tsx +++ b/src/bin/graphs/BinGraphs.tsx @@ -285,7 +285,9 @@ export default function BinGraphs(props: Props) { From 219967ac53b0f1bd8db46d6d9e99559b339992e2 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 27 May 2025 10:38:42 -0600 Subject: [PATCH 07/19] proto update --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 4be6ab6..d9db3c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10864,7 +10864,7 @@ }, "node_modules/protobuf-ts": { "version": "1.0.0", - "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#786abf5b2b15501ee3afb7c3d60c638dc4cc9851", + "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#6bf3baa3e9db19f0d7031dda1c3045f6f64c515b", "dependencies": { "protobufjs": "^6.8.8" } From 86ecb593db860d56640cf1dfe5e3171c8ceaa819 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 28 May 2025 13:19:44 -0600 Subject: [PATCH 08/19] fixed the positioning of the word "shape" in the settings --- src/bin/BinSettings.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/BinSettings.tsx b/src/bin/BinSettings.tsx index 8cc58a3..832c39b 100644 --- a/src/bin/BinSettings.tsx +++ b/src/bin/BinSettings.tsx @@ -1834,8 +1834,9 @@ export default function BinSettings(props: Props) { - - Shape} padding={1}> + + {/* Shape} padding={1}> */} + Shape ))} - + {/* */} Aeration effectiveness varies with bin shape From fffa8edc465858f46a8d99c9480c6075daf2e44e Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 28 May 2025 13:20:07 -0600 Subject: [PATCH 09/19] changed the search to be a partial search rather than exact match --- src/cableEstimator/cableEstimator.tsx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/cableEstimator/cableEstimator.tsx b/src/cableEstimator/cableEstimator.tsx index 960e06a..95c7634 100644 --- a/src/cableEstimator/cableEstimator.tsx +++ b/src/cableEstimator/cableEstimator.tsx @@ -184,16 +184,18 @@ export default function CableEstimator() { if(tableSearch !== ""){ //filter the data in the cloned list clone = clone.filter(bin => { - if(tableSearch.toLowerCase() === bin.Manufacturer.toLowerCase()) return true - if(tableSearch.toLowerCase() === bin.Model.toLowerCase()) return true - if(tableSearch.toLowerCase() === bin.Capacity.toString().toLowerCase()) return true - if(tableSearch.toLowerCase() === bin.HopperAngle.toString().toLowerCase()) return true - if(tableSearch.toLowerCase() === bin.Diameter.toString().toLowerCase()) return true - if(tableSearch.toLowerCase() === bin.Sidewall.toString().toLowerCase()) return true - if(tableSearch.toLowerCase() === bin.Peak.toString().toLowerCase()) return true - if(tableSearch.toLowerCase() === bin.EaveToPeak.toString().toLowerCase()) return true - if(tableSearch.toLowerCase() === bin.RoofAngle.toString().toLowerCase()) return true - if(tableSearch.toLowerCase() === bin.Rings.toString().toLowerCase()) return true + //doing a partial search so if any string contains the search string it will return true + const lowerSearch = tableSearch.toLowerCase() + if(bin.Manufacturer.toLocaleLowerCase().includes(lowerSearch)) return true + if(bin.Model.toLowerCase().includes(lowerSearch)) return true + if(bin.Capacity.toString().toLowerCase().includes(lowerSearch)) return true + if(bin.HopperAngle.toString().toLowerCase().includes(lowerSearch)) return true + if(bin.Diameter.toString().toLowerCase().includes(lowerSearch)) return true + if(bin.Sidewall.toString().toLowerCase().includes(lowerSearch)) return true + if(bin.Peak.toString().toLowerCase().includes(lowerSearch)) return true + if(bin.EaveToPeak.toString().toLowerCase().includes(lowerSearch)) return true + if(bin.RoofAngle.toString().toLowerCase().includes(lowerSearch)) return true + if(bin.Rings.toString().toLowerCase().includes(lowerSearch)) return true return false }) } From 49bd146de65b4e090dd5bf8857dd390dc3359efb Mon Sep 17 00:00:00 2001 From: csawatzky Date: Thu, 29 May 2025 16:55:28 -0600 Subject: [PATCH 10/19] finished putting in the table and the dropdowns and the loading of stuff when it is needed --- src/bin/BinTransactions.tsx | 342 ++++++++++++++++++++++++++++++++++-- src/pages/Bin.tsx | 8 +- 2 files changed, 331 insertions(+), 19 deletions(-) diff --git a/src/bin/BinTransactions.tsx b/src/bin/BinTransactions.tsx index 3c7bf49..ba551b1 100644 --- a/src/bin/BinTransactions.tsx +++ b/src/bin/BinTransactions.tsx @@ -1,10 +1,19 @@ -import { Box } from "@mui/material"; +import { Autocomplete, Box, Button, Card, DialogActions, DialogContent, DialogTitle, TextField, Typography } from "@mui/material"; +import ResponsiveDialog from "common/ResponsiveDialog"; import ResponsiveTable from "common/ResponsiveTable"; -import { Bin } from "models"; +import { Option } from "common/SearchSelect"; +import GrainDescriber from "grain/GrainDescriber"; +import { cloneDeep } from "lodash"; +import { Bin, Contract, Field, GrainBag } from "models"; import { Transaction } from "models/Transaction"; +import moment from "moment"; +import ObjectDescriber from "objects/ObjectDescriber"; import { pond } from "protobuf-ts/pond"; -import { useTransactionAPI } from "providers"; +import { useBinAPI, useContractAPI, useFieldAPI, useGrainBagAPI, useTransactionAPI } from "providers"; +import React from "react"; import { useCallback, useEffect, useState } from "react"; +import TransactionDataDisplay from "transactions/transactionDataDisplay"; +import { getGrainUnit } from "utils"; interface Props { bin: Bin @@ -12,32 +21,331 @@ interface Props { export default function BinTransactions(props: Props){ const { bin } = props - const [state, setState] = useState(pond.TransactionState.TRANSACTION_STATE_PENDING) + const [state, setState] = useState(pond.TransactionState.TRANSACTION_STATE_APPROVAL_REQUIRED) const transactionAPI = useTransactionAPI() + const binAPI = useBinAPI() + const grainBagAPI = useGrainBagAPI() + const fieldAPI = useFieldAPI() + const contractAPI = useContractAPI() const [transactions, setTransactions] = useState([]) + const [possibleTransactionMatches, setPossibleTransactionMatches] = useState([]) + const [tablePage, setTablePage] = useState(0) + const [tablePageSize, setTablePageSize] = useState(10) + const [total, setTotal] = useState(0) - const load = useCallback(()=>{ - // load transactions for bin with matching state (pending is default) - transactionAPI.listTransactionsFor(10, 0, "asc", bin.key(), state).then(resp => { - console.log(resp) + const [binOptions, setBinOptions] = useState([]) + + const [grainBagOptions, setGrainBagOptions] = useState([]) + + const [fieldOptions, setFieldOptions] = useState([]) + + const [contractOptions, setContractOptions] = useState([]) + + const [openDialog, setOpenDialog] = useState(false) + const [objectNames, setObjectNames] = useState(new Map()) + const [selectedTransaction, setSelectedTransaction] = useState() + const [selectedMatch, setselectedMatch] = useState() + + const [fromType, setFromType] = useState(pond.ObjectType.OBJECT_TYPE_UNKNOWN) + const [fromOption, setFromOption] = useState