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": {
|
"node_modules/protobuf-ts": {
|
||||||
"version": "1.0.0",
|
"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": {
|
"dependencies": {
|
||||||
"protobufjs": "^6.8.8"
|
"protobufjs": "^6.8.8"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,7 @@ export default function ComponentForm(props: Props) {
|
||||||
let minimum = min ?? 0;
|
let minimum = min ?? 0;
|
||||||
let maximum = max ?? 100;
|
let maximum = max ?? 100;
|
||||||
if (compMode && form.component.settings.calibrate) {
|
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));
|
return !isNaN(Number(form.offset));
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,7 @@ export default function MapBase(props: Props) {
|
||||||
homeMarkerAPI
|
homeMarkerAPI
|
||||||
.listHomeMarkers(1, 0, undefined, undefined, undefined, undefined, as)
|
.listHomeMarkers(1, 0, undefined, undefined, undefined, undefined, as)
|
||||||
.then(resp => {
|
.then(resp => {
|
||||||
if (resp.data.homeMarker === undefined) {
|
if (!resp.data.homeMarker || resp.data.homeMarker.length < 1) {
|
||||||
setHomePin(undefined);
|
setHomePin(undefined);
|
||||||
setHaveHome(false);
|
setHaveHome(false);
|
||||||
setStartingView(props.currentView);
|
setStartingView(props.currentView);
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,7 @@ export default function AviationMapController(props: Props) {
|
||||||
let terminalMarkers: Map<string, MarkerData> = new Map();
|
let terminalMarkers: Map<string, MarkerData> = new Map();
|
||||||
let terminalOps: Terminal[] = [];
|
let terminalOps: Terminal[] = [];
|
||||||
let searchEntries: Result[] = [];
|
let searchEntries: Result[] = [];
|
||||||
|
if(resp.data.terminals){
|
||||||
resp.data.terminals.forEach(term => {
|
resp.data.terminals.forEach(term => {
|
||||||
let terminal = Terminal.create(term);
|
let terminal = Terminal.create(term);
|
||||||
terminalMap.set(terminal.key, terminal);
|
terminalMap.set(terminal.key, terminal);
|
||||||
|
|
@ -207,6 +208,7 @@ export default function AviationMapController(props: Props) {
|
||||||
terminalOps.push(terminal);
|
terminalOps.push(terminal);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
setTerminals(terminalMap);
|
setTerminals(terminalMap);
|
||||||
setTerminalMarkers(terminalMarkers);
|
setTerminalMarkers(terminalMarkers);
|
||||||
setTerminalSearchEntries(searchEntries);
|
setTerminalSearchEntries(searchEntries);
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,7 @@ export default function ConstructionMapController(props: Props) {
|
||||||
siteAPI
|
siteAPI
|
||||||
.listSitesPageData(50, 0, "asc", "key", undefined, as)
|
.listSitesPageData(50, 0, "asc", "key", undefined, as)
|
||||||
.then(resp => {
|
.then(resp => {
|
||||||
|
if(resp.data.sites){
|
||||||
resp.data.sites.forEach(site => {
|
resp.data.sites.forEach(site => {
|
||||||
if (!site) return;
|
if (!site) return;
|
||||||
let newSite: Site = Site.any(site.site);
|
let newSite: Site = Site.any(site.site);
|
||||||
|
|
@ -179,6 +180,7 @@ export default function ConstructionMapController(props: Props) {
|
||||||
place_type: ["site"]
|
place_type: ["site"]
|
||||||
} as Result);
|
} as Result);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
setSiteMarkerData(sm);
|
setSiteMarkerData(sm);
|
||||||
setSites(s);
|
setSites(s);
|
||||||
setLoadingSites(false);
|
setLoadingSites(false);
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,9 @@ export default function Terminals(props: Props) {
|
||||||
if(loading) return
|
if(loading) return
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
terminalAPI.listTerminals(200, 0, "asc", "name", as).then(resp => {
|
terminalAPI.listTerminals(200, 0, "asc", "name", as).then(resp => {
|
||||||
|
if(resp.data.terminals){
|
||||||
setTerminals(resp.data.terminals.map(a => Terminal.any(a)));
|
setTerminals(resp.data.terminals.map(a => Terminal.any(a)));
|
||||||
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log("There was a problem loading Terminals")
|
console.log("There was a problem loading Terminals")
|
||||||
}).finally(() => {
|
}).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 ResponsiveDialog from "common/ResponsiveDialog"
|
||||||
|
import { Gate } from "models/Gate"
|
||||||
|
import { pond } from "protobuf-ts/pond"
|
||||||
import { useGateAPI } from "providers"
|
import { useGateAPI } from "providers"
|
||||||
import React, { useEffect } from "react"
|
import React, { useEffect, useState } from "react"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open: boolean
|
open: boolean
|
||||||
|
|
@ -12,18 +14,25 @@ interface Props {
|
||||||
export default function GateReports(props: Props){
|
export default function GateReports(props: Props){
|
||||||
const {gate, open, onClose} = props
|
const {gate, open, onClose} = props
|
||||||
const gateAPI = useGateAPI()
|
const gateAPI = useGateAPI()
|
||||||
|
const [allGates, setAllGates] = useState<Gate[]>([])
|
||||||
|
const [reportData, setReportData] = useState<pond.GateReportData[]>([])
|
||||||
|
|
||||||
//load all of the gates for the user/team
|
//load all of the gates for the user/team
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(gate) return //if there was a gate passed in we dont need to load them
|
if(gate) return //if there was a gate passed in we dont need to load them
|
||||||
|
if(open){
|
||||||
gateAPI.listGates(0, 0).then(resp => {
|
gateAPI.listGates(0, 0).then(resp => {
|
||||||
console.log(resp.data)
|
console.log(resp.data)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|
||||||
})
|
})
|
||||||
},[gate])
|
}
|
||||||
|
},[gate, open])
|
||||||
|
|
||||||
//selection table to select which gates to generate a report
|
//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
|
* 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>
|
||||||
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions></DialogActions>
|
<DialogActions>
|
||||||
|
<Button>Close</Button>
|
||||||
|
<Button>Generate Reports</Button>
|
||||||
|
</DialogActions>
|
||||||
</ResponsiveDialog>
|
</ResponsiveDialog>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue