Merge branch 'master' into mipca_reports
This commit is contained in:
commit
bbdf40df47
8 changed files with 32 additions and 14 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -10911,7 +10911,7 @@
|
|||
},
|
||||
"node_modules/protobuf-ts": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#4aa7c4efefa38e86c21ec08cddcbd7f789b38464",
|
||||
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#90d01d04404d6b38d3200634e194c17bae8a0737",
|
||||
"dependencies": {
|
||||
"protobufjs": "^6.8.8"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ export default function ComponentForm(props: Props) {
|
|||
let minimum = min ?? 0;
|
||||
let maximum = max ?? 100;
|
||||
if (compMode && form.component.settings.calibrate) {
|
||||
return Number(form.offset) <= maximum && Number(form.offset) > minimum;
|
||||
return Number(form.offset) <= maximum && Number(form.offset) >= minimum;
|
||||
}
|
||||
return !isNaN(Number(form.offset));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ export default function MapBase(props: Props) {
|
|||
homeMarkerAPI
|
||||
.listHomeMarkers(1, 0, undefined, undefined, undefined, undefined, as)
|
||||
.then(resp => {
|
||||
if (resp.data.homeMarker === undefined) {
|
||||
if (!resp.data.homeMarker || resp.data.homeMarker.length < 1) {
|
||||
setHomePin(undefined);
|
||||
setHaveHome(false);
|
||||
setStartingView(props.currentView);
|
||||
|
|
|
|||
|
|
@ -769,7 +769,7 @@ import { Result } from "@mapbox/mapbox-gl-geocoder";
|
|||
});
|
||||
setAnchorFieldMarker(event.currentTarget);
|
||||
setFMIndexKey(index);
|
||||
setObjectKey(fm.key());
|
||||
setObjectKey(fm.key());
|
||||
}
|
||||
});
|
||||
searchEntries.push({
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ export default function AviationMapController(props: Props) {
|
|||
let terminalMarkers: Map<string, MarkerData> = new Map();
|
||||
let terminalOps: Terminal[] = [];
|
||||
let searchEntries: Result[] = [];
|
||||
if(resp.data.terminals){
|
||||
resp.data.terminals.forEach(term => {
|
||||
let terminal = Terminal.create(term);
|
||||
terminalMap.set(terminal.key, terminal);
|
||||
|
|
@ -207,6 +208,7 @@ export default function AviationMapController(props: Props) {
|
|||
terminalOps.push(terminal);
|
||||
}
|
||||
});
|
||||
}
|
||||
setTerminals(terminalMap);
|
||||
setTerminalMarkers(terminalMarkers);
|
||||
setTerminalSearchEntries(searchEntries);
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ export default function ConstructionMapController(props: Props) {
|
|||
siteAPI
|
||||
.listSitesPageData(50, 0, "asc", "key", undefined, as)
|
||||
.then(resp => {
|
||||
if(resp.data.sites){
|
||||
resp.data.sites.forEach(site => {
|
||||
if (!site) return;
|
||||
let newSite: Site = Site.any(site.site);
|
||||
|
|
@ -179,6 +180,7 @@ export default function ConstructionMapController(props: Props) {
|
|||
place_type: ["site"]
|
||||
} as Result);
|
||||
});
|
||||
}
|
||||
setSiteMarkerData(sm);
|
||||
setSites(s);
|
||||
setLoadingSites(false);
|
||||
|
|
|
|||
|
|
@ -182,7 +182,9 @@ export default function Terminals(props: Props) {
|
|||
if(loading) return
|
||||
setLoading(true)
|
||||
terminalAPI.listTerminals(200, 0, "asc", "name", as).then(resp => {
|
||||
setTerminals(resp.data.terminals.map(a => Terminal.any(a)));
|
||||
if(resp.data.terminals){
|
||||
setTerminals(resp.data.terminals.map(a => Terminal.any(a)));
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log("There was a problem loading Terminals")
|
||||
}).finally(() => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import { DialogActions, DialogContent, DialogTitle } from "@mui/material"
|
||||
import { Button, DialogActions, DialogContent, DialogTitle } from "@mui/material"
|
||||
import ResponsiveDialog from "common/ResponsiveDialog"
|
||||
import { Gate } from "models/Gate"
|
||||
import { pond } from "protobuf-ts/pond"
|
||||
import { useGateAPI } from "providers"
|
||||
import React, { useEffect } from "react"
|
||||
import React, { useEffect, useState } from "react"
|
||||
|
||||
interface Props {
|
||||
open: boolean
|
||||
|
|
@ -12,18 +14,25 @@ interface Props {
|
|||
export default function GateReports(props: Props){
|
||||
const {gate, open, onClose} = props
|
||||
const gateAPI = useGateAPI()
|
||||
const [allGates, setAllGates] = useState<Gate[]>([])
|
||||
const [reportData, setReportData] = useState<pond.GateReportData[]>([])
|
||||
|
||||
//load all of the gates for the user/team
|
||||
useEffect(()=>{
|
||||
if(gate) return //if there was a gate passed in we dont need to load them
|
||||
gateAPI.listGates(0, 0).then(resp => {
|
||||
console.log(resp.data)
|
||||
}).catch(err => {
|
||||
|
||||
})
|
||||
},[gate])
|
||||
if(open){
|
||||
gateAPI.listGates(0, 0).then(resp => {
|
||||
console.log(resp.data)
|
||||
}).catch(err => {
|
||||
|
||||
})
|
||||
}
|
||||
},[gate, open])
|
||||
|
||||
//selection table to select which gates to generate a report
|
||||
const gateTable = () => {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* new api call for gates that takes in an array of gate keys to build the report data for
|
||||
|
|
@ -37,7 +46,10 @@ export default function GateReports(props: Props){
|
|||
<DialogContent>
|
||||
|
||||
</DialogContent>
|
||||
<DialogActions></DialogActions>
|
||||
<DialogActions>
|
||||
<Button>Close</Button>
|
||||
<Button>Generate Reports</Button>
|
||||
</DialogActions>
|
||||
</ResponsiveDialog>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue