From ea768b302ebcfc6fbcbec24e9ccd3095c363a5bc Mon Sep 17 00:00:00 2001 From: Graulitard <127958528+Graulitard@users.noreply.github.com> Date: Tue, 13 Aug 2024 19:25:48 +0200 Subject: [PATCH] Florian (#421) * Fetching data from Space-Track, fixing some bugs, adding cron tasks for updating database with tool functions * Orbital chart done, using backend data without refetching from the backend server * Clean code of orbitalDataGraph, restore strapi files, adding cronTask to the 3rd of each month. * Adding package*.json files * ESLint fixed * Updating strapi env * Reseting frontend/package.json * Prettier checked * Updating for ESlint check * Adding backend env file * Revert "Adding backend env file" This reverts commit 88a46fb157ab99a06248e064b1c228fdde788dd0. * Try fixing cron job, error caused by Strapi reloading after updating db * Fix cron jobs issue and update Footer info * Fixing not available satellites --- backend/config/functions/satelliteUtils.js | 1 - .../app/satellites/SatelliteResponsiveTable.tsx | 17 ++++++++--------- .../[satelliteSlug]/orbitDataGraph.tsx | 5 +++++ .../src/app/satellites/[satelliteSlug]/page.tsx | 5 +++-- frontend/src/components/layout/Footer.tsx | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/backend/config/functions/satelliteUtils.js b/backend/config/functions/satelliteUtils.js index c98c0b9..a43f2af 100644 --- a/backend/config/functions/satelliteUtils.js +++ b/backend/config/functions/satelliteUtils.js @@ -11,7 +11,6 @@ async function fetchOrbitalData(noradId) { if (authResponse.status === 200) { // Fetching data from Space-Track - const today = new Date(); const satelliteResponse = await axios.get(`https://www.space-track.org/basicspacedata/query/class/gp_history/NORAD_CAT_ID/${noradId}/orderby/TLE_LINE1%20ASC/orderby/TLE_LINE1%20ASC/format/json`, { headers: { diff --git a/frontend/src/app/satellites/SatelliteResponsiveTable.tsx b/frontend/src/app/satellites/SatelliteResponsiveTable.tsx index 72bd56d..484472e 100644 --- a/frontend/src/app/satellites/SatelliteResponsiveTable.tsx +++ b/frontend/src/app/satellites/SatelliteResponsiveTable.tsx @@ -99,15 +99,14 @@ export default function SatelliteResponsiveTable({ /> )) : (satellites ?? []).map((satellite) => ( - - handleRowClick( - satellite.attributes?.slug ?? "", - ) - } - > + + handleRowClick(satellite.attributes?.slug ?? "") + } : {})} + > {satellite.attributes?.name} diff --git a/frontend/src/app/satellites/[satelliteSlug]/orbitDataGraph.tsx b/frontend/src/app/satellites/[satelliteSlug]/orbitDataGraph.tsx index 5c6295f..b97b3b9 100644 --- a/frontend/src/app/satellites/[satelliteSlug]/orbitDataGraph.tsx +++ b/frontend/src/app/satellites/[satelliteSlug]/orbitDataGraph.tsx @@ -194,6 +194,11 @@ const OrbitDataGraph: React.FC = ({ <> {orbitalData && (
+
+

Orbital parameters history (source :

+ Space Track +

)

+

Zoom :

{/* Scrollbar thumb represents the zoom period selected, in case it fits bad we don't display diff --git a/frontend/src/app/satellites/[satelliteSlug]/page.tsx b/frontend/src/app/satellites/[satelliteSlug]/page.tsx index 5ee8338..f25c948 100644 --- a/frontend/src/app/satellites/[satelliteSlug]/page.tsx +++ b/frontend/src/app/satellites/[satelliteSlug]/page.tsx @@ -155,9 +155,10 @@ export default async function SatelliteInfoPage({
- {/* Orbit data */} + + {/* Container for graph of historical orbital data */}
- {/*Pass the satNum and the launchDate as props to OrbitDataGraph*/} + {/*Pass the historicalData and the launchDate as props to OrbitDataGraph*/} {noradId ? ( satAttributes?.launchDate ? (
- NTNU Small Satellite Lab + NTNU Small Satellite Lab Trondheim, Norway

Norwegian University of Science and Technology