From dadb121bde26137eb1418fac79bc73798e0b2a91 Mon Sep 17 00:00:00 2001 From: Derick M <58572875+TurtIeSocks@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:48:14 -0400 Subject: [PATCH 1/3] feat: hybrid db setup --- client/src/assets/types.ts | 2 +- .../src/components/buttons/SaveToScanner.tsx | 10 +- .../components/dialogs/import/AssignStep.tsx | 27 ++--- .../components/dialogs/import/ImportStep.tsx | 2 +- client/src/components/drawer/Routing.tsx | 2 +- client/src/hooks/useStatic.ts | 3 +- .../pages/admin/geofence/GeofenceFilter.tsx | 2 +- .../src/pages/admin/geofence/GeofenceForm.tsx | 2 +- .../src/pages/admin/project/ProjectForm.tsx | 12 +- client/src/pages/admin/route/RouteFilter.tsx | 2 +- client/src/pages/admin/route/RouteForm.tsx | 2 +- client/src/pages/map/popups/Point.tsx | 6 +- client/src/pages/map/popups/Polygon.tsx | 6 +- client/src/services/utils.ts | 4 +- docker-compose.example.yml | 2 +- server/.env.example | 2 +- server/api/src/lib.rs | 12 +- server/api/src/private/admin.rs | 76 ++++++------- server/api/src/private/geofence_project.rs | 10 +- server/api/src/private/instance.rs | 58 +++------- server/api/src/private/misc.rs | 6 +- server/api/src/private/points.rs | 66 +++++------ server/api/src/public/v1/calculate.rs | 105 +++++++----------- server/api/src/public/v1/geofence.rs | 55 ++++----- server/api/src/public/v1/project.rs | 28 ++--- server/api/src/public/v1/route.rs | 36 +++--- server/api/src/utils/mod.rs | 36 +++--- server/api/src/utils/request.rs | 12 +- server/api/src/utils/response.rs | 2 +- server/model/src/lib.rs | 53 ++++++++- server/model/src/utils/mod.rs | 67 ++++++++--- 31 files changed, 346 insertions(+), 362 deletions(-) diff --git a/client/src/assets/types.ts b/client/src/assets/types.ts index 5507f810..9b03dbc6 100644 --- a/client/src/assets/types.ts +++ b/client/src/assets/types.ts @@ -211,7 +211,7 @@ export interface Config { start_lat: number start_lon: number tile_server: string - scanner_type: string + scanner_type: 'rdm' | 'unown' | 'hybrid' logged_in: boolean dangerous: boolean } diff --git a/client/src/components/buttons/SaveToScanner.tsx b/client/src/components/buttons/SaveToScanner.tsx index 1c29cff1..a537c93f 100644 --- a/client/src/components/buttons/SaveToScanner.tsx +++ b/client/src/components/buttons/SaveToScanner.tsx @@ -11,12 +11,12 @@ export default function SaveToScanner({ fc, ...rest }: Props) { const [loading, setLoading] = React.useState(false) return (