From 07364171ca441aa3ac33cf0a4fad3628515180e1 Mon Sep 17 00:00:00 2001 From: Noah Spannbauer Date: Mon, 24 Feb 2025 12:12:58 -0600 Subject: [PATCH] fixing NaN in logbook entry table --- api/package.json | 2 +- app/package.json | 2 +- app/src/components/logbook/Logbook.tsx | 40 +++++++------------------- docker-compose.yaml | 4 +-- package.json | 2 +- 5 files changed, 14 insertions(+), 36 deletions(-) diff --git a/api/package.json b/api/package.json index 09b7e87..e76705e 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "api", - "version": "1.0.0", + "version": "1.0.1", "description": "", "author": "", "private": true, diff --git a/app/package.json b/app/package.json index ddaac2c..b6ab024 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "app", "private": true, - "version": "1.0.0", + "version": "1.0.1", "type": "module", "scripts": { "dev": "vite", diff --git a/app/src/components/logbook/Logbook.tsx b/app/src/components/logbook/Logbook.tsx index 19e543e..19a47f5 100644 --- a/app/src/components/logbook/Logbook.tsx +++ b/app/src/components/logbook/Logbook.tsx @@ -167,9 +167,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info: any) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' }, { accessorKey: 'singleEngineLand', @@ -179,9 +177,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info: any) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' }, { id: 'landings', @@ -223,9 +219,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' }, { accessorKey: 'instrumentSimulated', @@ -235,9 +229,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' }, { accessorKey: 'instrumentApproaches', @@ -280,9 +272,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' }, { accessorKey: 'flightTrainingReceived', @@ -292,9 +282,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' }, { accessorKey: 'crossCountry', @@ -304,9 +292,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' }, { accessorKey: 'night', @@ -316,9 +302,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' }, { accessorKey: 'solo', @@ -328,9 +312,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' }, { accessorKey: 'pilotInCommand', @@ -340,9 +322,7 @@ const Logbook: React.FC = () => { headerAlign: 'right' }, cell: (info) => - info.getValue() !== null - ? parseFloat(info.getValue()).toFixed(1) - : '' + info.getValue() ? parseFloat(info.getValue()).toFixed(1) : '' } ] }, diff --git a/docker-compose.yaml b/docker-compose.yaml index 512ec1e..6c251a3 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,7 +18,7 @@ services: ports: - '3000:3000' env_file: - - ./api/.env + - ./api/.env.compose app: container_name: flying-app @@ -27,7 +27,5 @@ services: target: app ports: - '8080:8080' - # env_file: - # - ./app/.env diff --git a/package.json b/package.json index c6fa201..e3d388f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@noahspan/flying", - "version": "1.0.0", + "version": "1.0.1", "scripts": { "start": "concurrently 'npm run start:azure -w api' 'wait-on tcp:0.0.0.0:7071 && npm run dev -w app'", "format": "prettier --write \"**/src/**/*.ts\" \"**/test/**/*.ts\"", -- 2.49.1