Skip to content

Commit

Permalink
Merge branch 'florian'
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Graule committed Sep 25, 2024
2 parents d08e7d4 + ce866d0 commit c7adaed
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
15 changes: 5 additions & 10 deletions frontend/src/app/satellites/SatelliteResponsiveTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,12 @@ export default function SatelliteResponsiveTable({
<TableRow
className="cursor-pointer hover:bg-white hover:text-black"
key={satellite.attributes?.catalogNumberNORAD}
{...(satellite.attributes?.catalogNumberNORAD
? {
onClick: () =>
handleRowClick(
satellite.attributes
?.slug ?? "",
),
}
: {})}
onClick={() =>
handleRowClick(
satellite.attributes?.slug ?? "",
)
}
>

<TableCell className="px-6">
{satellite.attributes?.name}
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ const OrbitDataGraph: React.FC<OrbitDataProps> = ({
lastChartDate.setMonth(
firstChartDate.getMonth() + scrollBarTimeFrame.current,
);

// Filtering the data to display only the data in the selected period
const filteredData = orbitalData
.filter((data: any) => {
Expand All @@ -140,6 +139,7 @@ const OrbitDataGraph: React.FC<OrbitDataProps> = ({
.map((data: any) => {
return {
...data,
semiMajorAxis: data.semiMajorAxis - 6371,
epoch: new Date(data.epoch.slice(0, 23) + "Z"),
};
});
Expand Down Expand Up @@ -190,12 +190,14 @@ const OrbitDataGraph: React.FC<OrbitDataProps> = ({
return () => window.removeEventListener("resize", updateSize);
}, []);

console.log("orbitalData", orbitalData);

return (
<>
{orbitalData && (
<div ref={svgContainer} className="flex w-full flex-col">
<div className="mb-5 flex">
<p>Orbital parameters history (source :</p>
<p>Orbital parameters history (source : </p>
<a
className="hover:underline"
href="https://www.space-track.org/"
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/satellites/[satelliteSlug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export default async function SatelliteInfoPage({
imageURL = STRAPI_URL + satelliteImage;
}

console.log("satAttributes", satAttributes);

return (
<>
<div className="flex flex-col items-center">
Expand Down Expand Up @@ -155,7 +157,6 @@ export default async function SatelliteInfoPage({
</div>
</div>


{/* Container for graph of historical orbital data */}
<div className="mt-8 flex w-full flex-col items-center">
{/*Pass the historicalData and the launchDate as props to OrbitDataGraph*/}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/satellites/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export default async function Satellites() {
);

let satellitesInOrbit = graphqlData.data.satellites?.data.filter(
(data) => data.attributes?.catalogNumberNORAD !== null,
(data) => data.attributes?.missionStatus === "IN ORBIT",
);
let satellitesNotInOrbit = graphqlData.data.satellites?.data.filter(
(data) => data.attributes?.catalogNumberNORAD == null,
(data) => data.attributes?.missionStatus !== "IN ORBIT",
);

return (
Expand Down

0 comments on commit c7adaed

Please sign in to comment.