Remove hand written API objects.

This commit is contained in:
Dan Albert
2022-03-06 23:31:43 -08:00
parent 6ee235545f
commit 4b4336391a
22 changed files with 37 additions and 101 deletions

View File

@@ -1,4 +1,4 @@
import { Flight } from "../../api/flight";
import { Flight } from "../../api/liberationApi";
import { Icon, Point } from "leaflet";
import { Symbol } from "milsymbol";
import { Marker } from "react-leaflet";

View File

@@ -1,4 +1,4 @@
import Tgo from "../../api/tgo";
import { Tgo } from "../../api/liberationApi";
import { selectTgos } from "../../api/tgosSlice";
import { useAppSelector } from "../../app/hooks";
import { Circle, LayerGroup } from "react-leaflet";

View File

@@ -1,5 +1,5 @@
import backend from "../../api/backend";
import { ControlPoint as ControlPointModel } from "../../api/controlpoint";
import { ControlPoint as ControlPointModel } from "../../api/liberationApi";
import {
useClearControlPointDestinationMutation,
useSetControlPointDestinationMutation,
@@ -10,6 +10,7 @@ import {
Point,
Marker as LMarker,
Polyline as LPolyline,
LatLngLiteral,
} from "leaflet";
import { Symbol as MilSymbol } from "milsymbol";
import {
@@ -64,7 +65,7 @@ function formatLatLng(latLng: LatLng) {
function destinationTooltipText(
cp: ControlPointModel,
destinationish: LatLng,
destinationish: LatLngLiteral,
inRange: boolean
) {
const destination = new LatLng(destinationish.lat, destinationish.lng);
@@ -93,12 +94,12 @@ function PrimaryMarker(props: ControlPointProps) {
const [hasDestination, setHasDestination] = useState<boolean>(
props.controlPoint.destination != null
);
const [pathDestination, setPathDestination] = useState<LatLng>(
const [pathDestination, setPathDestination] = useState<LatLngLiteral>(
props.controlPoint.destination
? props.controlPoint.destination
: props.controlPoint.position
);
const [position, setPosition] = useState<LatLng>(
const [position, setPosition] = useState<LatLngLiteral>(
props.controlPoint.destination
? props.controlPoint.destination
: props.controlPoint.position
@@ -189,8 +190,7 @@ function PrimaryMarker(props: ControlPointProps) {
dragend: async (event) => {
const currentPosition = new LatLng(
pathDestination.lat,
pathDestination.lng,
pathDestination.alt
pathDestination.lng
);
const destination = event.target.getLatLng();
setDestination(destination);
@@ -225,7 +225,7 @@ function PrimaryMarker(props: ControlPointProps) {
interface SecondaryMarkerProps {
controlPoint: ControlPointModel;
destination: LatLng | null;
destination: LatLngLiteral | undefined;
}
function SecondaryMarker(props: SecondaryMarkerProps) {

View File

@@ -1,4 +1,4 @@
import { Flight } from "../../api/flight";
import { Flight } from "../../api/liberationApi";
import { useGetCommitBoundaryForFlightQuery } from "../../api/liberationApi";
import WaypointMarker from "../waypointmarker";
import { ReactElement } from "react";

View File

@@ -1,5 +1,5 @@
import { Flight } from "../../api/flight";
import { selectFlights, selectSelectedFlight } from "../../api/flightsSlice";
import { Flight } from "../../api/liberationApi";
import { useAppSelector } from "../../app/hooks";
import FlightPlan from "../flightplan";
import { LayerGroup } from "react-leaflet";

View File

@@ -1,4 +1,4 @@
import { FrontLine as FrontLineModel } from "../../api/frontline";
import { FrontLine as FrontLineModel } from "../../api/liberationApi";
import { Polyline } from "react-leaflet";
interface FrontLineProps {

View File

@@ -1,4 +1,4 @@
import { SupplyRoute as SupplyRouteModel } from "../../api/supplyroute";
import { SupplyRoute as SupplyRouteModel } from "../../api/liberationApi";
import SplitLines from "../splitlines/SplitLines";
import { Polyline as LPolyline } from "leaflet";
import { useEffect, useRef } from "react";

View File

@@ -2,7 +2,7 @@ import {
useOpenNewTgoPackageDialogMutation,
useOpenTgoInfoDialogMutation,
} from "../../api/liberationApi";
import { Tgo as TgoModel } from "../../api/tgo";
import { Tgo as TgoModel } from "../../api/liberationApi";
import SplitLines from "../splitlines/SplitLines";
import { Icon, Point } from "leaflet";
import { Symbol as MilSymbol } from "milsymbol";

View File

@@ -1,6 +1,6 @@
import backend from "../../api/backend";
import { Flight } from "../../api/flight";
import { Waypoint } from "../../api/waypoint";
import { Flight } from "../../api/liberationApi";
import { Waypoint } from "../../api/liberationApi";
import { Icon } from "leaflet";
import { Marker as LMarker } from "leaflet";
import icon from "leaflet/dist/images/marker-icon.png";