write permission to the bin or team is required to make the transaction rows selectable
This commit is contained in:
parent
691b3be1f9
commit
216569b661
8 changed files with 121 additions and 27 deletions
|
|
@ -22,7 +22,7 @@ import GrainDescriber from "grain/GrainDescriber";
|
|||
import { Contract } from "models/Contract";
|
||||
import moment from "moment";
|
||||
import { pond } from "protobuf-ts/pond";
|
||||
import { useGlobalState, useTaskAPI, useContractAPI } from "providers";
|
||||
import { useGlobalState, useTaskAPI, useContractAPI, useSnackbar } from "providers";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { getGrainUnit } from "utils";
|
||||
|
||||
|
|
@ -63,6 +63,7 @@ export default function ContractSettings(props: Props) {
|
|||
const [deleteWindow, setDeleteWindow] = useState(false);
|
||||
const [createDeliveryTask, setCreateDeliveryTask] = useState(false);
|
||||
const [conversionValue, setConversionValue] = useState("1");
|
||||
const { openSnack } = useSnackbar()
|
||||
const [labels, setLabels] = useState<InputLabels>({
|
||||
sizeLabel: "Size",
|
||||
commodityLabel: "Commodity",
|
||||
|
|
@ -174,11 +175,14 @@ export default function ContractSettings(props: Props) {
|
|||
contractAPI
|
||||
.updateContract(contract.key(), name, settings, as)
|
||||
.then(resp => {
|
||||
console.log("Updated Contract");
|
||||
//console.log("Updated Contract");
|
||||
openSnack("Contract Updated")
|
||||
close();
|
||||
})
|
||||
.catch(err => {
|
||||
console.log("Error updating contract");
|
||||
//console.log("Error updating contract");
|
||||
openSnack("Error Updating Contract")
|
||||
|
||||
});
|
||||
} else {
|
||||
let settings: pond.ContractSettings = pond.ContractSettings.create();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue