Merge branch 'auth_stuff' into staging_environment
This commit is contained in:
commit
49f1a4ea98
3 changed files with 35 additions and 6 deletions
|
|
@ -81,6 +81,7 @@ import GrainBagList from "grainBag/grainBagList";
|
|||
import BinYards from "bin/BinYards";
|
||||
import ButtonGroup from "common/ButtonGroup";
|
||||
import TeamDialog from "teams/TeamDialog";
|
||||
import { getContextKeys, getContextTypes } from "pbHelpers/Context";
|
||||
// import { useHistory } from "react-router";
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => {
|
||||
|
|
@ -311,6 +312,16 @@ export default function Bins(props: Props) {
|
|||
}
|
||||
}, [props.yardFilter]);
|
||||
|
||||
const getKeys = () => {
|
||||
if (as) return undefined
|
||||
return getContextKeys()
|
||||
}
|
||||
|
||||
const getTypes = () => {
|
||||
if (as) return undefined
|
||||
return getContextTypes()
|
||||
}
|
||||
|
||||
const loadBins = useCallback(() => {
|
||||
//let filter = grainFilter;
|
||||
let filter = yardFilter;
|
||||
|
|
@ -325,7 +336,7 @@ export default function Bins(props: Props) {
|
|||
setDisplayFert(false);
|
||||
|
||||
binAPI
|
||||
.listBinsAndData(binsLimit, 0, order, orderBy, filter, as, false)
|
||||
.listBinsAndData(binsLimit, 0, order, orderBy, filter, as, false, getKeys(), getTypes())
|
||||
.then(resp => {
|
||||
let grain: Bin[] = [];
|
||||
let empty: Bin[] = [];
|
||||
|
|
@ -623,8 +634,9 @@ export default function Bins(props: Props) {
|
|||
preLoadedData={paginatedBins.bins}
|
||||
rowClickFunction={data => {
|
||||
let bin = data as Bin;
|
||||
let path = "/bins/" + bin.key();
|
||||
navigate(path, { state: { bin: bin }});
|
||||
// let path = "bins/" + bin.key();
|
||||
// navigate(path, { state: { bin: bin }});
|
||||
navigate(bin.key(), { state: { bin: bin }, relative: "path"});
|
||||
}}
|
||||
customButtons={[
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue