Skip to content

Commit

Permalink
use drizzle instead of prisma (#228)
Browse files Browse the repository at this point in the history
* use drizzle instead of prisma

* update workflow

* add custom migrations for extensions

* query only devices without sensors

* add materialized views

* update deviceInfo, deviceLocation, profile visibility

* getDevicesWithSensors

* fix donut-charts

* fix: filter exposure, status

* fix: undo getDevicesWithSensors, because too slow

* Feat/drizzle initial load workaround (#273)

* Consolidate settings and dashboard pages (#211)

* remove old account/setting page

* bug fix: open nested pages within an outlet

* move 'my devices dashboard' to profile + update styles

* hide device id and update dashboard style

* add navbar to device overview and tranfer pages

* some updates

* make settings->profile as  a defualt page

* add header to navbar

* bug fix: selecting route that is already selected from sidebar

* separate sidebarNav from sidebarSettingsNav

* update dark mode style

* some updates

* update sidebar (dark mode)

* Bump @vitest/coverage-v8 from 0.34.5 to 0.34.6 (#224)

Bumps [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) from 0.34.5 to 0.34.6.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.34.6/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump i18next-http-backend from 2.2.0 to 2.3.1 (#229)

Bumps [i18next-http-backend](https://github.com/i18next/i18next-http-backend) from 2.2.0 to 2.3.1.
- [Changelog](https://github.com/i18next/i18next-http-backend/blob/master/CHANGELOG.md)
- [Commits](i18next/i18next-http-backend@v2.2.0...v2.3.1)

---
updated-dependencies:
- dependency-name: i18next-http-backend
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @testing-library/cypress from 9.0.0 to 10.0.1 (#230)

Bumps [@testing-library/cypress](https://github.com/kentcdodds/cypress-testing-library) from 9.0.0 to 10.0.1.
- [Release notes](https://github.com/kentcdodds/cypress-testing-library/releases)
- [Changelog](https://github.com/testing-library/cypress-testing-library/blob/main/CHANGELOG.md)
- [Commits](testing-library/cypress-testing-library@v9.0.0...v10.0.1)

---
updated-dependencies:
- dependency-name: "@testing-library/cypress"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @types/geojson from 7946.0.10 to 7946.0.12 (#232)

Bumps [@types/geojson](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/geojson) from 7946.0.10 to 7946.0.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/geojson)

---
updated-dependencies:
- dependency-name: "@types/geojson"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump react-day-picker from 8.9.0 to 8.9.1 (#231)

Bumps [react-day-picker](https://github.com/gpbl/react-day-picker) from 8.9.0 to 8.9.1.
- [Release notes](https://github.com/gpbl/react-day-picker/releases)
- [Commits](gpbl/react-day-picker@v8.9.0...v8.9.1)

---
updated-dependencies:
- dependency-name: react-day-picker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor filters (#227)

* start refactoring

* fix TypeScript error

* Bump @conform-to/react from 0.9.0 to 0.9.1 (#236)

Bumps [@conform-to/react](https://github.com/edmundhung/conform/tree/HEAD/packages/conform-react) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/edmundhung/conform/releases)
- [Commits](https://github.com/edmundhung/conform/commits/v0.9.1/packages/conform-react)

---
updated-dependencies:
- dependency-name: "@conform-to/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @radix-ui/react-alert-dialog from 1.0.4 to 1.0.5 (#233)

* Bump @radix-ui/react-alert-dialog from 1.0.4 to 1.0.5

Bumps [@radix-ui/react-alert-dialog](https://github.com/radix-ui/primitives) from 1.0.4 to 1.0.5.
- [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md)
- [Commits](https://github.com/radix-ui/primitives/commits)

---
updated-dependencies:
- dependency-name: "@radix-ui/react-alert-dialog"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix TS error

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: freds-dev <[email protected]>

* Feat/mqtt check connection (#209)

* mqtt check url connection

* some updates

* show success msg after connection with mqtt url

* update getting mqtt url value

* update mqtt naming

* update check mqtt conn. to accept mqtt/mqtts

* rename dashboard page

* update `package-lock.json`

---------

Co-authored-by: freds-dev <[email protected]>

* Bump @hookform/resolvers from 3.3.1 to 3.3.2 (#241)

Bumps [@hookform/resolvers](https://github.com/react-hook-form/resolvers) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/react-hook-form/resolvers/releases)
- [Commits](react-hook-form/resolvers@v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: "@hookform/resolvers"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump lucide-react from 0.263.1 to 0.293.0 (#240)

Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.263.1 to 0.293.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.293.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cypress from 13.3.1 to 13.6.0 (#244)

Bumps [cypress](https://github.com/cypress-io/cypress) from 13.3.1 to 13.6.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v13.3.1...v13.6.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump clsx from 1.2.1 to 2.0.0 (#243)

Bumps [clsx](https://github.com/lukeed/clsx) from 1.2.1 to 2.0.0.
- [Release notes](https://github.com/lukeed/clsx/releases)
- [Commits](lukeed/clsx@v1.2.1...v2.0.0)

---
updated-dependencies:
- dependency-name: clsx
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cookie from 0.5.0 to 0.6.0 (#246)

Bumps [cookie](https://github.com/jshttp/cookie) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Changelog](https://github.com/jshttp/cookie/blob/master/HISTORY.md)
- [Commits](jshttp/cookie@v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cypress from 13.6.0 to 13.6.1 (#247)

Bumps [cypress](https://github.com/cypress-io/cypress) from 13.6.0 to 13.6.1.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v13.6.0...v13.6.1)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix lint errors

* comment out devicesDashboard for now and ugly fixes to make ts happy

* lint error

* remove duplicate package

* Bump prettier from 3.0.3 to 3.1.1 (#250)

Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.0.3...3.1.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump prettier-plugin-tailwindcss from 0.5.4 to 0.5.11 (#253)

Bumps [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) from 0.5.4 to 0.5.11.
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](tailwindlabs/prettier-plugin-tailwindcss@v0.5.4...v0.5.11)

---
updated-dependencies:
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* distinguish request with/without phenomenon

* update drizzle-orm version

* update `drizzle-kit` to latest

* deploy all PR images

* change Dockerfile from prisma to drizzle

* try to fix build

* revert Dockerfile changes

* edit Dockerfile for drizzle orm

* seed database

* seed database

* remove seed script

* fix(drizzle): set `SSL` option on postgres client (#276)

* fix: set SSL property in env file

* add missing env module

* fix typeof `PG_CLIENT_SSL`

* remove migration from Dockerfile

* TS type error fix

---------

Co-authored-by: freds-dev <[email protected]>

* pretty `MyDevice` section

* fix badges on profile page

* fix profile image related things

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Yousef Qamaz <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jona159 <[email protected]>
Co-authored-by: Matthias Pfeil <[email protected]>

* remove prisma fragment

* debugging logs

* remove logs

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: jona159 <[email protected]>
Co-authored-by: Fred <[email protected]>
Co-authored-by: Yousef Qamaz <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: freds-dev <[email protected]>
  • Loading branch information
6 people authored Mar 18, 2024
1 parent 5c486b9 commit 573363b
Show file tree
Hide file tree
Showing 102 changed files with 16,335 additions and 13,342 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
# SHADOW_DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"

PG_CLIENT_SSL="false"

SESSION_SECRET="super-duper-s3cret"

MAPBOX_ACCESS_TOKEN=""
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
max_attempts: 5
retry_wait_seconds: 45
retry_on: error
command: npx prisma migrate reset --force
command: npm run drizzle:migrate

- name: ⚙️ Build
run: npm run build
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ node_modules
/pgdata

/app/styles/**/*.css

measurements.csv
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ FROM base as build
WORKDIR /myapp

COPY --from=deps /myapp/node_modules /myapp/node_modules

ADD prisma .
RUN npx prisma generate

ADD . .

RUN npm run drizzle:generate
#RUN npm run drizzle:migrate
RUN npm run build

# Finally, build the production image with minimal footprint
Expand All @@ -43,10 +42,10 @@ FROM base
WORKDIR /myapp

COPY --from=production-deps /myapp/node_modules /myapp/node_modules
COPY --from=build /myapp/node_modules/.prisma /myapp/node_modules/.prisma
#COPY --from=build /myapp/node_modules/.prisma /myapp/node_modules/.prisma

COPY --from=build /myapp/build /myapp/build
COPY --from=build /myapp/public /myapp/public
ADD . .

CMD ["npm", "start"]
CMD ["npm", "start"]
2 changes: 1 addition & 1 deletion app/components/device-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
CardHeader,
CardTitle,
} from "./ui/card";
import type { Device } from "@prisma/client";
import type { Device } from "~/schema";

interface DeviceCardProps {
device: Device;
Expand Down
8 changes: 4 additions & 4 deletions app/components/device-detail/device-detail-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import {
useSubmit,
} from "@remix-run/react";
import Graph from "./graph";
import type { Prisma, Sensor } from "@prisma/client";
import type { DeviceWithSensors } from "types";
import type { LastMeasurement } from "types";
import Spinner from "../spinner";
import {
Accordion,
Expand Down Expand Up @@ -55,14 +54,15 @@ import { useBetween } from "use-between";
import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
import { isMobile, isTablet, isBrowser } from "react-device-detect";
import { Label } from "../ui/label";
import type { Device, Sensor } from "~/schema";

export interface LastMeasurementProps {
time: Date;
value: string;
}

export interface DeviceAndSelectedSensors {
device: DeviceWithSensors;
device: Device;
selectedSensors: Sensor[];
}

Expand Down Expand Up @@ -264,7 +264,7 @@ export default function DeviceDetailBox() {
{data.sensors.map((sensor: Sensor) => {
// dont really know why this is necessary - some kind of TypeScript/i18n bug?
const lastMeasurement =
sensor.lastMeasurement as Prisma.JsonObject;
sensor.lastMeasurement as LastMeasurement;
const value = lastMeasurement
? (lastMeasurement.value as string)
: undefined;
Expand Down
77 changes: 3 additions & 74 deletions app/components/header/nav-bar/filter-options/filter-options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ import { useEffect, useState } from "react";
import { Button } from "~/components/ui/button";
import { Label } from "~/components/ui/label";
import Spinner from "../../../spinner";
import { Separator } from "~/components/ui/separator";
import type { loader } from "~/routes/explore";

export default function FilterOptions() {
const data = useLoaderData<typeof loader>();
//* searchParams hook
const [searchParams, setSearchParams] = useSearchParams();
const navigation = useNavigation();
// To show more phenomena options
const [seeMorePhenomena, setSeeMorePhenomena] = useState(false);

//* Set initial filter params based on url Search Params
const [exposureVal, setExposureVal] = useState(
Expand All @@ -33,7 +30,7 @@ export default function FilterOptions() {
const [statusVal, setStatusVal] = useState(
searchParams.get("status") ?? null,
);
const [phenomenonVal, setPhenomenonVal] = useState(
const [, setPhenomenonVal] = useState(
searchParams.get("phenomenon") ?? null,
);

Expand All @@ -46,7 +43,7 @@ export default function FilterOptions() {
}, [searchParams]);

return (
<div className="mt-[8px] space-y-3 px-3 py-[3px] dark:text-zinc-200">
<div className="mt-[8px] space-y-3 px-3 py-1 dark:text-zinc-200 flex flex-col justify-around h-full">
{navigation.state === "loading" && (
<div className="bg-white/30 dark:bg-zinc-800/30 absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm">
<Spinner />
Expand Down Expand Up @@ -104,74 +101,6 @@ export default function FilterOptions() {
</SelectContent>
</Select>
</div>
<div className="space-y-[2px]">
<Label className=" text-base">Phenomenon: </Label>
&nbsp;
<Select
value={phenomenonVal ?? undefined}
onValueChange={(value) => {
if (value === "all") {
searchParams.delete("phenomenon");
} else {
searchParams.set("phenomenon", value);
}
setSearchParams(searchParams);
}}
>
<SelectTrigger className="h-6 w-full text-base">
<SelectValue className="h-6">
{phenomenonVal ?? "---"}
</SelectValue>
</SelectTrigger>
<SelectContent className="">
<SelectItem value="all">all</SelectItem>
<SelectItem value="Temperatur">Temperatur</SelectItem>
<SelectItem value="Helligkeit">Helligkeit</SelectItem>
<SelectItem value="PM10">PM10</SelectItem>
<SelectItem value="PM2.5">PM2.5</SelectItem>
<SelectItem value="Luftdruck">Luftdruck</SelectItem>
<SelectItem value="Luftfeuchtigkeit">Luftfeuchtigkeit</SelectItem>
{!seeMorePhenomena &&
![
"Radioactivity",
"08A Pressure BME680",
"08A Temperature SHT31 flex",
].includes(phenomenonVal ?? "") && (
<>
<Separator />
<button
className="py-1.5 pl-8 pr-2 text-sm"
onClick={() => {
setSeeMorePhenomena(true);
}}
>
See More
</button>
</>
)}

{(seeMorePhenomena ||
[
"Radioactivity",
"08A Pressure BME680",
"08A Temperature SHT31 flex",
].includes(phenomenonVal ?? "")) && (
<>
<SelectItem value="Radioactivity">Radioactivity</SelectItem>
<SelectItem value="08A Pressure BME680">
08A Pressure BME680
</SelectItem>
<SelectItem value="08A Temperature BME680">
08A Temperature BME680
</SelectItem>
<SelectItem value="08A Temperature SHT31 flex">
08A Temperature SHT31
</SelectItem>
</>
)}
</SelectContent>
</Select>
</div>
</div>
<div className="flex justify-between">
<Label className="rounded-[5px] border-[1px] border-[#e2e8f0] px-2 py-[1px] text-base leading-[2.2]">
Expand All @@ -195,4 +124,4 @@ export default function FilterOptions() {
</div>
</div>
);
}
}
2 changes: 1 addition & 1 deletion app/components/header/nav-bar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Device } from "@prisma/client";
import { useState, useEffect, useRef, createContext } from "react";
import { useMap } from "react-map-gl";
import NavbarHandler from "./nav-bar-handler";
import { AnimatePresence, motion } from "framer-motion";
import { useTranslation } from "react-i18next";
import { SearchIcon, XIcon } from "lucide-react";
import type { Device } from "~/schema";

interface NavBarProps {
devices: Device[];
Expand Down
2 changes: 1 addition & 1 deletion app/components/header/nav-bar/nav-bar-handler.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Device } from "@prisma/client";
import type { Device } from "~/schema";
import Search from "~/components/search";
import { Clock4Icon, Cog, Filter, IceCream2Icon } from "lucide-react";
import useKeyboardNav from "./use-keyboard-nav";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function PhenomenonSelect() {
// const [phenomenon, setPhenomenon] = useState<string | undefined>("all");
const [searchParams, setSearchParams] = useSearchParams();
const [phenomenonVal, setPhenomenonVal] = useState(
searchParams.has("mapPheno")
? searchParams.get("mapPheno") || undefined
searchParams.has("phenomenon")
? searchParams.get("phenomenon") || undefined
: "all",
);
// const [seeMorePhenomena, setSeeMorePhenomena] = useState(false);
Expand All @@ -46,7 +46,7 @@ export function PhenomenonSelect() {
value={phenomenonVal}
onValueChange={(value) => {
setPhenomenonVal(value);
searchParams.set("mapPheno", value);
searchParams.set("phenomenon", value);
setSearchParams(searchParams);
}}
>
Expand Down
17 changes: 8 additions & 9 deletions app/components/map/layers/cluster/box-marker.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Device } from "@prisma/client";
import { Exposure } from "@prisma/client";
import type { Device } from "~/schema";
import { useMatches, useNavigate } from "@remix-run/react";
import { AnimatePresence, motion } from "framer-motion";
import { Box, Rocket } from "lucide-react";
Expand All @@ -14,12 +13,12 @@ interface BoxMarkerProps extends MarkerProps {
}

const getStatusColor = (device: Device) => {
if (device.status === "ACTIVE") {
if (device.exposure === Exposure.MOBILE) {
if (device.status === "active") {
if (device.exposure === "mobile") {
return "bg-blue-100";
}
return "bg-green-100";
} else if (device.status === "INACTIVE") {
} else if (device.status === "inactive") {
return "bg-gray-100";
} else {
return "bg-gray-100 opacity-50";
Expand All @@ -42,10 +41,10 @@ export default function BoxMarker({ device, ...props }: BoxMarkerProps) {
return 30;
}
// priority to active devices
if (device.status === "ACTIVE") {
if (device.status === "active") {
return 20;
}
if (device.status === "INACTIVE") {
if (device.status === "inactive") {
return 10;
}

Expand Down Expand Up @@ -84,12 +83,12 @@ export default function BoxMarker({ device, ...props }: BoxMarkerProps) {
isFullZoom && `${getStatusColor(device)} p-1`
)}
>
{device.exposure === Exposure.MOBILE ? (
{device.exposure === "mobile" ? (
<Rocket className="text-black h-4 w-4" />
) : (
<Box className="text-black h-4 w-4" />
)}
{isFullZoom && device.status === "ACTIVE" ? (
{isFullZoom && device.status === "active" ? (
<div
className={cn(
"absolute left-0 top-0 h-full w-full animate-ping rounded-full opacity-50",
Expand Down
2 changes: 1 addition & 1 deletion app/components/map/layers/cluster/cluster-layer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Device } from "@prisma/client";
import type { Device } from "~/schema";
import type {
GeoJsonProperties,
BBox,
Expand Down
6 changes: 3 additions & 3 deletions app/components/map/layers/cluster/donut-chart-cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export default function DonutChartCluster({
const [theme,] = useTheme();
const { categories, point_count: pointCount } = cluster.properties;
const {
ACTIVE: active = 0,
INACTIVE: inactive = 0,
OLD: old = 0,
active: active = 0,

Check warning on line 24 in app/components/map/layers/cluster/donut-chart-cluster.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

Destructuring assignment active unnecessarily renamed
inactive: inactive = 0,

Check warning on line 25 in app/components/map/layers/cluster/donut-chart-cluster.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

Destructuring assignment inactive unnecessarily renamed
old: old = 0,

Check warning on line 26 in app/components/map/layers/cluster/donut-chart-cluster.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

Destructuring assignment old unnecessarily renamed
} = categories;
const counts: number[] = [active, inactive, old];
const offsets: number[] = [];
Expand Down
2 changes: 1 addition & 1 deletion app/components/map/layers/mobile/mobile-box-layer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Sensor } from "@prisma/client";
import type { Sensor } from "~/schema";
import {
featureCollection,
lineString,
Expand Down
2 changes: 1 addition & 1 deletion app/components/map/layers/mobile/mobile-box-view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Sensor } from "@prisma/client";
import type { Sensor } from "~/schema";
import MobileBoxLayer from "./mobile-box-layer";
import { HIGH_COLOR, LOW_COLOR } from "./color-palette";
import { useEffect, useRef, useState } from "react";
Expand Down
Loading

0 comments on commit 573363b

Please sign in to comment.