From 01e83e9ff425af6dd9b961cb947761ac6ba140ca Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Tue, 26 Dec 2023 10:00:04 +0100 Subject: [PATCH] fix: Update LiveViewPage layout and adjust AnalyzerRuns fetch method The layout for the LiveViewPage in the frontend has been updated to include a PageLayout component. It also now logs the received data. In the backend, the fetchAnalyzerRuns method in the MiningGraphQL class has been slightly altered. The SQL query LIMIT clause has been removed from the find method string argument and implemented instead as method argument via the page method for better readability and maintainability. --- frontend/src/pages/LiveViewPage.tsx | 5 +++-- .../martinwitt/laughing_train/mining/api/MiningGraphQL.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/LiveViewPage.tsx b/frontend/src/pages/LiveViewPage.tsx index da869a7c0..342e8839d 100644 --- a/frontend/src/pages/LiveViewPage.tsx +++ b/frontend/src/pages/LiveViewPage.tsx @@ -17,7 +17,7 @@ export function LiveViewPage() { const { data, loading, error } = useRecentRunsQuery({}); if (loading || error) { return ( - <> + Home @@ -25,9 +25,10 @@ export function LiveViewPage() { LiveView - + ); } + console.log(data); if (!data?.recentRuns || data.recentRuns.length === 0) { return ( diff --git a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/api/MiningGraphQL.java b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/api/MiningGraphQL.java index 2f1c5a320..d8aec8ff6 100644 --- a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/api/MiningGraphQL.java +++ b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/api/MiningGraphQL.java @@ -2,11 +2,12 @@ import io.github.martinwitt.laughing_train.mining.AnalyzerRunGraphQlDto; import io.quarkus.security.Authenticated; -import java.util.List; import org.eclipse.microprofile.graphql.GraphQLApi; import org.eclipse.microprofile.graphql.Mutation; import org.eclipse.microprofile.graphql.Query; +import java.util.List; + /** This class provides GraphQL endpoints for querying and retrieving analyzer run data. */ @GraphQLApi public class MiningGraphQL { @@ -42,7 +43,7 @@ private List constructAnalyzerRunGraphQlDtos( * @return A list of AnalyzerRunDao objects. */ private List fetchAnalyzerRuns(int limit) { - return AnalyzerRunDao.find("ORDER BY localDateTime DESC LIMIT").page(0, limit).list(); + return AnalyzerRunDao.find("ORDER BY localDateTime DESC").page(0, limit).list(); } @Authenticated