From 59a34329faf181f09df0b5e3283c3783b48c4730 Mon Sep 17 00:00:00 2001 From: Graulitard <127958528+Graulitard@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:26:00 +0200 Subject: [PATCH] Fix featured projects preview image bug, prettier checked (#422) * 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 * Try fixing cron job, error caused by Strapi reloading after updating db * Fix cron jobs issue and update Footer info * Fixing not available satellites * Fix FeaturedProjects preview images bug * Prettier updated --- .../app/_homeComponents/FeaturedProjects.tsx | 17 +++++++------- .../satellites/SatelliteResponsiveTable.tsx | 22 ++++++++++++------- .../[satelliteSlug]/orbitDataGraph.tsx | 9 ++++++-- frontend/src/components/layout/Footer.tsx | 7 +++++- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/frontend/src/app/_homeComponents/FeaturedProjects.tsx b/frontend/src/app/_homeComponents/FeaturedProjects.tsx index 11af6d0..69fff6b 100644 --- a/frontend/src/app/_homeComponents/FeaturedProjects.tsx +++ b/frontend/src/app/_homeComponents/FeaturedProjects.tsx @@ -19,14 +19,6 @@ export default async function FeaturedProjects() { featuredProjects?.featuredProject3, ]; - let image_url = undefined; - if (STRAPI_URL) { - image_url = - STRAPI_URL + - featuredProjects?.featuredProject1?.data?.attributes?.previewImage - ?.data?.attributes?.url; - } - return (
@@ -50,6 +42,13 @@ export default async function FeaturedProjects() { if (!project?.data?.attributes?.title) { return null; } + let previewImage = + project?.data?.attributes?.previewImage?.data + ?.attributes?.url; + + if (STRAPI_URL && previewImage != undefined) { + previewImage = STRAPI_URL + previewImage; + } return ( ); })} diff --git a/frontend/src/app/satellites/SatelliteResponsiveTable.tsx b/frontend/src/app/satellites/SatelliteResponsiveTable.tsx index 484472e..8010028 100644 --- a/frontend/src/app/satellites/SatelliteResponsiveTable.tsx +++ b/frontend/src/app/satellites/SatelliteResponsiveTable.tsx @@ -99,14 +99,20 @@ 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 b97b3b9..3d368be 100644 --- a/frontend/src/app/satellites/[satelliteSlug]/orbitDataGraph.tsx +++ b/frontend/src/app/satellites/[satelliteSlug]/orbitDataGraph.tsx @@ -194,9 +194,14 @@ const OrbitDataGraph: React.FC = ({ <> {orbitalData && (
-
+

Orbital parameters history (source :

- Space Track + + Space Track +

)

diff --git a/frontend/src/components/layout/Footer.tsx b/frontend/src/components/layout/Footer.tsx index 87b85a0..bdb23f9 100644 --- a/frontend/src/components/layout/Footer.tsx +++ b/frontend/src/components/layout/Footer.tsx @@ -53,7 +53,12 @@ export default function Footer() {
- NTNU Small Satellite Lab + + NTNU Small Satellite Lab + Trondheim, Norway

Norwegian University of Science and Technology