fixing NaN in logbook entry table

This commit is contained in:
2025-02-24 12:12:58 -06:00
parent 0ff30e9761
commit 07364171ca
5 changed files with 14 additions and 36 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "api", "name": "api",
"version": "1.0.0", "version": "1.0.1",
"description": "", "description": "",
"author": "", "author": "",
"private": true, "private": true,

View File

@@ -1,7 +1,7 @@
{ {
"name": "app", "name": "app",
"private": true, "private": true,
"version": "1.0.0", "version": "1.0.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@@ -167,9 +167,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info: any) => cell: (info: any) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
}, },
{ {
accessorKey: 'singleEngineLand', accessorKey: 'singleEngineLand',
@@ -179,9 +177,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info: any) => cell: (info: any) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
}, },
{ {
id: 'landings', id: 'landings',
@@ -223,9 +219,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info) => cell: (info) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
}, },
{ {
accessorKey: 'instrumentSimulated', accessorKey: 'instrumentSimulated',
@@ -235,9 +229,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info) => cell: (info) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
}, },
{ {
accessorKey: 'instrumentApproaches', accessorKey: 'instrumentApproaches',
@@ -280,9 +272,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info) => cell: (info) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
}, },
{ {
accessorKey: 'flightTrainingReceived', accessorKey: 'flightTrainingReceived',
@@ -292,9 +282,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info) => cell: (info) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
}, },
{ {
accessorKey: 'crossCountry', accessorKey: 'crossCountry',
@@ -304,9 +292,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info) => cell: (info) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
}, },
{ {
accessorKey: 'night', accessorKey: 'night',
@@ -316,9 +302,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info) => cell: (info) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
}, },
{ {
accessorKey: 'solo', accessorKey: 'solo',
@@ -328,9 +312,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info) => cell: (info) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
}, },
{ {
accessorKey: 'pilotInCommand', accessorKey: 'pilotInCommand',
@@ -340,9 +322,7 @@ const Logbook: React.FC<unknown> = () => {
headerAlign: 'right' headerAlign: 'right'
}, },
cell: (info) => cell: (info) =>
info.getValue() !== null info.getValue() ? parseFloat(info.getValue()).toFixed(1) : ''
? parseFloat(info.getValue()).toFixed(1)
: ''
} }
] ]
}, },

View File

@@ -18,7 +18,7 @@ services:
ports: ports:
- '3000:3000' - '3000:3000'
env_file: env_file:
- ./api/.env - ./api/.env.compose
app: app:
container_name: flying-app container_name: flying-app
@@ -27,7 +27,5 @@ services:
target: app target: app
ports: ports:
- '8080:8080' - '8080:8080'
# env_file:
# - ./app/.env

View File

@@ -1,6 +1,6 @@
{ {
"name": "@noahspan/flying", "name": "@noahspan/flying",
"version": "1.0.0", "version": "1.0.1",
"scripts": { "scripts": {
"start": "concurrently 'npm run start:azure -w api' 'wait-on tcp:0.0.0.0:7071 && npm run dev -w app'", "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\"", "format": "prettier --write \"**/src/**/*.ts\" \"**/test/**/*.ts\"",