From c38186f9b28f1be9aa8e1868d8d439e8df30a58f Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 31 Jul 2024 12:29:20 +0100 Subject: [PATCH 1/8] Removed redundant loading alert code --- lib/components/LoadingAlert.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/components/LoadingAlert.tsx b/lib/components/LoadingAlert.tsx index d900687..c49a4a3 100644 --- a/lib/components/LoadingAlert.tsx +++ b/lib/components/LoadingAlert.tsx @@ -22,16 +22,7 @@ function DelayedLoadingAlert() { return () => clearTimeout(timer); }); - return ( - showAlert && ( - - - - Loading... - - - ) - ); + return showAlert && ; } export { LoadingAlert, DelayedLoadingAlert }; From cf61f2a3406cf881c9a30df6ff99331e6d67d6c2 Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 31 Jul 2024 12:29:39 +0100 Subject: [PATCH 2/8] Export record to JSON --- lib/pages/Data.tsx | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/lib/pages/Data.tsx b/lib/pages/Data.tsx index 8da0f30..e7f0f83 100644 --- a/lib/pages/Data.tsx +++ b/lib/pages/Data.tsx @@ -9,7 +9,7 @@ import Button from "react-bootstrap/Button"; import Card from "react-bootstrap/Card"; import Pagination from "react-bootstrap/Pagination"; import Modal from "react-bootstrap/Modal"; -import { mkConfig, generateCsv, download, asString } from "export-to-csv"; +import { mkConfig, generateCsv, asString } from "export-to-csv"; import { useQuery } from "@tanstack/react-query"; import { MultiDropdown } from "../components/Dropdowns"; import Filter from "../components/Filter"; @@ -278,12 +278,12 @@ function Results(props: ResultsProps) { }); const handleExportToCSV = () => { - const csv = generateCsv(csvConfig)(props.resultData.data || []); + const csvData = asString( + generateCsv(csvConfig)(props.resultData.data || []) + ); if (props.fileWriter) { - props.fileWriter(fileName + ".csv", asString(csv)); - } else { - download(csvConfig)(csv); + props.fileWriter(fileName + ".csv", csvData); } }; @@ -294,6 +294,7 @@ function Results(props: ResultsProps) { +
Site:{" "} From 8831f2eea108484c1d1db243345ec5005fa4a1a6 Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 31 Jul 2024 12:29:56 +0100 Subject: [PATCH 3/8] Version bump --- lib/Onyx.tsx | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Onyx.tsx b/lib/Onyx.tsx index 6f3b581..1237c5b 100644 --- a/lib/Onyx.tsx +++ b/lib/Onyx.tsx @@ -14,7 +14,7 @@ import { OnyxProps, ProjectField } from "./types"; import "./Onyx.css"; import "./bootstrap.css"; -const VERSION = "0.12.0"; +const VERSION = "0.12.1"; function flattenFields(fields: Record) { const flatFields: Record = {}; diff --git a/package-lock.json b/package-lock.json index fb519b1..87e7c25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "climb-onyx-gui", - "version": "0.12.0", + "version": "0.12.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "climb-onyx-gui", - "version": "0.12.0", + "version": "0.12.1", "dependencies": { "@tanstack/react-query": "^4.36.1", "export-to-csv": "^1.3.0", diff --git a/package.json b/package.json index 95f687f..137df4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "climb-onyx-gui", - "version": "0.12.0", + "version": "0.12.1", "type": "module", "main": "dist/climb-onyx-gui.js", "types": "dist/main.d.ts", From 11f8a89d6b2819457b996a6b45372c4721a5572a Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 31 Jul 2024 12:37:16 +0100 Subject: [PATCH 4/8] Want to save record data only --- lib/pages/Data.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/Data.tsx b/lib/pages/Data.tsx index e7f0f83..c61e522 100644 --- a/lib/pages/Data.tsx +++ b/lib/pages/Data.tsx @@ -375,7 +375,7 @@ function RecordDetail(props: RecordDetailProps) { }); const handleExportToJSON = () => { - const jsonData = JSON.stringify(recordData); + const jsonData = JSON.stringify(recordData.data); if (props.fileWriter) { props.fileWriter(props.recordID + ".json", jsonData); From 2869bc4dbc33c791b45b5cecb586b4bce80532a1 Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 31 Jul 2024 12:37:44 +0100 Subject: [PATCH 5/8] Version bump --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87e7c25..e1c798d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "climb-onyx-gui", - "version": "0.12.1", + "version": "0.12.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "climb-onyx-gui", - "version": "0.12.1", + "version": "0.12.2", "dependencies": { "@tanstack/react-query": "^4.36.1", "export-to-csv": "^1.3.0", diff --git a/package.json b/package.json index 137df4a..4431bf2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "climb-onyx-gui", - "version": "0.12.1", + "version": "0.12.2", "type": "module", "main": "dist/climb-onyx-gui.js", "types": "dist/main.d.ts", From dd41964c6b784121c2d33e567cbb0b0a4aa7696a Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 31 Jul 2024 12:38:06 +0100 Subject: [PATCH 6/8] Version bump --- lib/Onyx.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Onyx.tsx b/lib/Onyx.tsx index 1237c5b..e4f6c95 100644 --- a/lib/Onyx.tsx +++ b/lib/Onyx.tsx @@ -14,7 +14,7 @@ import { OnyxProps, ProjectField } from "./types"; import "./Onyx.css"; import "./bootstrap.css"; -const VERSION = "0.12.1"; +const VERSION = "0.12.2"; function flattenFields(fields: Record) { const flatFields: Record = {}; From f1901c2e1746fa977e974a63a86b5214cf8e1244 Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 31 Jul 2024 12:40:25 +0100 Subject: [PATCH 7/8] Fallback incase no record data --- lib/pages/Data.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/Data.tsx b/lib/pages/Data.tsx index c61e522..e645f91 100644 --- a/lib/pages/Data.tsx +++ b/lib/pages/Data.tsx @@ -375,7 +375,7 @@ function RecordDetail(props: RecordDetailProps) { }); const handleExportToJSON = () => { - const jsonData = JSON.stringify(recordData.data); + const jsonData = JSON.stringify(recordData.data || {}); if (props.fileWriter) { props.fileWriter(props.recordID + ".json", jsonData); From 634e7880c91f94b8944e28f44833c122f7b90bc4 Mon Sep 17 00:00:00 2001 From: tombch Date: Wed, 31 Jul 2024 12:40:41 +0100 Subject: [PATCH 8/8] Version bump --- lib/Onyx.tsx | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Onyx.tsx b/lib/Onyx.tsx index e4f6c95..9eb38dc 100644 --- a/lib/Onyx.tsx +++ b/lib/Onyx.tsx @@ -14,7 +14,7 @@ import { OnyxProps, ProjectField } from "./types"; import "./Onyx.css"; import "./bootstrap.css"; -const VERSION = "0.12.2"; +const VERSION = "0.12.3"; function flattenFields(fields: Record) { const flatFields: Record = {}; diff --git a/package-lock.json b/package-lock.json index e1c798d..d369b54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "climb-onyx-gui", - "version": "0.12.2", + "version": "0.12.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "climb-onyx-gui", - "version": "0.12.2", + "version": "0.12.3", "dependencies": { "@tanstack/react-query": "^4.36.1", "export-to-csv": "^1.3.0", diff --git a/package.json b/package.json index 4431bf2..2a15ad1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "climb-onyx-gui", - "version": "0.12.2", + "version": "0.12.3", "type": "module", "main": "dist/climb-onyx-gui.js", "types": "dist/main.d.ts",